so who's idea was it for Scotland to have a referendum?
It was, and always has been, a policy of the SNP. Their efforts when the minority devolved government in Scotland were rejected; when they were the majority after the last elections to Holyrood, they demanded a referendum. The power to call one isn't in the parcel of powers handed back from Westminster, so the Edinburgh Agreement was Westminster permitting them to hold the vote.
The SNP wanted 'Devo Max' (which is the new name for what was once called 'Home Rule') on the ballot. David Cameron flat-out refused, and with only around 30% support for independence at that time it probably looked good to say "all or nothing". In the last weeks, when opinion polls started suggesting they really could lose Scotland, they — with the collusion of the mainstream media — tried to redefine a No vote as Devo Max. That was reneged on in less than 12 hours from the final results being announced.