TWO years ago tomorrow, in the rococo-mirrored splendour of his official residence in Bute House, Alex Salmond announced his resignation as First Minister. He insisted that the dream of independence “would never die” despite the defeat in the referendum. Few of the assembled media folk gathered to witness his political demise believed a word of it. It looked as if the 300-year-old Union between Scotland and England had been saved, by a narrow margin admittedly, but saved nevertheless. The great Alex Salmond, who had taken the Scottish National Party from the fringes of the political universe to the seat of government in the Scottish Parliament, was now part of history.

The referendum result had been a shattering blow to the activists of Yes Scotland, many of whom believed, as Alex Salmond had, that they'd “squeaked it” in the final days of the most extraordinary campaign Scotland had ever seen. As the independence movement went into a period of mourning and introspection, it looked as if independence might be cast from the political agenda for at least a generation. Labour looked forward to being restored as Scotland's “true” party of government. But it was not to be.

Read more: Nicola Sturgeon: Independence 'transcends' Brexit, oil and the economy​

No sooner had Nicola Sturgeon replaced Alex Salmond as First Minister than the membership of the Scottish National Party began an exponential rise that would soon make it the third-largest party in the entire UK with over 120,000 members. Within a year, all but one of Labour's 41 Westminster MPs were lost to the SNP in a general election that saw the biggest swing in parliamentary history. And that was only the start. In the 2016 Scottish Parliamentary elections, the SNP won more seats than all three Unionist parties, Labour, Tory, Libdem combined. Then came the big one: Brexit.

The Herald: First Minister Nicola Sturgeon speaks launching a fresh bid to convince Scots to back independence earlier this month

Few could have imagined back in 2014 that Britain would shortly vote to leave the European Union, and that the victorious Tory Prime Minister, David Cameron – who'd claimed the Queen “purred” at the Scottish result – would himself soon be resigning in ignominy along with his deeply unpopular Chancellor, George Osborne. Scotland voted overwhelmingly to remain in the EU, raising profound new questions about the viability of the Union. The pace of political change has been bewildering. Two emotionally-taxing referendums and two parliamentary elections in as many years have left Scottish voters dazed and confused. But one thing is certain: independence remains very firmly on the political agenda as the country awaits Nicola Sturgeon's decision on the timing of the next referendum.

Of course, the key fact on the ground, as they say in the US military, is that Better Together won the Scottish independence referendum by a comfortable 55 per cent to 45 per cent. But this was clearly not the end of the matter. The idea of a “better nation” had captured the imaginations of 1.6 million Scots, many of them non-nationalists. The character of the Yes campaign perhaps mattered almost as much as the result. The 2014 referendum was a defining moment in Scottish history as the whole country engaged in the independence debate really for the first time in 300 years. There was an unprecedented 97 per cent voter registration as the debate energised whole sections of the Scottish electorate, especially in working-class areas which had either never voted before or had given up on electoral politics.

Read more: Tommy Sheppard: The Yes movement must engage people to keep the dream of independence alive​

Yes Scotland, with its 200 local groups, working in concert with non-SNP organisations, like Radical Independence Campaign, Women for Independence, National Collective, the Green Party and others, created a critical mass for change, building from street level. It was an asymmetrical battle of ideas, with the Yes activists on the ground challenging the relentlessly negative messages coming down from the established political parties, press and media. Yes countered by being relentlessly positive aiming at “conversion by conversation” – sometimes at tedious length.

This approach was successful in neutralising much of Better Together's characterisation of independence as a ruinous and divisive constitutional option that would bankrupt Scotland and lead to isolation from Europe. The Yes campaign insisted, on the contrary, that an independent Scotland could be a successful social democratic nation just like Norway or Denmark. Scotland, they said, wasn't “too wee too poor, too stupid” but a “wealthy country”. It was just a matter of “hope over fear”, as the indyref mantra put it.

The Herald: Yes Scotland admits it was £500,000 in the red after referendum

It seems clear now that Scotland was in the vanguard of a new wave of anti-establishment politics that has swept away many centrist social democratic parties in countries like Greece and Spain. Mass re-engagement in politics has been disrupting the conventional parliamentary status quo as new forces, like the Scottish independence campaign, erupt as if from nowhere. Having experienced this kind of tranformative politics, the many activists drawn to it are refusing to return to the colourless retail politics of the past.

