Bitcoin Forum
December 13, 2024, 09:29:23 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Multisignature  (Read 606 times)
Blackwave (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
January 22, 2014, 12:24:44 PM
 #1

Hi guys .
I'm trying to integrate multisignature on my site , but I encountered a problem.

What am I doing ?

I create multisig address:
Code:
bitcoind createmultisig 2 '["pubkey1", "pubkey2", "pubkey3"]'

Then I transfer funds generated address. It begins with the number 3

Next, I create a raw transaction:
Code:
bitcoind createrawtransaction '[{"txid": " transfer transaction id here ", "vout": 0} ]' ' { ' address for withdrawal " : 0.1 } '

Then I try to sign the transaction :
Code:
bitcoind signrawtransaction <createrawtranscation result> '[{"txid": " transfer transaction id here ", "vout": 0 , "scriptPubKey": " I ​​took out decoderawtransaction"}]' '["privkey1", "privkey2"]'
But the answer comes - complete: False

What should I do ?

In this case, a bunch of keys (private / public ) is taken from one wallet.


And one more question . If I use the public keys of different wallets, may I sign a transaction private keys on a wallet? I need to import private keys ? But where?

Sorry for my bad English.
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 287


View Profile
January 22, 2014, 02:13:31 PM
 #2

You need to run 'addmultisigaddress' to add the address to the wallet. That way it has knowledge of the public keys, and can construct the redeemScript later on. Also, you should also be supplying the redeemScript in the input in signrawtransaction.

Is this PHP? I have an implementation up that works with bitcoind/bitcoinqt. http://multisig.thomaskerin.tk

I can send you the code if you wish.

Bitwasp Developer.
Blackwave (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
January 22, 2014, 02:52:46 PM
 #3

Yes, this is php. CI with jsonrpcclient as ci library.
Thx Smiley
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 287


View Profile
January 22, 2014, 03:06:52 PM
Last edit: January 22, 2014, 03:18:41 PM by fbueller
 #4

Then boy it's your lucky day! I'm using codeigniter as well. I'll upload the project as it is, you just need to configure application/config/bitcoin.php.  I'll post in a sec with a github link just uploading now, try it here: http://multisig.thomaskerin.tk

Source code is here: https://github.com/Bit-Wasp/multisig

You should probably have a separate client to use to have the other keys. The server generates a key and imports it immediately. Users are asked to supply the required amount of keys, send money, paste the txid, and enter an address to send the money back to. Then they need to sign the transaction - the software will automatically sign the transaction it generates, but you could leave this out if people wanted to actually do escrow with it.

It only works with bitcoind/qt. If you get multisig transactions to sign in any other client that only has 1 of n keys please let me know!

Bitwasp Developer.
Blackwave (OP)
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
January 22, 2014, 03:13:07 PM
 #5

Then boy it's your lucky day! I'm using codeigniter as well. I'll upload the project as it is, you just need to configure application/config/bitcoin.php.  I'll post in a sec with a github link just uploading now

You should probably have a separate client to use to have the other keys. The server generates a key and imports it immediately. Users are asked to supply the required amount of keys, send money, paste the txid, and enter an address to send the money back to. Then they need to sign the transaction - the software will automatically sign the transaction it generates, but you could leave this out if people wanted to actually do escrow with it.

It only works with bitcoind/qt. If you get multisig transactions to sign in any other client that only has 1 of n keys please let me know!
Thx. I have a standalone server with a wallet. Users (buyer, seller) sended public keys and standalone server create multisig address. Next (I hope) they will be able to enter the private keys that I can import it into my server to sign the transaction.
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 287


View Profile
January 22, 2014, 03:20:34 PM
 #6

Then boy it's your lucky day! I'm using codeigniter as well. I'll upload the project as it is, you just need to configure application/config/bitcoin.php.  I'll post in a sec with a github link just uploading now

You should probably have a separate client to use to have the other keys. The server generates a key and imports it immediately. Users are asked to supply the required amount of keys, send money, paste the txid, and enter an address to send the money back to. Then they need to sign the transaction - the software will automatically sign the transaction it generates, but you could leave this out if people wanted to actually do escrow with it.

It only works with bitcoind/qt. If you get multisig transactions to sign in any other client that only has 1 of n keys please let me know!
Thx. I have a standalone server with a wallet. Users (buyer, seller) sended public keys and standalone server create multisig address. Next (I hope) they will be able to enter the private keys that I can import it into my server to sign the transaction.

Problem. Your server could be hacked and used to sign transactions that are sent to wherever an attacker wants. Most users will give you keys from their wallet.. Imagine taking the private key from a users android app, and you get hacked. All their phones coins will get spent, just because you wanted to sign the transaction for them. You should not have that ability if you're trying to implement multisig - the user needs to sign for themselves.

Bitwasp Developer.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!