People in Scotland are being asked for their views on how the nation would be governed in the event of independence.
The Scottish Government has published a draft Scottish Independence Bill and invited feedback through a public consultation over the next four months.
The document sets out ministers' proposals for an interim constitution which they want to be in place on the first day of independence, as well as the process for producing a subsequent permanent written constitution.
Such a constitution would form the "foundations of the state" by setting out, for example, where powers and duties lie in the state, the rights of its citizens, and the underpinning laws.
The Bill also sets out immediate arrangements for independence and would form the interim written constitution.
Among its pages, it proposes an obligation to advance towards nuclear disarmament and the strengthening of human rights protection.
Deputy First Minister Nicola Sturgeon said she wanted the process of creating a constitution to be an "energising" one which ensures the people of Scotland are "centrally involved in designing and determining a written constitution as the blueprint for our country's future".
She told an audience at the University of Edinburgh the "opportunities" provided by having a written constitution are "an important part of the argument for independence".
She said: "We believe that Scotland should have a written constitution, rather than the quilt work of statutes, precedent, practice and tradition that make up the constitution of the UK.
"A written constitution provides certainty and security for the citizens of a state. It defines and constrains the organs of the state. It describes where powers lies and how those who wield it are chosen and scrutinised. As is well known, this is not always clear in the UK.
"It also sets out the aspirations of the people of the country."
The UK is the only country in the European Union which does not have a written constitution or Constitution Act.
The Scottish Government said the fundamental principle underpinning the Bill is that the people are sovereign, rather than parliament.
Ms Sturgeon said a written constitution for an independent Scotland could embody the values of the nation, secure the rights of its citizens, provide a distinction between the state and the Government and "guarantee a relationship of respect and trust between the institutions of the nation and its people".
She said the Bill, which ministers hope will become an Act of the Scottish Parliament, provides for Scotland to become an independent state, and provides for an interim constitution from the first day of independence.
Referring specifically to its section on nuclear disarmament, she said: "This provision would place a binding duty on the Scottish Government to negotiate towards the safe, speedy removal of Trident from our shores.
"The provision also provides a platform for Scotland to sign up to the Non-Proliferation of Nuclear Weapons Treaty, and to do our bit to advance nuclear disarmament in our world."
The Bill also sets out the way forward for establishing a Constitutional Convention to develop Scotland's permanent written constitution post-independence.
Proposals the Scottish Government would make to that Convention for inclusion in the blueprint include equality of opportunity; entitlement to education, a home and public services; protection of the environment and the sustainable use of natural resources; a ban on nuclear weapons being based in Scotland; controls on the use of military force and children's rights.
Ms Sturgeon said: "A written constitution can be the foundation on which we can build that better Scotland.
"A written constitution is an important part of a nation's identity - it defines who we are and sets out the values that we hold dear. It would be our 'Scottish Declaration of Independence', founded on the principle that in Scotland, the people are sovereign, not the government or the parliament."
She added: "This is a very exciting time and I would encourage everyone to have their say on the Bill."
The consultation closes on October 20.
Scottish Green Party co-convener Patrick Harvie MSP said: "I welcome this very clear statement of intent - that Scotland aspires to be a modern, compassionate democracy where power is held to account."
But Scottish Labour MSP Jackie Baillie said people wanted to hear about other issues from the Deputy First Minister.
She said: "Nicola Sturgeon has recycled the same speech several times now. The people of Scotland would be more interested if the nationalists had set out what the start-up costs of independence would be, what would replace the pound, how our pensions would be paid or what would happen to the money available for our schools and hospitals if we leave the UK.
"Keeping these details from Scots simply isn't credible."
Scottish Conservative chief whip John Lamont said: "The Scottish Government appears to be confusing a country's constitution with an SNP wishlist.
"Many of the lines included do not reflect public opinion, such as the SNP dislike of Trident.
"Instead of plotting fantasy constitutions, the Scottish Government would be better working out some hard and fast costings of separation, which astonishingly has not been done yet."