The reverberations of indyref politics have been felt almost as strongly south of the Border. The Corbyn phenomenon, which has transformed the UK Labour Party into the largest left-wing party in Europe, with a renewed commitment to radical policies, has much in common with the Yes campaign in Scotland, not least in its willingness to defy the electoral odds. The influx of new members, determined to see an alternative to the pro-market dogmas of New Labour, behave much as the Yessers did in Scotland. They are evangelically positive and have similarly organised though social media, using it as an alternative to the established press and broadcasting as a source of ideas and information.

Read more: Ruth Davidson: My vision of Scotland's future in the union​

And their passion also gets the better of them sometimes online. In the recent Labour civil war, the “Corbynites” on social media have been condemned as extremists, much as the independence supporters in Scotland were dubbed “cybernats”. Sometimes this is by the same establishment figures. The novelist JK Rowling, who took up arms on Twitter against angry independence supporters in 2014, has spent much of 2016 butting heads with supporters of Jeremy Corbyn, who she famously insisted “Is. Not. Dumbledore”.

But for all the angry exchanges on the internet, the 2014 Scottish independence campaign was, to its great credit, almost entirely peaceful and democratic. The only missile thrown was a solitary egg hurled at the then leader of the Scottish Labour Party, Jim Murphy, during his 100-day speaking tour of Scottish towns. The egg-hurler, Stuart MacKenzie, was sentenced to an extraordinary 80 hours of community service for an offence that is very rarely prosecuted. The only really significant disturbance of the peace occurred the day after the referendum vote when loyalists waving Union flags descended on Glasgow's George Square and forcefully broke up the vigil held there by Yes campaigners.

The Herald: The then-Deputy First Minister of Scotland Nicola Sturgeon and actor Alan Cumming outside the Yes Kelvin campaign hub in Glasgow ahead of the Scottish independence referendum vote on September 18, 2014.

Scotland surprised itself in 2014. Few believed that a 45 per cent vote for independence was possible in a country where only around 25 per cent of voters had traditionally supported formal independence. For most of the previous 300 years, political independence had been rejected overwhelmingly by Scots as a practical political option. The SNP had largely been an electoral irrelevance until the creation of the Scottish Parliament in 1999. Now, Nicola Sturgeon is teetering on the edge of another independence referendum which almost everyone, including unionists like the former LibDem leader Nick Clegg last week, seems to believe is inevitable.

Many in the independence movement would like the FM to seize the moment and call “indyref2”, as it is known on social media, forthwith. There has been – as she herself has put it – a “material change in circumstances” since Brexit, which they believe justifies another ballot. But Sturgeon is keeping her own counsel. The First Minister is a cautious “utilitarian nationalist” who doesn't go in for glorious defeats, and will only call another referendum when it is absolutely clear she will win it. At present, though support for independence has grown marginally since 2014, the numbers do not add up.

But there is no doubt that circumstances have changed. One of the main planks of the Better Together campaign was the claim that by leaving the UK, Scotland would be forced to leave the European Union. For many Scottish voters this was a key issue, not least because Europe, under the then President of the European Commission, Jose Manuel Barroso, seemed discouraging, to say the least, about an independent Scotland joining the European Union. Yet now Scotland has been dragged out of the EU by remaining within the UK, and European politicians have been falling over themselves to commend Scotland for voting overwhelmingly for Remain.

Of course, warm words in Brussels will do nothing to keep Scotland in the EU, or even in the European Single Market, if the new Prime Minister, Theresa May, holds to her word that “Brexit means Brexit”. There is considerable debate as to the true meaning of that word, but no-one is in any doubt that where Britain goes, Scotland follows. The UK is the member state and it alone will negotiate the Article 50 terms of departure. Nicola Sturgeon's attempts to carve out a distinct future for Scotland in Europe have been frustrated by the constitutional reality that Scotland remains a region of the UK.

Read more: Campaigners mark second anniversary of independence referendum​

May promised that Scotland would be consulted on the terms of Brexit – she even suggested in her visit to Bute House in June that she would not fire the starting gun for Article 50 until there was “an agreed UK approach” involving all the nations and regions of the UK. But any thoughts Holyrood could thus have a veto on Brexit, or even any say on the terms of it, were rapidly dispelled. The Brexit Secretary, David Davis, made clear in July that Scotland could not obstruct the “mandate” of the 17.5 million voters of the UK. Indeed, he now says even Westminster Parliament will be excluded from passing a vote on Article 50.

