Title: How to do multisig transaction 2 of 3 via testnet Post by: btchelpmeplz on May 28, 2020, 06:56:27 PM I'm looking for a simple guide on how to do multisig transaction using the testnet network.
I'm looking to create a payment solution with escrow capabilities. (buyer, vendor, marketplace). However, when I create a funding address and send the funds and go to create a raw transaction it's already signed and I'm unable to do anything with it? I'm willing to also maybe reward the user that can help, and there could be a very high reward depending the help. # Market: tpubD6NzVbkrYhZ4XoHF1Ww7V5Q4PTdTR6KWac6mjMCHfEsTKyc8eLSS5ts9DytQjssgeXqSYKzP5UM iC2Ecnhu9LUfAT3knc7oScpRBfLK3N7Y 02059948c2ee7136f5e986471f7be70858f94007cadaf2690ed4126ed24eeca284 # Vendor: tpubD6NzVbkrYhZ4XuM7tF5GQteD3uPo982nPsnCprvRsWfMfPDJ5Zx5cY4fVHNCgNAAjKEumyXjBbA AVMUV1K4vkbPb4RzthzyviEn7DJqn5xT 0269329aabf3e782438040b719169cd186c81c4ee841712159ca2c0decc695d7a4 #Buyer tpubD6NzVbkrYhZ4YanxUmHzabCCsTBNUVWcZnKbDgR54shAUKNQBh7TY9UUFUFhPN1r3KY4MkAzjqB e3yju5vDTALxSq3YMdW49vn59xaXZkYp 033f94135ea1ee3ca6467bc5ebb3357284bf038223bb5651fece1ee6207b2479c8 bitcoin-cli --testnet createmultisig 2 '["033f94135ea1ee3ca6467bc5ebb3357284bf038223bb5651fece1ee6207b2479c8","0269329aabf3e782438040b719169cd186c81c4ee841712159ca2c0decc695d7a4","0269329aabf3e782438040b719169cd186c81c4ee841712159ca2c0decc695d7a4"]' Code: { #TX ID: fad9591024f7c8d182295d516c913c1171eb4c6ddd38578d18fe32735f8a368f Code: bitcoin-cli getrawtransaction fad9591024f7c8d182295d516c913c1171eb4c6ddd38578d18fe32735f8a368f 1 # Code: bitcoin-cli --testnet createrawtransaction '[{"txid" : "d36a8e3333bec23a26cbb374c9f9d9d43ac19110e92378a847fc1408485e39c6","vout":0}]' '{"n3QXqyFHcBuWoe5TmCvp4k38sc6APpMUmn":0.00090000}' [bitcoind@centos dev]$ bitcoin-cli --testnet createrawtransaction '[{"txid" : "fad9591024f7c8d182295d516c913c1171eb4c6ddd38578d18fe32735f8a368f","vout":0}]' '{"n3QXqyFHcBuWoe5TmCvp4k38sc6APpMUmn":0.00090000}' 02000000018f368a5f7332fe188d5738dd6d4ceb71113c916c515d2982d1c8f7241059d9fa00000 00000ffffffff01905f0100000000001976a914f01bdca4126338417da56340825fb458007bd17b 88ac00000000 Output: https://prnt.sc/spmeyo Title: Re: How to do multisig transaction 2 of 3 via testnet Post by: BitMaxz on May 28, 2020, 10:25:37 PM If it is related to payment processor why not start on using with BTCpayserver (https://btcpayserver.org/) it is a self-hosted payment processor and you can use multisig wallet.
Anyway, what wallet you currently using when testing? Do you want to make an unsigned transaction? I don't know exactly what wallet you currently using but on using the Electrum wallet you can use the preview when creating a transaction where you can sign the transaction or not. What exactly do you want to achieve? Are you going to make a website with a payment processor? Title: Re: How to do multisig transaction 2 of 3 via testnet Post by: nc50lc on May 29, 2020, 03:29:21 AM However, when I create a funding address and send the funds and go to create a raw transaction it's already signed and I'm unable to do anything with it? (Image re-hosted to be displayed)-snip- Output: https://prnt.sc/spmeyo https://i.imgur.com/9r4sevB.png (https://prnt.sc/spmeyo) Are you trying to use Electrum to co-sign the RAW transaction? If yes, you won't be able to do it for two reasons: 1. Electrum seems to have an issue with imported transactions created from other wallets due to incompatibility. I have experienced that "can't sign - broadcast already available" bug when I tried to load a raw transaction that I created using coinb.in. 2. Electrum 3.3.8 as of now doesn't support importing individual multisig addresses through private keys/public keys/redeem script, if you import the address itself, and try to sign it in the console, you still wont be able to because you can't input the redeem script. Notice that it says "Transaction unrelated to your wallet", and I presume you have imported one of the private key. I haven't used Bitcoin core to do Multisig but I think these commands are the ones you need: Co-sign the transaction using signrawtransactionwithkey (https://bitcoincore.org/en/doc/0.19.0/rpc/rawtransactions/signrawtransactionwithkey/) and provide one or two of the keys. Or use: signrawtransactionwithwallet (https://bitcoincore.org/en/doc/0.19.0/rpc/wallet/signrawtransactionwithwallet/) given that the client have one of the private keys. Title: Re: How to do multisig transaction 2 of 3 via testnet Post by: pooya87 on May 29, 2020, 03:55:06 AM 02000000018f368a5f7332fe188d5738dd6d4ceb71113c916c515d2982d1c8f7241059d9fa00000 00000ffffffff01905f0100000000001976a914f01bdca4126338417da56340825fb458007bd17b 88ac00000000 this transaction is NOT signed. what you see in your preview window of Electrum is a couple of bugs where it greys out the "sign" button since it can't sign it but doesn't do the same with broadcast, and also is showing it as "signed" on top of the window! however, if you click it you can see how you'll get an error telling you your transaction is not valid. there could be a couple of reasons why Electrum doesn't recognize your tx/address here. for starters importing the same extended pubkeys doesn't result in the same address which is probably due to wrong derivation paths. so you should first figure out what derivation path you used to get the 3 public keys used in creation of 2N4DqqGFJn7bBNmE3yjBssUpCZEVxrTcJan. the first address i get is 2NBsiKyRMkSUy2mYAphMpXz6BWS4dzv4ANS and your address does not exist among any addresses at all. (keep in mind that Electrum "sorts" public keys lexicographically that can result in an entirely different address, checking the individual pubkeys of my first address shows different individual pubkeys also) second it could be because Electrum expects a certain set of "commands" in signature of the unsigned transaction to tell it what to do. although i haven't tested this particular issue but empty script has been a reason for Electrum not knowing what to do and how to sign the transaction. Title: Re: How to do multisig transaction 2 of 3 via testnet Post by: btchelpmeplz on May 29, 2020, 08:38:07 AM I've moved away from Electrum for evening attempting to sign the signature its fucking useless.
I've moved to coinb.in had this working fine, now looking to create a raw transaction via bitcoin-cli, however, when, I create a raw transaction I get input errors, but when I create a raw transaction via Coinb.in, I don't? Is there an updated method for creating a raw transaction using multisig to payout to multiple addresses using client based commands Title: Re: How to do multisig transaction 2 of 3 via testnet Post by: nc50lc on May 30, 2020, 03:40:40 AM I used Regtest for this test and it was successful.
Here are the commands that I've used (skipping createmultisig); 2-2 Multisig address info: "address": "2N9dcyDUNXxAGbBhmeSnwLQsYdEXk7jkewp", Funding transaction (TXID): 60aebde463de893dce4b72003d57c2f4ef63f88b4c0818fdaba3c9fef0a59efe Create a new transaction, send to two outputs: Code: createrawtransaction "[{\"txid\":\"60aebde463de893dce4b72003d57c2f4ef63f88b4c0818fdaba3c9fef0a59efe\",\"vout\":1}]" "[{\"2N1S5utkMt53XrXuy18wURf9qqZfb7i29DB\":1.795},{\"2N4LrRMimkACSMn2LnfKrGFi4Hic6UdhxNq\":8.2}]" Code: 0200000001fe9ea5f0fec9a3abfd18084c8bf863eff4c2573d00724bce3d89de63e4bdae600100000000ffffffff02e0f3b20a0000000017a91459ced730eb49677bbf4d9d977fd66f3562c2e40a870035e0300000000017a91479b9e026e043718332aeffc5d9f15aec3d2c8b658700000000 Sign the transaction using the first key: Code: signrawtransactionwithkey "0200000001fe9ea5f0fec9a3abfd18084c8bf863eff4c2573d00724bce3d89de63e4bdae600100000000ffffffff02e0f3b20a0000000017a91459ced730eb49677bbf4d9d977fd66f3562c2e40a870035e0300000000017a91479b9e026e043718332aeffc5d9f15aec3d2c8b658700000000" "[\"cRBmMvn2riZHyTw13Dr9y23ynfADUiwH1YvvAg6Pp92n8TT93k8t\"]" "[{\"txid\":\"60aebde463de893dce4b72003d57c2f4ef63f88b4c0818fdaba3c9fef0a59efe\",\"vout\":0,\"scriptPubKey\":\"a914b3be5906d3390d5a9f9e28343a49b8467a822c5187\",\"redeemScript\":\"5221024e25a55cf263164b718f2df8e246b3772f995dd783b40e6f4e5de62c93ec49232103cb1b255f0ea86b612eedb9c8e6446a9261d666359b5273301a45d6e3d2a3abe152ae\"}]" Code: 0200000001fe9ea5f0fec9a3abfd18084c8bf863eff4c2573d00724bce3d89de63e4bdae6001000000920047304402204f64de0fe2d433f4e0f98326cc3314183198dbf0e3c47f5de4a90a578a8b972a02201bc31ea3112edbc526b9aa8396de6d0ce664b770d9334d9963a83c3b4bd66efc0100475221024e25a55cf263164b718f2df8e246b3772f995dd783b40e6f4e5de62c93ec49232103cb1b255f0ea86b612eedb9c8e6446a9261d666359b5273301a45d6e3d2a3abe152aeffffffff02e0f3b20a0000000017a91459ced730eb49677bbf4d9d977fd66f3562c2e40a870035e0300000000017a91479b9e026e043718332aeffc5d9f15aec3d2c8b658700000000 Sign the partially signed transaction using the second key: Code: signrawtransactionwithkey "0200000001fe9ea5f0fec9a3abfd18084c8bf863eff4c2573d00724bce3d89de63e4bdae6001000000920047304402204f64de0fe2d433f4e0f98326cc3314183198dbf0e3c47f5de4a90a578a8b972a02201bc31ea3112edbc526b9aa8396de6d0ce664b770d9334d9963a83c3b4bd66efc0100475221024e25a55cf263164b718f2df8e246b3772f995dd783b40e6f4e5de62c93ec49232103cb1b255f0ea86b612eedb9c8e6446a9261d666359b5273301a45d6e3d2a3abe152aeffffffff02e0f3b20a0000000017a91459ced730eb49677bbf4d9d977fd66f3562c2e40a870035e0300000000017a91479b9e026e043718332aeffc5d9f15aec3d2c8b658700000000" "[\"cPNZRp3FYP9JZfYRStpZhSCmQZAfWKnB4hgGffBvpcMMekKFZ5pZ\"]" "[{\"txid\":\"60aebde463de893dce4b72003d57c2f4ef63f88b4c0818fdaba3c9fef0a59efe\",\"vout\":0,\"scriptPubKey\":\"a914b3be5906d3390d5a9f9e28343a49b8467a822c5187\",\"redeemScript\":\"5221024e25a55cf263164b718f2df8e246b3772f995dd783b40e6f4e5de62c93ec49232103cb1b255f0ea86b612eedb9c8e6446a9261d666359b5273301a45d6e3d2a3abe152ae\"}]" Code: 0200000001fe9ea5f0fec9a3abfd18084c8bf863eff4c2573d00724bce3d89de63e4bdae6001000000d90047304402204f64de0fe2d433f4e0f98326cc3314183198dbf0e3c47f5de4a90a578a8b972a02201bc31ea3112edbc526b9aa8396de6d0ce664b770d9334d9963a83c3b4bd66efc0147304402204ac450beea00c89cbc51ce58845de2cf3ddba07df6676532e5c092e661a32117022071be0746ad33b5dc20830782334bc15f50b264fefd9f8f6867d005bba925e86301475221024e25a55cf263164b718f2df8e246b3772f995dd783b40e6f4e5de62c93ec49232103cb1b255f0ea86b612eedb9c8e6446a9261d666359b5273301a45d6e3d2a3abe152aeffffffff02e0f3b20a0000000017a91459ced730eb49677bbf4d9d977fd66f3562c2e40a870035e0300000000017a91479b9e026e043718332aeffc5d9f15aec3d2c8b658700000000 If you still received "missing inputs" error, check the funding transaction's "vout" (output index) if it's the same as you indicated in createrawtransaction. |