Skip to content

Commit 2e10b7f

Browse files
committed
bolt11: specify compact ECDSA/secp256k1 signature format
1 parent f3c94a9 commit 2e10b7f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

11-payment-encoding.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,18 +107,18 @@ The data part of a Lightning invoice consists of multiple sections:
107107

108108
1. `timestamp`: seconds-since-1970 (35 bits, big-endian)
109109
1. zero or more tagged parts
110-
1. `signature`: Bitcoin-style signature of above (520 bits)
110+
1. `signature`: compact ECDSA/secp256k1 signature of the above (520 bits: 64-byte R||S + 1-byte recovery id)
111111

112112
## Requirements
113113

114114
A writer:
115115
- MUST set `timestamp` to the number of seconds since Midnight 1 January 1970, UTC in
116116
big-endian.
117-
- MUST set `signature` to a valid 512-bit secp256k1 signature of the SHA2 256-bit hash of the
118-
human-readable part, represented as UTF-8 bytes, concatenated with the
119-
data part (excluding the signature) with 0 bits appended to pad the
120-
data to the next byte boundary, with a trailing byte containing
121-
the recovery ID (0, 1, 2, or 3).
117+
- MUST set `signature` to a valid compact ECDSA signature over secp256k1 of the SHA-256
118+
hash of: the human-readable part (as UTF-8 bytes) concatenated with the data part
119+
(excluding the signature), with 0 bits appended to pad to a byte boundary.
120+
The signature is encoded as 64 bytes (R || S), followed by a trailing 1-byte
121+
recovery id in {0,1,2,3}.
122122

123123
A reader:
124124
- MUST check that the `signature` is valid (see the `n` tagged field specified below).

0 commit comments

Comments
 (0)