THE UK Supreme Court is not Nicola Sturgeon's Plan A.

For years she resisted the idea of asking for a definitive ruling on whether Holyrood could hold a legally watertight independence referendum without Westminster consent.

It was a "Unionist trap" that could set back the cause by closing down a useful ambiguity and neuter threats of Holyrood holding its own vote if Westminster refused to cooperate on Indyref2.

But with the UK Government refusing to lend Holyrood extra powers for a referendum, as happened in 2014, and pressure from her own party for tangible progress, she had few options.

The Scottish Government's most senior law officer, the Lord Advocate Dorothy Bain KC, had also refused to sign off a draft Referendum Bill in case it exceeded Holyrood's powers.

Stymied, the First Minister asked Ms Bain if she would refer the question to the Court under a never-used power given to the Lord Advocate by the 1998 Scotland Act.

Mr Bain agreed, the application was made in June, and the two-day hearing this week is the result.

If it goes Ms Sturgeon's way, she has said Indyref2 will be held on October 19 2023.

If not, she has said she will fight the next general election as a de facto referendum.

The first day's arguments were highly technical in parts, but in essence Ms Bain asked the Court to rule on whether

Holyrood can use its existing powers to legislate for a referendum asking people, 'Should Scotland be an independent country?'

It is agreed by the Scottish and UK Governments that if a Bill "relates to" the reserved, Westminster-only areas of the Union and the UK Parliament it is null and void, or "not law".

There was therefore a lot of debate about whether the draft Bill really does "relate to" these areas, or has only a "loose or consequential" connection.

At first glance, it might seem obvious that the subject of the Bill means it relates to those areas very directly.

But Ms Bain argued yesterday - as the SNP have in a written submission - that the Bill does not relate to the Union, as its sole legal purpose would be to ascertain people's views on independence, not automatically secure it.

It would be purely advisory, the result would not change other laws directly, and so its legal effect would be "nil".

Whatever the motives of Scottish ministers in holding Indyref2 might be, the Court should restrict its consideration to the letter of the law, not speculate about the political aftermath, Ms Bain said.

The UK Government's reply is basically "Come off it" . It will today argue the Court must take into account the wider context, including the SNP saying a Yes vote to Indyref2 means independence.

As the intent of such a referendum would clearly be to bring about the end of the UK, a Holyrood Bill for Indyref2 would clearly "relate to" the Union, and so be ultra vires.