Multi-signature transactions
Cryptonite has full native support for multi-signature addresses and transactions, which require multiple parties to sign a transaction before it is considered valid. Multi-sig transactions are useful in many real world situations, especially for consumer protection and escrow schemes. Unfortunately there isn't yet a user friendly GUI for creating multi-sig addresses and using them, but it will get easier.
Here's how to try it on the testnet (remove -testnet flags to do it for real):
./cryptonited -testnet createmultisig 2 [\"cBCYJhy9Mxg85ujVpLsrvUiXQs9xh2aRmP\", \"cKyUeZowQg8jPBJg1oEcVnMkcqNxK6GWw9\",\"c6JjVRGAtLkheEHSr5ddx2Ev81cLL2h4CK\"]
Where the 2 is how many signatures are required to spend from the address. Can be any number > 0. Then there is an array of addresses corresponding to "authorized" senders. This command produces a mult-sig address as shown below. Anybody can send to this immediately.
{ "address" : "c555wVcgpmQ6f5BGJfzBspFJgXuXSnMKAm" }
Spending the multisig is more difficult. First you must create a raw unsigned transaction where the input is the the multisig address. Outputs can go anywhere, different multisig addresses, whatever.
./cryptonited -testnet createrawtransaction "{ \"c555wVcgpmQ6f5BGJfzBspFJgXuXSnMKAm\": \"25.0010000000ep\" }", "{ \"cLTTCchBofchto7mSCcpMnyW18v59LgVwH\":\"10.0000000000ep\" , \"cQcTLJyTKQ7wJJHVNyZNJCtPdzF1VscvDg\":\"15.0000000000ep\" }"
This returns a really nice hex string of the transaction. Like:
01000000012835a1a195f6c84a38f69d0df18568c5fe8ba948a07f049500000000000200ca 9a3b00000000d0fa6ab67c8da4b8c33c3d7ae6756bef02ea304a002f685900000000fe8ec63dc8f6 08f5f23ce88de8616cddca19ae7000e42b000000000000
Then to prepare the transaction for signing you would run:
./cryptonited -testnet setuprawtransaction "01000000012835a1a195f6c84a38f69 d0df18568c5fe8ba948a07f049500000000000200ca9a3b00000000d0fa6ab67c8da4b8c33c3d7ae 6756bef02ea304a002f685900000000fe8ec63dc8f608f5f23ce88de8616cddca19ae7000e42b000 000000000" "{\"0\":[2,[\"cBCYJhy9Mxg85ujVpLsrvUiXQs9xh2aRmP\", \"cKyUeZowQg8jPBJg1oEcVnMkcqNxK6GWw9\",\"c6JjVRGAtLkheEHSr5ddx2Ev81cLL2h4CK\"]]}"
This command also requires a description of the multisig address. All authorized addresses and the number 2 again signifies the number required to send. Then it will generate:
01000000012835a1a195f6c84a38f69d0df18568c5fe8ba948a07f0495000000003d0035c 2829b1b64802610277894a22830b4d9abfd476b6f4e8bb50c6c12ff0b28f97a7dde4960143058cb affa68c577a5c5e098e3f247e8c9d423c304860200ca9a3b00000000d0fa6ab67c8da4b8c33c3d7 ae6756bef02ea304a002f685900000000fe8ec63dc8f608f5f23ce88de8616cddca19ae7000e42b 000000000000
Life is easier from now on. Signers don't need to know the multisig construction anymore because it has been encoded in the transaction. So you pass the hex around to people with the keys to actually sign the thing by running:
./cryptonited -testnet signrawtransaction 01000000012835a1a195f6c84a38f69d0d f18568c5fe8ba948a07f0495000000003d0035c2829b1b64802610277894a22830b4d9abfd476b6f4 e8bb50c6c12ff0b28f97a7dde4960143058cbaffa68c577a5c5e098e3f247e8c9d423c304860200ca 9a3b00000000d0fa6ab67c8da4b8c33c3d7ae6756bef02ea304a002f685900000000fe8ec63dc8f60 8f5f23ce88de8616cddca19ae7000e42b000000000000 "{\"0\":\"2\"}"
Here the last JSON object simply describes that the first input of the transaction is a 2 required multisig. It will then spit out something like:
{ "hex" : "01000000012835a1a195f6c84a38f69d0df18568c5fe8ba948a07f0495000000009 70204b57ae0c446cca8e16b52251dbe87ff18c6755b21c4b99cdbb7f7aa7641e00aa58751e30f576 2d10598c99fe0054a73627a36948e8ce578bd9ac0bde79a3c1d35045b2ec50645b5d1c0de41b77e7 001562bd234c98d168f22cabe8f65ebf25c21cc529b060a920100bde39322614d5056689e6daba4d b65d0fa2827e74628c9e95acbaffa68c577a5c5e098e3f247e8c9d423c304860200ca9a3b0000000 0d0fa6ab67c8da4b8c33c3d7ae6756bef02ea304a002f685900000000fe8ec63dc8f608f5f23ce88 de8616cddca19ae7000e42b000000000000", "complete" : true }
If complete is false, this hex must be given to the next user for further signing. If complete is true, then the multisig transactions have been sufficiently signed for submission and your ready to send it out to the network as follows:
./cryptonited -testnet sendrawtransaction 01000000012835a1a195f6c84a38f69d0d f18568c5fe8ba948a07f049500000000970204b57ae0c446cca8e16b52251dbe87ff18c6755b21c4b 99cdbb7f7aa7641e00aa58751e30f5762d10598c99fe0054a73627a36948e8ce578bd9ac0bde79a3c 1d35045b2ec50645b5d1c0de41b77e7001562bd234c98d168f22cabe8f65ebf25c21cc529b060a920 100bde39322614d5056689e6daba4db65d0fa2827e74628c9e95acbaffa68c577a5c5e098e3f247e8 c9d423c304860200ca9a3b00000000d0fa6ab67c8da4b8c33c3d7ae6756bef02ea304a002f6859000 00000fe8ec63dc8f608f5f23ce88de8616cddca19ae7000e42b000000000000
And it will spit out a txid like this if successful:
8ca0108bf935f2705976f56d7fa52fc32f68fab5f20e9f7400e3ccc55b27cd81