nip44: clarify ecdh hashing

This commit is contained in:
Paul Miller 2024-09-01 00:44:30 +02:00 committed by GitHub
parent 24e97c2539
commit 1002104ece
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

1
44.md
View File

@ -142,6 +142,7 @@ validation rules, refer to BIP-340.
The operation produces a shared point, and we encode the shared point's 32-byte x coordinate, using method
`bytes(P)` from BIP340. Private and public keys must be validated as per BIP340: pubkey must be a valid,
on-curve point, and private key must be a scalar in range `[1, secp256k1_order - 1]`.
Some libraries, like libsecp256k1, apply sha256 on the output. The hashing is unnecessary in NIP44.
- Operators
- `x[i:j]`, where `x` is a byte array and `i, j <= 0` returns a `(j - i)`-byte array with a copy of the
`i`-th byte (inclusive) to the `j`-th byte (exclusive) of `x`.