Image caption The North Sea oil and gas industry continues to bring in billions in revenue to the UK economy

The rallying cry "It's Scotland's Oil" helped the Scottish National Party to record its best-ever result in a Westminster General Election, in 1974.

Almost 40 years later the party is closer than ever to achieving its dream of independence.

The issue of who owns the oil and gas in the waters off Scotland's coast will be one which is sure to play a big role during the campaign ahead on the referendum in autumn 2014.

Question time Professor Alex Kemp took part in a BBC webchat on Scotland's oil industry in the context of the Scottish independence referendum debate. Watch the half-hour interview.

The first North Sea oil came ashore in June 1975 and is thought to have peaked in 1999, with more than 40 billion barrels extracted so far.

There are arguments about how much oil is left but historically high prices have made it more economical to drill for the harder-to-get reserves and new technologies are also being developed to help with that process.

Although the oil and gas is tougher to extract, the reserves are substantial - between 15 billion and 24 billion barrels of oil equivalent - meaning possibly another 30 to 40 years of production. And there could be new discoveries such as the fields west of Shetland.

Last month (11 March) the Scottish government released analysis which predicted a "renewed oil boom".

Its first Oil and Gas Analytical Bulletin predicts that production in Scottish waters could generate as much as £57bn in tax revenue by 2018.

It also says more than half the value of total reserves in the UK Continental Shelf are still to be extracted.

The figures are higher than those projected by the UK's Office for Budget Responsibility (OBR).

The OBR predicts oil tax revenue will drop from £6.7bn this year to £4.1bn by 2017-18.

One thing that is clear is that there is still lots of oil in the North Sea and the demand for it does not look like subsiding very soon.

Looking back over the past 40 years it is estimated the UK Treasury has benefited from offshore oil and gas production taxes to the tune of about £300bn (adjusted for inflation). Not all of that would have been from Scottish waters, but it is thought about 90% of it would.

So is it Scotland's oil?

This is, of course, a key question in the debate and one which would have to be negotiated by governments as part of any agreement on independence.

Image caption The shaded blue area is the part of the UK continental shelf which the Scottish government believes it should control

Under the present arrangement the oil tax revenues are assigned to an economic region set up by the UK government, which is called the UK Continental Shelf (UKCS).

This means that oil resources are not officially assigned to Scotland but instead to a region distinct from the British mainland.

But if Scotland were to become independent, and a sovereign state, it would expect the UKCS to be divided up on a "geographical" basis.

Prof Alex Kemp, from the University of Aberdeen, is the leading expert on Scotland's oil industry.

He says if Scotland were to become independent the "median line" principle would be the "obvious one" to use.

This means drawing a dividing line on which all points are the same distance from the Scottish and rest of the UK (RUK) coastline.

Prof Kemp says this is the method which was used when the North Sea was originally divided up between the UK and other countries in the 1960s.

The most important treaty was signed between the UK and Norway in 1965 using the median line, although later, when the oil began to flow in the Norwegian sector, there were many who said the UK had been far too lenient.

The median line approach was also used to determine the boundary between Scotland and the rest of the UK for fisheries after devolution in 1999.

I don't think London should be under the assumption they automatically have the median line they should not even have to negotiate it Professor David Scheffer, US international lawyer

On this occasion, the line was effectively imposed on Scotland by Westminster and there were opponents who said that it took away a large amount of Scottish territory.

The median line produces an oddly curved line which because of the peculiarities of the coastline heads steeply north and at some points is level with Dundee, about 100 miles from the border at Berwick.

It is the same principle as the United Nations Convention on the Law of the Sea (UNCLOS).

But American international lawyer Professor David Scheffer says: "I don't think anyone should say that the law of the sea is static on this issue of where do you draw the line in the North Sea that would determine who has jurisdiction over which part of the reserves.

"There is a popular presumption that the median line should be drawn and that would be favourable to London. There is a popular notion in academic thinking that automatically it is the median line. However, international law has always invited negotiation on how to draw that line."

