Skip to content

Commit

Permalink
trivial: fix wording and links in bolt03 (#1192)
Browse files Browse the repository at this point in the history
* bolt03: fix link to `bitcoind`'s `policy.cpp` file

The original link is broken, we now replace it with a permalink.

* bolt03: remove 0 `txout` count in closing tx

Txns cannot have zero outputs.

* bolt03: remove wrong ref to `remotepubkey` and fix format

`remotepubkey` has been placed at the wrong place, also fixes the format
so it's easier to read.
  • Loading branch information
yyforyongyu authored Aug 27, 2024
1 parent 5dec5eb commit fd83d7c
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions 03-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ Note that there are two possible variants for each node.
* `txin[0]` sequence: 0xFFFFFFFF
* `txin[0]` script bytes: 0
* `txin[0]` witness: `0 <signature_for_pubkey1> <signature_for_pubkey2>`
* txout count: 0, 1 or 2
* txout count: 1 or 2
* `txout` amount: final balance to be paid to one node (minus `fee_satoshis` from `closing_signed`, if this peer funded the channel)
* `txout` script: as specified in that node's `scriptpubkey` in its `shutdown` message

Expand Down Expand Up @@ -514,7 +514,7 @@ Bitcoin Core defines the following dust thresholds:
- pay to witness script hash (p2wsh): 330 satoshis
- unknown segwit versions: 354 satoshis

The rationale of this calculation (implemented [here](https://github.com/bitcoin/bitcoin/blob/0.21/src/policy/policy.cpp))
The rationale of this calculation (implemented [here](https://github.com/bitcoin/bitcoin/blob/2aff9a36c352640a263e8b5de469710f7e80eb54/src/policy/policy.cpp#L28))
is explained in the following sections.

In all these sections, the calculations are done with a feerate of 3000 sat/kB
Expand Down Expand Up @@ -673,12 +673,11 @@ These pubkeys are simply generated by addition from their base points:

pubkey = basepoint + SHA256(per_commitment_point || basepoint) * G

The `localpubkey` uses the local node's `payment_basepoint`;
The `remotepubkey` uses the remote node's `payment_basepoint`;
the `local_htlcpubkey` uses the local node's `htlc_basepoint`;
the `remote_htlcpubkey` uses the remote node's `htlc_basepoint`;
the `local_delayedpubkey` uses the local node's `delayed_payment_basepoint`;
and the `remote_delayedpubkey` uses the remote node's `delayed_payment_basepoint`.
- The `localpubkey` uses the local node's `payment_basepoint`;
- The `local_htlcpubkey` uses the local node's `htlc_basepoint`;
- The `remote_htlcpubkey` uses the remote node's `htlc_basepoint`;
- The `local_delayedpubkey` uses the local node's `delayed_payment_basepoint`;
- The `remote_delayedpubkey` uses the remote node's `delayed_payment_basepoint`.

The corresponding private keys can be similarly derived, if the basepoint
secrets are known (i.e. the private keys corresponding to `localpubkey`, `local_htlcpubkey`, and `local_delayedpubkey` only):
Expand Down

0 comments on commit fd83d7c

Please sign in to comment.