The battle for control of Scotland's coastline
New legislation which will change the way the foreshore and areas around the coast are managed is expected to be passed by the Scottish Parliament.
The Scottish Crown Estate Bill is being put before MSPs on Wednesday following the devolution of new powers from Westminster.
Under the previous regime decisions on development around the coast were made by the Crown Estate Commission, and any money raised was sent directly to the Treasury.
The new legislation aims to give local communities more control.
Most people in Scotland will have had the pleasure of building a sandcastle at some point in their lives.
The question of who owns the sand and the beach it lies upon is unlikely to cross your mind, but there has been a long history of controversy about who has control over the foreshore and surrounding areas of seabed.
About half of the Scottish foreshore is held as part of the Crown Estate.
The Crown Estate is not straightforward to define. Its property assets are owned by the Monarch in "right of the Crown", but this does not make them the private property of the sovereign, nor do they belong to the government.
There have been many disputes surrounding this unique legal status of the Crown Estate and how the foreshore and coastal areas should be used and for whose benefit.
Legal historian John Macaskill has written a book, Scotland's Foreshore, analysing these controversies.
He argued that historically communities across Scotland, particularly in Gaelic speaking areas, thought these areas were in common ownership or were "free territory".
He said that this could be seen during the disruption of the Church of Scotland in the 1840s.
Dr Macaskill said: "The ministers who left the established church to form the Free Church couldn't get land on which to build their churches so they were reduced to having services in the most odd areas.
"There was the famous floating church in Loch Sunart in Ardnamurchan and there were two or three instances of ministers from the new Free Church holding services on the foreshore because it was believed the landlords writ did not run there."
But during the 19th Century as new money making opportunities began to emerge, notably through kelp harvesting, local landowners and civil servants managing the Crown Estate began to clash over who owned and controlled the foreshore.
Dr Macaskill's research also shows that some aristocratic landowners objected to the mere presence of the lower classes on the foreshore near their stately homes.
Newspaper articles from the time show that their concerns included that "fish curing establishments may be erected under their drawing room windows" while the Earl of Selkirk demanded "the power of excluding trespassers who might make the place intolerable to a family of females and children".
He was particularly concerned about drunken sailors going bathing and upsetting women.
Following a number of court cases between the Crown and private proprietors it was established that the Crown did always have ownership of the foreshore around Scotland, although ownership could be disposed of by an express transfer to a landowner or by the landowner having a history of possession of the area.
But disputes about how the foreshore was managed continued, as responsibility for the Crown estate was passed between various government departments.
By the 1950s these assets were managed by the Crown Estate Commission, an organisation that often faced criticism for focusing too much on raising revenue for the Treasury and not enough on the wider public interest.
These long standing grievances were examined in a report published in 2012 by MPs on Westminster's Scottish Affairs Committee.
They accused the commissioners of damaging local communities by behaving like an "absentee landlord" and "tax collector". MPs backed calls for greater local control and devolution of the Crown Estate to Scotland.
Holyrood gained powers over the Crown Estate in 2017 and now the Crown Estate Bill going through the Scottish Parliament aims to clarify how these historic property assets should be managed.
Stated aims of the Scottish government include promoting social well being and sustainable development while there are also provisions to give councils and community organisations the opportunity to directly manage these assets on a "case by case basis".
Dr MacAskill said he hoped that these "exciting opportunities" for improving the management of the Crown estate in Scotland can be realised.
"The foreshore is hugely important when you live on an island and there has been a long battle between the Crown and private proprietors over ownership and over management and how management should be very much in the public interest," he said
Dr MacAskill added: "However, I fear not enough attention has been paid to history in discussions over the new legislation.
"I rather like a quote from Lord Bingham which paraphrased Walter Scott's Guy Mannering when he said a lawyer without history as well as literature is a mechanic and probably not a very good mechanic at that. A sentiment, which should apply not just to lawyers, but also to legislators."