Skip to main content
15 votes
Accepted

Do we still need SIGHASH_NOINPUT for Lightning Network?

The lightning network as is is working without SIGHASH_NOINPUT. Thus in its current form it is not needed. However Christian Decker came up with the eltoo payment channel construction. In a nutshell ...
Rene Pickhardt's user avatar
9 votes
Accepted

What SIGHASH flags does CoinJoin use?

CoinJoin uses SIGHASH_ALL. I initially found this confusing because I assumed the interface to CoinJoin a little less synchronized than it is. CoinJoin requires each participant to first specify a ...
James O'Beirne's user avatar
5 votes
Accepted

Can't verify Taproot signatures that use SIGHASH_ANYONECANPAY

It looks like your outpoints are serialized incorrectly. Txids are always displayed in reverse byte order, so when serializing them, they need to be in the reverse order of what everything displays ...
Ava Chow's user avatar
  • 70.5k
4 votes

Why are SIGHASH flags signed as 4 bytes when only 1 byte is included in the transaction?

I assume it is simply the result of lazyness. In the original client source code (and still today), the sighash type is represented as an int. The serialization framework by default serializes ints ...
Pieter Wuille's user avatar
4 votes
Accepted

What is SIGHASH_ANYPREVOUTANYSCRIPT?

Christian Decker answered this on the Stephan Livera podcast. ANYPREVOUT (as you probably already know if you have read BIP 118) relaxes the requirement for an input to spend a particular output. ...
Michael Folkson's user avatar
3 votes

Do you sign only the previous output of transaction?

The sighash type conditions what is part of the digest which is eventually signed for the transaction to be valid. Some sighash types allow to either include (commit to) part --or none-- of the ...
Antoine Poinsot's user avatar
3 votes
Accepted

SIGHASH_SINGLE with no corresponding output

The explanation at the bottom of this site says that if there is no corresponding output, then the message that gets signed is always 0100000000000000000000000000000000000000000000000000000000000000. ...
Pieter Wuille's user avatar
3 votes
Accepted

Trying to make SIGHASH_SINGLE transaction

I understand that second input can be not signed (really?). No, it can and still must be signed. The use of SIGHASH_SINGLE does not remove the need to produce a valid signature. The script ...
Ava Chow's user avatar
  • 70.5k
3 votes

Is SIGHASH_NONE encompassing of other signature types?

SIGHASH_NONE implies that Input 2 will only spend if Input 1 is included in the transaction. This is false. Input 2 is essentially a blank check. SIGHASH_NONE signs none of the outputs (I don't care ...
Raghav Sood's user avatar
2 votes

How was FORKID used in Bitcoin Cash at the original fork point and in all upgrades since?

The purpose for "after certain time, set FORKID to 0xSMTHNG" is to keep the old chain alive but separate, in case of a bug in hard fork. After a Bitcoin Cash hardfork, let's say November 2018, if you'...
MCCCS's user avatar
  • 10.2k
2 votes

For a transaction with a single input and output, is there a difference between SIGHASH_ALL and SIGHASH_SINGLE|SIGHASH_ANYONECANPAY

A one input/one output tx signed with SIGHASH_SINGLE|SIGHASH_ANYONECANPAY can still be modified to include more inputs and outputs, as long as the original input and output are not modified. A tx ...
Raghav Sood's user avatar
2 votes
Accepted

What goes in the tx hash preimage when signing with 0x83 (SINGLE|ANYONECANPAY)?

From BIP143: If the ANYONECANPAY flag is not set, hashPrevouts is the double SHA256 of the serialization of all input outpoints; Otherwise, hashPrevouts is a uint256 of 0x0000......0000. ...
pinhead's user avatar
  • 5,144
2 votes
Accepted

Strange double-spending attack possibility

The signing of the transaction is done over the entire content of the transaction. Any subsequent changes to the transaction would invalidate that signature and thus the entire transaction. It should ...
dassd's user avatar
  • 1,079
2 votes
Accepted

Do you sign only the previous output of transaction?

When creating a Bitcoin transaction, each input explicitly states which unspent transaction output (UTXO) is consumed (via an outpoint consisting of txid:vout) and then proves the spender's authority ...
Murch's user avatar
  • 75.4k
1 vote
Accepted

Is it possible to reference an input outpoint more than once in a transaction?

No, this is not possible - once an outpoint is consumed by a transaction, it is considered spent, including within the same transaction. Your only option here would be to have an intermediary ...
Raghav Sood's user avatar
1 vote

How to generate the digest from a raw bitcoin transaction for verifying signature of specific input?

However, the length bytes seem to make the entire process extremely complex. Not very complex. Here is a piece of my code for generating digest for standard non-segwit transactions and sighash_all ...
amaclin's user avatar
  • 6,770
1 vote

How to specify the right input and output to be signed for SIGHASH_SINGLE

A signature is applied to the input being signed by default, so you don't really pick the input. You have two options: SIGHASH_SINGLE - All inputs are signed, and a single output with the same vout ...
Raghav Sood's user avatar
1 vote

I'm trying to create a new kind of escrow with bitcoin, not sure if it's possible

Partial answer (not a new solution - I merely adapted the micropayment channel protocol): if you allow for public key exchange, one solution seems to me to be: t1: source funds an address A ...
hartmut's user avatar
  • 681
1 vote

Using SIGHASH_NONE in P2SH address

First, it should be said it's not possible to enforce which sighash flags may be used in a P2SH address. Signing is a concern for only the parties to wish to spend funds. Their intent can be captured ...
karimkorun's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible