SIGAHASH SINGLE ANYONE CANPAY

6 replies 340 views
bear365Full Member
Posts: 65 · Reputation: 498
#1Sep 19, 2019, 10:21 PM
Hey folks. In Sparrow, I can make a raw transaction by choosing the inputs and outputs myself. But here’s the thing: if the other signer wants to add their own inputs and outputs, should I create an unsigned transaction or a signed one? After that, do they just import my transaction into their wallet to throw in their own transaction? How exactly does adding the second transaction work? I’d love a breakdown of the steps on how the other signer can add it.
3 Reply Quote Share
LuckyCoinLegendary
Posts: 832 · Reputation: 4795
#2Sep 20, 2019, 12:20 AM
https://bitcoin.stackexchange.com/questions/123429/sighash-anyonecanpay-mediated-tx-modification So you can use SIGHASH_ANYONECANPAY to add new inputs after the transaction has been signed. But you must sign also with SIGHASH_SINGLE otherwise they won't be able to add new outputs.
4 Reply Quote Share
Posts: 8 · Reputation: 162
#3Sep 20, 2019, 12:26 AM
You must create an unsigned transaction (PSBT) Select inputs (UTXO) Specify outputs - addresses, amounts. Create a PSBT (unsigned transaction) Export the PSBT file or QR code. Send it to the second participant. The other participant: imports the PSBT into their Sparrow verifies,inputs,outputs. adds their signature (but does NOT change the structure) Collect signatures.Either they send you the PSBT backor the transaction is collected from them. The transaction is finalized .Sent to the network
3 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#4Sep 20, 2019, 04:07 AM
Does Sparrow even have an input/output combiner feature? I've checked the release notes and I didn't find anything related to it, but I might have just missed it. Anyways, what is your goal? Something like a manual coin-join? For that feature, Electrum has it but its "combine->join input/output" feature is limited to unsigned transactions, else if either of the two txns is signed, you'll have to sign the combined transaction again. The "combine->merge signatures" option on the other hand, requires to combine the same transaction just like Bitcoin Core's combinepsbt RPC. If you want to check it out, Electrum's "combine" feature is in the transaction preview when you imported a transaction or in the advanced transaction preview.
0 Reply Quote Share
silentchainHero Member
Posts: 473 · Reputation: 2317
#5Sep 20, 2019, 09:53 AM
Nope, Sparrow doesn’t have PSBT editor that allows adding inputs or/and outputs to  PSBT file signed with the “Single + Anyone Can Pay”-sighash-flag. So anyone who wants to add their own inputs and outputs after receiving this PSBT must use another client that supports PSBT editing and can finalize the transaction. P.S. It’s a bit surprising that Sparrow still doesn’t include such “input/output combiner” feature.
1 Reply Quote Share
bear365Full Member
Posts: 65 · Reputation: 498
#6Sep 21, 2019, 02:55 PM
I created an unsigned transaction and sent the file to a friend. He imports the PSBT, but the wallet only shows it in view-only mode it doesn’t allow editing or adding any inputs or outputs. In Electrum, I imported my friend’s PSBT. There’s a merge inputs/outputs, button do I need to paste my own raw unsigned transaction there, or does it work differently?
0 Reply Quote Share
gr3g.0rbitHero Member
Posts: 1025 · Reputation: 2646
#7Sep 22, 2019, 11:58 PM
Yes, you combine your and your friend's unsigned PSBT in Electrum using "join inputs/outputs" option. Then, sign it separately and combine the signatures using the "merge signatures" option. Or alternatively, sign it and pass the partially signed combined txn to your friend for him to complete the required signatures. The goal is to have enough signatures depending on the number of inputs of the combined transaction. P.S.: I asked a Mod to merge your two consecutive replies.
3 Reply Quote Share
?Reply
Sign in to reply to this topic

Related topics