Prof Scheffer, who is Director of the Centre for International Human Rights at Northwest University in the US, says the boundary line could be a good bargaining tool for the Scottish government.

He says: "I don't think London should be under the assumption they automatically have the median line they should not even have to negotiate it. I think that would be a serious mistake because Scotland could ultimately bring this to the international court of justice and perhaps prevail there with a different line."

Oil figures 40 billion barrels of oil have been extracted from the North Sea so far

Up to 24 billion barrels of oil could be left

Between 30 to 40 years of production left

New fields possibly west of Shetland

The Scottish government predicts oil production in Scottish waters could generate £57bn in tax revenue by 2018

The UK's Office for Budget Responsibility (OBR) predicts oil revenue will drop from £6.7bn this year to £4.1bn by 2017-18

Prof Kemp says there have been departures from the median line principle in various settlements around the world, including judgements made by the International Court.

He adds: "To complicate the matter slightly, in 1968, there was another line drawn from the border straight across the North Sea and that was for civil and criminal court problems. North of that line Scottish law prevailed and south of it English law prevailed.

"You might say we should use that line. The interesting thing is, from the economic point of view, it does not make much difference because there are just a handful of fields, and not very important ones now, between the median line and the line north of Berwick.

"Although lawyers could have a long debate about it, in terms of economics, it does not make all that much difference."

If Scotland were to get a "geographical share" based on the median line it would mean about 90% of the UK's oil resources would be under Scottish jurisdiction.

According to research by Prof Kemp, in 2010 the Scottish share of total oil production in the UKCS was more than 95% while for gas it was 58%. The Scottish share of total hydrocarbon production (including NGLs) was 80%. The Scottish tax share exceeded 90%. This reflects the much higher value of oil compared to gas.

No discussion has yet taken place between the UK and Scottish governments on the detail of what would happen to oil revenues.

Image caption The oil and gas debate has become an important one in the Scottish independence referendum

The Scotland Office said: "The UK government are not making contingency plans for losing the independence referendum. That includes how UK oil revenues might be divided afterwards."

The revenue from oil and gas is vitally important to the debate on how Scotland will function after independence.

The latest figures from GERS (Government Expenditure and Revenue Scotland) for 2011-12 show that £11.25bn was paid into the UK exchequer from North Sea revenues, historically high oil prices and a raised supplementary tax rate made it one of the largest figures ever.

There are just a handful of fields, and not very important ones now, between the median line and the line north of Berwick Prof Alex Kemp, University of Aberdeen

The same Scottish government report seeks to outline what difference this would make to Scotland's financial position if it were to get a "geographical share" of the revenues instead of a "per capita" slice.

In 2011-12 it would have meant an extra £10.57bn being paid to Scotland, the report claims - which is important to keep down the scale of Scotland's deficits - with 94% of the revenues being generated in Scottish waters.

In other years it could be much more than this and in some significantly less due to the complicated tax and allowances structure.

In a submission to Westminster last year Prof Kemp said he would "guesstimate" that over the next decade the annual values could be in the £5bn to £10bn range. But the professor, like all other experts, warned of the "volatility" of the oil revenues from year to year.

Economic future

Of course, these figures are only indicative of the oil revenue Scotland would receive and do not account for all the other changes which would take place to income and taxation if Scotland were to be independent.

International credit rating agency Fitch recently put out a note which said: "A geographical division of oil is an extreme outcome, as is a per capita division that would leave the residual UK with 92% of reserves. A compromise would probably be reached."

The Yes Scotland campaign says: "International law makes clear that fields generating around 90% of the revenues will be in Scottish waters.

"This figure is based on comprehensive analysis undertaken at Aberdeen University. The companies that currently hold the licences for the various oil fields will continue to operate as now, but the taxes they pay will come to the Scottish Exchequer rather than go to the chancellor in London."

The Better Together campaign's Alistair Darling said: "Oil is great for Scotland. Nobody would suggest otherwise. However, betting a country's economic future on such a volatile and declining resource just isn't credible. It is time that the nationalists were straight on this."