Nicola Sturgeon described the Northern Ireland protocol as a “template” for how borders could operate in an independent Scotland inside the EU.
But with Boris Johnson now poised to unpick his own work so ministers can override key parts of the agreement, where does that leave the first minister?
An independent Scotland would have to find some way to reach a deal with the rest of the UK if it wants to become an EU member without the need for a hard border.
Ms Sturgeon says she wants a referendum next year but the prime minister’s moves on the other side of the North Channel illustrate just how choppy waters could get.
How does the protocol work?
The protocol was agreed as a special arrangement following the Brexit vote because Northern Ireland is the only part of the UK with a land border with an EU country.
Checkpoints remain a deeply sensitive issue but pro-Union parties also do not want Northern Ireland to be treated differently than other parts of the UK.
The agreement means goods can pass freely between Northern Ireland and the Republic of Ireland.
Northern Ireland continues to follow EU rules on product standards so checks are carried out when they arrive from the rest of the UK.
Unionist politicians argue it has effectively created a border in the sea.
Where does it leave Nicola Sturgeon?
The problem for Nicola Sturgeon is she appears to have bet the house on the EU and UK Government being able to make it work.
She told the Irish Times last year that the protocol, if there are “easements”, would offer “some template” for a newly independent Scotland trying to navigate EU membership and maintaining free trade with the rest of the UK.
A few days earlier she argued “the government in Westminster is one that says that trade friction can be completely ironed out in Northern Ireland” – so why not Scotland?
On another occasion she said it was an “absolutely false argument” to say a hard border would be needed in Scotland, and anyone who doubts that need only to listen to what Ireland was being told by the UK following the Brexit vote.
An aside – a UK government that is able to say that come what may, it will avoid hard borders with Ireland/NI after Brexit can never again tell Scotland that independence would mean a hard border between Scotland and rUK
— Nicola Sturgeon (@NicolaSturgeon) December 8, 2017
The core of her argument is clear: if the UK Government is correct on the protocol working in Northern Ireland, then she must be correct on there being no need for a hard border in Scotland.
The latest position should set alarm bells ringing.
Despite signing up to the protocol, Boris Johnson now says it needs to be “fixed”.
He has been warned his actions could lead to a trade war with the EU.
But the prime minister looks set to push on regardless, his intentions catalysed by a desire to help restore power sharing at Stormont.
‘Shoring up’ bad behaviour
The Democratic Unionist Party has refused to do a deal to restore Stormont until its concerns over the protocol are addressed.
Mr Johnson has been accused of “shoring up” its “bad behaviour” because he desperately needs a win after the partygate scandal – and a restored Stormont and bun fight with the EU would fit the bill nicely.
The prime minister argues the government’s priority is to uphold the Good Friday Agreement and maintain peace in Northern Ireland.
But imagine an independent Scotland facing the same challenges, as a future trading partner of the UK.
Would it really be acceptable to operate on a basis where the country’s most significant market could rip up the rules just six years after an independence vote because of some unforeseen political pressure?
What would that uncertainty do to Scottish businesses, who export three times more to the rest of the UK than to the EU?
Answers won’t just float into view
The situation in Northern Ireland mirrors many of the complexities a newly-independent Scotland would face, and the protocol discussions show answers rarely just come floating into view.
Rejoining the EU remains a key pillar of the SNP’s independence plan but serious gaps remain in explaining how that would affect borders with the rest of the UK.
Nicola Sturgeon’s proposed timetable – which many have said is unlikely to be fulfilled – would mean holding a new referendum sometime in the next 18 months.
The protocol issue shows just how difficult it will be for the first minister to have all her ducks in a row by then.