With her speech to the Scottish parliament this week, First Minister Nicola Sturgeon set out an approach to a potential second independence referendum in the next two years.

She included major caveats, not least Brexit going ahead and Westminster approving a section 30 order.

If there was an independence referendum in the next two years, lets say by the end of 2020, and if there was a ‘yes’ vote, how straightforward would it be for an independent Scotland to re-join the EU and how long might it take?

Read more: Nicola Sturgeon says Scotland needs indyref2 to have a choice to avoid Brexit

There are many uncertainties here, including whether, when and on what basis Brexit goes ahead, and how long any independence ‘divorce’ talks would take between the Scottish and UK governments.

If the UK stayed in the EU, it would, in many ways, be much easier for an independent Scotland to then stay in or re-join. The UK, including Scotland, would not have diverged from EU laws and regulation, and there would not be any of the border problems between Scotland and the rest of the UK that a hard Brexit (outside the single market and customs union) might entail.

If Brexit does go ahead, then the challenges will be bigger.

Timing and Staying Aligned with EU Laws

On independence, Scotland as a European country would be entitled to apply to join the EU. If there was a ‘yes’ vote in December 2020, then divorce talks ahead of actual independence might take around two years or more. So if Scotland became independent at the start of 2023, how long could it take to re-join the EU?

This will partly depend on where the Brexit process has got to.

If the UK leaves the EU by the end of 2019, the transition period, where the UK stays in the EU’s single market and customs union but without a voice or vote, would last until the end of December 2020.

This could be extended by mutual UK and EU agreement until the end of 2022. But if there isn’t an extension, or there was a no deal Brexit, then it’s possible that to some extent UK laws might have started to diverge from EU laws by the time Scotland became independent.

Read more: Mark Smith: What Nicola Sturgeon said … and what it actually meant

But, if there was a ‘yes’ vote as early as December 2020 i.e. by the end of the initial Brexit transition with the UK still fully aligned, that would give scope politically to agree Scotland should stay aligned to EU rules even while the UK subsequently diverged.

This would require UK agreement but in the face of an independence vote, accepted as legally correct by both sides, it’s not obvious why this would be obstructed.

And if Scotland was clearly aiming to re-join the EU, the EU would also, from the outside, be likely to recommend Scotland did its best to stay aligned.

Given UK-EU trade talks would be under way at that point, the UK would also potentially come under some soft pressure from the EU on this

An independent Scotland would need to apply to join the EU. The European Commission would assess its application and recommend to the European Council whether to agree to open accession talks.

Those talks would cover all 35 chapters of the EU’s rules and laws – its acquis. This process, if it didn’t hit any stumbling blocks, might take two years for the application and talks and then another two years for ratification of the accession treaty (as Tobias Lock and I argued in our analysis of this in 2017).

Read more: How European media reacted to Nicola Sturgeon's indyref2 update

Once the accession treaty was awaiting ratification, Scotland would have observer status in the EU . And it would doubtless in the meantime have an association agreement with the EU, like other accession candidates.

So if Scotland became independent at the start of 2023, this analysis means it could take until 2027 to re-join the EU.

During this 4 year period, having an association agreement with the EU would be vital. It would set out Scotland’s relationship with the EU in the interim (forestalling any need to have a ‘temporary’ European Economic Area membership).

Issues in the Talks

As long as Scotland had not diverged from the EU’s rulebook, relatively rapid accession talks could be envisaged. But there will be substantive issues to negotiate, in particular where the UK had special deals and opt-outs.

Scotland is unlikely to benefit from the UK’s current budget rebate, so its own budget contribution would have to be agreed in the negotiations.

Scotland would also be unlikely to get any opt-out from the euro, so it would have to commit to eventually joining the euro (although once in the EU, this process could be put off indefinitely). But the currency debate comes to the fore here.

Read more: Greens savage SNP's economic plan for independence

If Scotland had kept the pound sterling, but the UK was outside the EU, then Scotland would not be able to demonstrate that it could commit to join the euro at some indefinite future point.

Nor – if it took up to a decade to adopt its own currency – could it show that as a member state it would use its independent monetary policy to target price stability and make its exchange rate a ‘matter of common concern’ with other member states (as required by the EU’s Lisbon treaty). So this would be a significant political challenge.

Scotland would be likely – as both the UK and Ireland currently do – to request and probably get an opt-out from the Schengen border-free zone, in order to allow it to remain part of the Common Travel Area that currently exists between the UK and Ireland.

But there’s no obvious reason to expect the EU to replicate the UK’s current special opt-in deal for justice and home affairs issues, where the UK gets to ‘pick and mix’ which measures it opts into (bizarrely still opting into measures this month even while pressing ahead with Brexit).

Read more: Nicola Sturgeon advisers questions point of new Scottish currency

An independent Scotland could, of course, decide to drop the goal of joining the EU – although this would be a major change.

It could decide to apply to join the European Economic Area (EEA) instead – and accept the democratic deficit that Norway contends with, rather than be at the EU’s top table alongside Ireland and others.

Keeping the pound would then be simpler on that score. But EEA membership might look more problematic if the rest of the UK did end up in a customs union with the EU (as is quite likely under the Withdrawal Agreement, unless there’s a no deal Brexit).

EEA members have to be in EFTA – and EFTA members have their own trade deals and cannot, without an exemption, be in a customs union with the EU too.

Overall, an independent Scotland should have the prospect of a relatively swift and smooth route to re-joining the EU, subject to negotiating the substantive issues covered above.

Read more: SNP hit back as Theresa May claims independent Scotland could not stay in EU

The politics of how the EU member states would look at Scotland’s application to re-join would also be much more constructive, not least in the face of Brexit.

Accession would still require unanimity, and the future politics of different member states, including Spain, cannot be guaranteed. But, for now, the political reluctance expressed in Brussels in 2014 would not be replicated. And Scotland would be able to develop its bilateral relationships with the EU’s member states, as its accession talks proceeded.

It’s a two-sided dance – an independent Scotland would have to decide re-joining the EU was its priority. And the EU27 would have to agree it could.

Dr Kirsty Hughes is director of the Scottish Centre on European Relations. This article first appeared online titled An Independent Scotland in the EU: Timing and Challenges