Skip to main content

Questions tagged [bip143]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
1 answer
58 views

What's the reason for the scriptCode format for a P2WPKH? (BIP 143)

When signing a P2WPKH input, the P2WPKH locking script is converted to the pattern of a legacy P2PKH when creating the scriptCode. From BIP 143: For P2WPKH witness program, the scriptCode is ...
inersha's user avatar
  • 3,185
1 vote
1 answer
101 views

What does CTxOut represent in BIP143 and BIP341?

The term CTxOut is mentioned several times in BIP143 and BIP341. However, I can't understand what it actually represents? I assume it's just the transaction output, but I am not sure and the confusion ...
dassd's user avatar
  • 1,099
1 vote
2 answers
122 views

Error broadcasting SegWit transaction

I have this testnet transaction that I created: Version: 01000000 Marker: 00 Flag: 01 Input Count: 01 Input #1 TXID: 42a752fe4ebd0bdc69cb1b3724de6ccc364661028ab9c043526f3f7cb0571147 Input #1 ...
Keijyu's user avatar
  • 105
1 vote
1 answer
763 views

Creating Witness Signature: non-mandatory-script-verify-flag (Signature must be zero for failed CHECK(MULTI)SIG operation)

So I am trying to do my own witness signatures as described in bip143. I have code that correctly verifies the example signature, so I thought I had a hold of the basic signing and verification. I ...
noone392's user avatar
  • 422
2 votes
2 answers
195 views

The example signature in BIP143 doesn't validate?

In BIP143 the first example has a witness signature and it doesn't appear to validate/be correct?! I wrote a super simple python program to demonstrate import ecdsa import asn1 #Importing the 3 ...
noone392's user avatar
  • 422
0 votes
1 answer
97 views

bip143 witness formatting

in bip143 thet define a witness signature. In the first example there is a witness broken down witness 00 02 ...
noone392's user avatar
  • 422
0 votes
1 answer
169 views

When generating witness for bip143, how do you choose WHAT outpoint to use?

in bip 143 for creating a witness signature it describes what needs to be serialized/signed. One thing that the doc seems to be missing is how to determine WHICH outpoint to use. So in these ...
noone392's user avatar
  • 422
1 vote
1 answer
71 views

Hardware Wallet Vulnerability Fix - Verifying Input Value

I'm confused by the proposed solution posted in the blog regarding the recent vulnerability https://blog.trezor.io/details-of-firmware-updates-for-trezor-one-version-1-9-1-and-trezor-model-t-version-2-...
m1xolyd1an's user avatar
  • 5,666
1 vote
1 answer
383 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 ...
Darius's user avatar
  • 799
1 vote
1 answer
301 views

Help signing a P2WSH Multisig

I'm trying to construct a transaction in regtest mode that spends from a P2WSH 2-of-2 multisig. Here is the funding transaction for 5 btc. It also contains a change output for 5 btc. ...
Darius's user avatar
  • 799
0 votes
1 answer
445 views

P2WPKH - which private key is used to generate signature?

I am looking at the BIP143 P2WPKH example. I am kind of following until the generation of the sigHash: c37af31116d1b27caf68aae9e3ac82f1477929014d5b917657d0eb49478cb670 but then that is used to ...
SCBuergel's user avatar
  • 125
1 vote
1 answer
144 views

Failed CHECK(MULTI)SIG operation - BIP143 hash pre-image

Using Blockstream's api to broadcast a raw transaction to the Bitcoin testnet, I encountered the following error: sendrawtransaction RPC error: {"code":-26,"message":"non-mandatory-script-verify-flag ...
Malone's user avatar
  • 207
0 votes
1 answer
441 views

ScriptCode field in P2SH-P2WPKH BIP-143 Test Vector

I'm trying to understand the meaning of scriptCode in the context of spending a P2SH(P2WPKH) UTXO. I've already read the following answer to a similar question, but it does not fully address my ...
Malone's user avatar
  • 207
1 vote
1 answer
604 views

Why hash witness script instead of pubkey script in signature?

When a segwit input is signed, the signature will commit to the witness script (or a p2pkh-like script in case of p2wpkh). This is specified in BIP143: For P2WPKH witness program, the scriptCode ...
Kalle Rosenbaum's user avatar
5 votes
1 answer
1k views

How do I generate the Bitcoin Cash hash preimage?

I am attempting to manually generate a signed transaction which is to be sent from my address 1GiJZtN7wjUuL4V5i7ZYYDAvFtqi5AhCDr which is bitcoincash:qzk9nxh6qpd9yt3hvv6vvun78s834f3escdhu2vdjp in the ...
Thorkil Værge's user avatar
1 vote
1 answer
946 views

Understanding BIP 143 [hash computation, lockTime, sequence number, witness format]

I'm trying to grasp some of the concepts presented in BIP 143. These are the things I'm stuck on: (1) A new hash format is presented. This new format is used to create a hash, which when signed with ...
Festus Martingale's user avatar