Nicola Sturgeon made clear again last week that she regards Single Market access as essential to Scotland's economic wellbeing. The former SNP minister, Mike Russell, who has been placed in charge of Brexit, insists that “Scotland is not full up” and needs free movement of labour to meet its economic objectives. But since the UK Government is determined to end mass immigration from the EU, it seems most unlikely that any deal can be done to keep the UK in the European Single Market (ESM), which of course requires free movement. Many Brexiteers anyway regard the ESM as the source of much of the EU's intrusive and bureaucratic regulation.

The Herald: Thousands of Yes campaigners  march through Glasgow to the BBC Scotland Headquarters at Pacific Quay

There is little doubt that Brexit has made many No voters wonder if they made the right choice two years ago. Many Scots were worried about there being a hard border with England; now there is the likelihood of a hard border with the European Union, for people, goods and services. Scotland's interests were supposed to be protected by remaining in the security of the UK; now they have been plunged into the profound uncertainty of Brexit. The Fraser of Allander Institute warned last week that leaving the EU, coupled with UK austerity, could bring an unprecedented financial squeeze on Scottish spending, which could endanger many public services by 2020/21.

The case for the Union has been holed beneath the waterline as Scotland faces a future as part of an isolationist Britain led by xenophobic right-wing Conservatives obsessed with controlling immigration. But this has not as yet led to any mass conversion to the independence cause, at least if the evidence of opinion polls is accurate. Many Scots remain worried about cutting off from the UK at the same time as the UK is cutting off from the EU. Scottish independence might only add a new new layer of uncertainty to the confusion about the meaning of Brexit. Risk-averse Scots are anxious to wait and see what happens to relations with Europe before reviewing relations with the UK. This is perfectly understandable and Scottish Nationalists damage their cause when they attack this as a failure of will or a want of patriotism.

The truth is that the independence project has itself undergone much revision since 2014. There is renewed uncertainty over the future currency of an independent Scotland. Nicola Sturgeon has ordered a review of the position taken in the 2013 Independence White paper that Scotland would remain in a currency union with the rest of the UK after independence. Alex Salmond's insistence on keeping the pound has been criticised by one of his key former economic advisers, Professor Joseph Stiglitz. He argues that Scotland should cut off from sterling, set up its own central bank and issue its own currency, perhaps pegged to the pound.

Many in the independence movement agree. During the referendum campaign, there was much disquiet in the Yes campaign, not least from the Scottish Green leader, Patrick Harvie, over Alex Salmond's assertion that the UK would continue to accept currency union. It seemed to fly in face of reality. The Chancellor, George Osborne, and the Governor of the Bank of England, Mark Carney, had made clear that, as Osborne put it: “If Scotland walks away from the UK it walks away from the pound.”

However, the idea of a separate Scottish currency brings its own problems. First of all, it would seem to imply a “hard border” with England meaning that Scots would have to change currency when they visited their relatives in England. There would also be transaction costs imposed on Scottish exports to the biggest trading partner. Then there is the need to build up substantial currency reserves to back a new currency and ensure Scotland gets a favourable credit rating. There is no easy option.

Moreover, it is not clear the currency plan was a decisive vote-loser in the referendum. Indeed, according to some polls, even a majority of No voters rejected the UK Chancellor's warnings on the pound by the later weeks of the campaign. It was less the technical debate over currency and more the idea of self-government, of taking back control, that motivated so many Scots to vote for independence. And yes, that sense of “taking back control” is also what motivated many Brexit voters in England during the EU referendum.

Scottish Nationalists do not like comparisons being made between Scottish independence and Brexit, not least because the latter appeared to be largely about immigration and “putting the Great back into Britain”. The Scottish independence campaign called for more immigration, not less, and it kept national chauvinism under tight rein. The Yes campaign was a civic nationalist movement which did not condone notions of cultural superiority, ethnic exceptionalism, still less xenophobia. Nor does the Scottish National Party tolerate anti-Englishness in its ranks. Indeed, some critics like the former SNP leader, Gordon Wilson, believe that the Yes campaign failed to exploit the emotional appeal of cultural nationalism.

However, it wasn't a celebration of Scottishness for its own sake that captured the votes of 1.6 million in 2014, but the idea that Scotland could create a better society liberated from the grip of a financial elite in the City of London and a Westminster elite dominate by neoliberalism and austerity economics. That can-do spirit survives. Two years on from the independence referendum, the excitement of 2014 with the Yestivals and the sense of possibilities has gone. But Scotland has been left a much more confident nation, secure in its ability, when the time is right, to seek full self-government, to whatever extent its people demand. Getting that timing right will be Nicola Sturgeon's greatest political challenge.