Working with SIGHASH_SINGLE and ANYONECANPAY

6 replies 221 views
tony2016Newbie
Posts: 2 · Reputation: 31
#1Apr 20, 2024, 06:28 AM
Hey all. Quick question. When I wanna create a raw transaction in Sparrow, do I need to make it unsigned if the other signer needs to add their own inputs and outputs? Like, how do they import it into their wallet? What are the steps?
3 Reply Quote Share
0xNodeMember
Posts: 671 · Reputation: 80
#2Apr 20, 2024, 08:03 AM
You should totally make an unsigned transaction. You can use SIGHASH_ANYONECANPAY to let them add inputs later. But if you sign it with SIGHASH_SINGLE, they can't add outputs. So, keep that in mind.
6 Reply Quote Share
calmblockMember
Posts: 10 · Reputation: 48
#3Apr 20, 2024, 12:54 PM
Right, so here’s the deal: create an unsigned PSBT. Pick your inputs and outputs, then make that PSBT. Export it as a file or QR code, send it to the other person. They’ll import it into Sparrow, check everything, add their signature without changing the setup. After that, it’s signed and sent to the network.
4 Reply Quote Share
0xChadNewbie
Posts: 513 · Reputation: 3
#4Apr 20, 2024, 05:04 PM
Does Sparrow even support combining inputs and outputs? I looked through the notes but couldn't find anything. I might've missed it... what’s the goal here? Trying to do a manual coin-join or what?
2 Reply Quote Share
0xLynxMember
Posts: 113 · Reputation: 205
#5Apr 20, 2024, 11:17 PM
Nah, Sparrow doesn’t have that feature. Kinda weird, right? If someone gets a PSBT, they can’t just edit it for inputs/outputs. They’ll need another wallet that supports that. Seems like a simple feature to include.
5 Reply Quote Share
tony2016Newbie
Posts: 2 · Reputation: 31
#6Apr 21, 2024, 04:40 AM
I sent an unsigned PSBT to my buddy, but his wallet shows it as view-only. He can’t edit. I tried to import it in Electrum. Do I need to paste my own raw transaction there or is it different?
3 Reply Quote Share
0xChadNewbie
Posts: 513 · Reputation: 3
#7Apr 21, 2024, 07:49 AM
You can merge your unsigned PSBT with your friend's in Electrum using the join inputs/outputs button. Just remember to sign it separately and then merge the signatures later. Your goal is to get enough signatures based on the inputs for the combined transaction.
4 Reply Quote Share

Related topics