Questions tagged [bip143]
14 questions
5
votes
1 answer
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 new address format. I am using an uncompressed…
Thorkil Værge
- 1,047
- 8
- 24
2
votes
2 answers
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 pieces of data from the example to byte arrays
pub =…
noone392
- 422
- 2
- 11
1
vote
1 answer
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-3-1-1eba8f60f2dd?gi=504a17ecca1c
The fix is…
m1xolyd1an
- 5,566
- 2
- 14
- 30
1
vote
1 answer
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 the signature into one with a sighash type of 0x83…
Darius
- 779
- 4
- 16
1
vote
1 answer
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…
Darius
- 779
- 4
- 16
1
vote
1 answer
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 (Signature must be zero for failed…
Malone
- 207
- 1
- 8
1
vote
1 answer
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 is 0x1976a914{20-byte-pubkey-hash}88ac.
For P2WSH…
Kalle Rosenbaum
- 382
- 1
- 10
1
vote
1 answer
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 a private key, acts as a signature for an input.…
Festus Martingale
- 763
- 7
- 13
1
vote
2 answers
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 VOUT: 00000000
Input #1 ScriptSize: 00
…
Keijyu
- 85
- 4
1
vote
1 answer
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 have code that can verify the signatures in bip143…
noone392
- 422
- 2
- 11
0
votes
1 answer
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 generate the signature…
SCBuergel
- 115
- 4
0
votes
1 answer
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 misunderstanding.
After reading BIP141 for P2WPKH…
Malone
- 207
- 1
- 8
0
votes
1 answer
bip143 witness formatting
in bip143 thet define a witness signature. In the first example there is a witness broken down
witness 00
02…
noone392
- 422
- 2
- 11
0
votes
1 answer
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 transactions there are multiple txins in each example, and…
noone392
- 422
- 2
- 11