Skip to content

Commit

Permalink
Add header ranges
Browse files Browse the repository at this point in the history
  • Loading branch information
XuJiandong committed Jul 17, 2024
1 parent ce4856a commit 792f291
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/btc.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,15 @@ The corresponding witness must be a proper `WitnessArgs` data structure in
molecule format. In the lock field of the WitnessArgs, a 65 bytes secp256k1
signature must be present.

The first byte of the signature is the `recId` described in [BIP
The first byte of the signature is the `header` described in [BIP
0137](https://github.com/bitcoin/bips/blob/master/bip-0137.mediawiki#procedure-for-signingverifying-a-signature).
This `recId` ranges from 0 to 3. The `r` and `s` values follow it.
The `r` and `s` values follow it. The `header` can accept following value ranges:
- 0~3
- 27~30 (P2PKH)
- 39-42 (P2WPKH)

They will be converted into 0~3 as `recId`.


## Unlocking Process
The following bytes are hashed via SHA-256 over SHA-256 (double SHA-256):
Expand Down

0 comments on commit 792f291

Please sign in to comment.