Questions tagged [sighash-flags]
The sighash-flags tag has no usage guidance.
15
questions
4
votes
1
answer
183
views
What is SIGHASH_ANYPREVOUTANYSCRIPT?
BIP 118 describes SIGHASH_ANYPREVOUT, but also mentions SIGHASH_ANYPREVOUTANYSCRIPT. What is the difference, and why is the later sighash flag needed?
1
vote
2
answers
303
views
Do you sign only the previous output of transaction?
I need to confirm that I understand how transactions work in the Bitcoin network. Ok, so:
Alice is a network node. Alice wants to send bitcoins to someone in the network. Alice is creating a ...
0
votes
1
answer
44
views
Is it possible to reference an input outpoint more than once in a transaction?
For example, could you have the following transaction:
A --> B
A --> C
Where A is an input txid and index, and B and C are outputs? The reason I'm asking is because I believe with SIGHASH_SINGLE ...
1
vote
1
answer
179
views
What goes in the tx hash preimage when signing with 0x83 (SINGLE|ANYONECANPAY)?
I have script to create a P2WPKH to P2WPKH transaction (1 input, 1 output) and sign it with the sighash type 0x01 SIGHASH_ALL.
Which fields would I need to change in the tx digest preimage to turn ...
7
votes
1
answer
810
views
Do we still need SIGHASH_NOINPUT for Lightning Network?
In the original Lightning whitepaper, Joseph Poon advocates using SIGHASH_NOINPUT so that we can create the first commitment transaction which references the funding transaction txid without actually ...
0
votes
1
answer
95
views
Is SIGHASH_NONE encompassing of other signature types?
Say I am building a transaction in private:
Input 1 is signed with SIGHASH_SINGLE ( | SIGHASH_ANYONECANPAY)
Input 2 is signed with SIGHASH_NONE | SIGHASH_ANYONECANPAY
SIGHASH_NONE implies that ...
0
votes
1
answer
217
views
How to generate the digest from a raw bitcoin transaction for verifying signature of specific input?
I'm writing a stand alone process that needs to verify that a known UTXO is part of a new transaction with a valid signature.
Inputs [ UTXO, raw transaction, input_number ]
How do to I verify the ...
4
votes
1
answer
489
views
How was FORKID used in Bitcoin Cash at the original fork point and in all upgrades since?
References:
https://github.com/bitcoincashorg/bitcoincash.org/blob/master/spec/replay-protected-sighash.md
https://github.com/bitcoincashorg/bitcoincash.org/blob/master/spec/2018-nov-upgrade.md
It ...
1
vote
1
answer
199
views
For a transaction with a single input and output, is there a difference between SIGHASH_ALL and SIGHASH_SINGLE|SIGHASH_ANYONECANPAY
I have an signing implementation that already works for SIGHASH_ALL, and I'm trying to also support SIGHASH_SINGLE|SIGHASH_ANYONECANPAY.
I'm referencing https://en.bitcoin.it/wiki/OP_CHECKSIG for the ...
1
vote
1
answer
250
views
How to specify the right input and output to be signed for SIGHASH_SINGLE
For my understand, when building a new TX, need to produce a new scriptSig for the TX; and need add a sigHash code at the end of the TX. If the sighash type is SIGHASH_SINGLE, for a TX with multiple ...
1
vote
1
answer
169
views
SIGHASH_SINGLE vbuterin/pybitcointools
Checking the implementation of Buterin's bitcoin tools I've noticed something strange. According to the Bitcoin developers guide, sighash_single signs only the outputs that match the input where the ...
3
votes
1
answer
232
views
Why are SIGHASH flags signed as 4 bytes when only 1 byte is included in the transaction?
This article brought to my attention that SIGHASH flags are 4 bytes long when signed, but only the last byte is actually included in the transaction. Then OP_CHECKSIG adds 3 bytes 0x000000 back on ...
3
votes
1
answer
428
views
I'm trying to create a new kind of escrow with bitcoin, not sure if it's possible
First off, I understand that the standard way to do escrow with bitcoin is a P2SH with a 2 of 3 multisig redeem script. I'd like to try and do escrow in the following way:
names of 3 parties involved:...
1
vote
1
answer
301
views
Using SIGHASH_NONE in P2SH address
I know that using SIGHASH_NONE in signatures is safe for a transaction only if at least one of the inputs is signed with SIGHASH_ALL, so that a miner can't change the outputs and reclaim the inputs.
...
9
votes
1
answer
224
views
What SIGHASH flags does CoinJoin use?
What SIGHASH flags are used when constructing a CoinJoin transaction?