Scottish Independence Referendum Act 2013 and those entitled to vote are detailed in the Scottish Independence Referendum (Franchise) Act 2013 - section 2 of which states:
A person is entitled to vote in an independence referendum if, on the date on which the poll at the referendum is held, the person is -
(a) aged 16 or over,
(b) registered in either -
(i) the register of local government electors maintained under section 9(1)(b) of the [Representation of the People Act 1983] for any area in Scotland, or
(ii) the register of young voters maintained under section 4 of this Act for any such area,
(c) not subject to any legal incapacity to vote (age apart), and
(d) a Commonwealth citizen, a citizen of the Republic of Ireland or a relevant citizen of the European Union.
(2) For the purposes of this Act, a person is, on any date, subject to a legal incapacity to vote if the person—
(a) would be legally incapable (whether by virtue of any enactment or any rule of law) of voting at a local government election in Scotland held on that date, or
(b) is legally incapable, by virtue of section 3, of voting in an independence referendum held on that date.
Section 3 of the Franchise Act is headed - Offenders in prison etc. not to be entitled to vote. Section 3(1) is clearly worded:
A convicted person is legally incapable of voting in an independence referendum for the period during which the person is detained in a penal institution in pursuance of the sentence imposed on the person.
Three prisoners - Mr Leslie Moohan and Mr Gary Gibson and Mr Andrew Gillon -petitioned for judicial review of those provisions in the Franchise Act preventing them from voting. Those petitions failed in the Court of Session - Outer House . An appeal by Mr Moohan and Mr Gillon to the Supreme Court of the UK ensued but it was dismissed with written reasons to be handed down at a later date. See UK Supreme Court Summary of the Case and the announcement of the decision.
The question as to who may vote in the referendum has been controversial - as demonstrated by an article dated 27th January 2014 when it was being argued by some that Scottish "expats" ought to be permitted to vote. The Franchise Act goes beyond the usual arrangement by which "expats" are excluded from national elections if they have been out of the country for over 15 years - (Votes for Expat Brits blog 14th March 2014).
What will happen if the vote is YES? In this event, it appears that Scotland will move to an interim constitution - see the discussion on Constitutional Law blog and, in particular, this post of 21st June by Katie Boyle.
Earlier posts on Scottish independence
Earlier posts on Prisoner Voting
Scotland's Future - 26th November 2013