Using Multisig with Peerunity

This is not a guide, just my experience with multisig. Mistakes are likely.

I’ve been trying to figure out how to use multisig now that Peerunity has been released. Multisig allows for greater security as more than one private key is required to spend a transaction.

To create a multisig address, I entered the following command into the Peerunity debug console:

[font=courier]createmultisig 2 ’ [“pubkey1”,“pubkey2”,“pubkey3”] '[/font]

The “2” shows how many of the 3 addresses will be required to consent to make a transaction. You could change this to 1 or 3 if you wanted. Each pubkey should come from different locations or people, but for testing I just used 3 addresses that I owned. Note that the “public key” is different to the Peercoin address. You can find the pubkey of an address by entering:

[font=courier]validateaddress [/font]

After using createmultisig, your new multisig address will be shown, along with its “redeemScript”.

The multisig addresses I have created start with a lower case “p”. Does anyone know if this is what signifies a multisig address in Peercoin? For example, Bitcoin multisig addresses start with a 3 instead of a 1.

I sent 0.1 PPC to the new address. It didn’t show up on bkchain.org for some reason but it was visible on blockr.io.

Spending with the multisig address.

This part seems much more complicated. To spend you seem to need txid, scriptPubKey, and redeemScript.
Then you have to figure out createrawtransaction, signrawtransaction, decoderawtransaction, sendrawtransaction, and probably set a change address. Not very user-friendly…but I think it’s the same for Bitcoin :wink: I will have to spend a bit more time reading about it to make sure I do it correctly.

What I used:

Example from Gavin: https://gist.github.com/gavinandresen/3966071

The video guide below has some python code that does most of it for you, but that is for Bitcoin.

Bitcoin video guide part 1: http://www.youtube.com/watch?v=zIbUSaZBJgU
Bitcoin video guide part 2: http://www.youtube.com/watch?v=OSA1pwlaypc

thanks for this - looking forward to the rest of your investigation - i’d like to know how to do this too…!

[quote=“river333, post:1, topic:2468”]Spending with the multisig address.

This part seems much more complicated. To spend you seem to need txid, scriptPubKey, and redeemScript.
Then you have to figure out createrawtransaction, signrawtransaction, decoderawtransaction, sendrawtransaction, and probably set a change address. Not very user-friendly…but I think it’s the same for Bitcoin :wink: I will have to spend a bit more time reading about it to make sure I do it correctly.[/quote]

The raw transaction RPC functions required to spend coins that were sent to a multisig address (createrawtransaction, signrawtransaction, decoderawtransaction, sendrawtransaction) are not yet in Peerunity.
They will be included in Peerunity 0.2.

In the pull request for raw transaction RPC, I also put two examples showing how to create/send to/spend from 2/2 and 2/3 multisig addresses:

Thanks @glv for clarifying where we are with this, creating a pull request and the examples in your email. However, as a more educated Peercoin wallet user I would struggle with the set of commands required, let alone people who are new.

Isn’t there already some multisig GUI for wallets available in the Bitcoin world? I can’t believe there are many people using this without it. This is not meant to be a critical comment to glv, just trying to identify the next steps required to make this valuable functionality more accessible for average Joe.