Judges have begun hearing an appeal against a court ruling which granted £2,400 to a convicted robber because he was forced to slop out.
A prisoner was awarded £2,400 in compensation
Robert Napier argued his human rights were infringed while sharing a cell at Barlinnie Prison in Glasgow.
An estimated 700 prisoners are awaiting the outcome of the case, which could cost the Scottish Prison Service (SPS) millions of pounds if the appeal fails.
The case is being heard by three judges at the Court of Session in Edinburgh.
Scotland's senior judge, Lord Cullen, sitting with Lord Osborne and Lord Hamilton, are expected to give a decision at a later date.
Napier's solicitor Tony Kelly said at least 700 other prisoners had lodged similar claims which would have to be met if the appeal failed.
The SPS accounts recently revealed a contingency of £26m had been made in the light of the Napier case.
Napier made his claim after being held in the Glasgow jail in 2001. Slopping out at Barlinnie ended five months ago.
Neil Brailsford QC, appearing for Scottish ministers, said findings that there had been a violation of a prisoner's human rights and ministers had acted outside their powers, were "matters of the greatest seriousness".
Scottish ministers claim that the appropriate standard of proof in deciding whether or not there had been a breach of the European Convention on Human Rights was proof beyond reasonable doubt - which is normally applied in criminal cases.
Mr Brailsford said it had been recognised that the general standard in civil litigation was on a balance of probabilities, but that there were exceptions.
Meanwhile, the Princess Royal visited Barlinnie Prison on Tuesday, in her capacity as patron of The Butler Trust.
Butler Trust Awards are made annually to people working in the prison services in the United Kingdom.
The aim of the awards is to highlight and reward outstanding personal contributions.