Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions 13.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ The HMAC-SHA256 KDF is built as the following:
2. `hmac_digest = HMAC_SHA256(seed, message)`, where `HMAC_SHA256` is the [hash-based message authentication code](https://en.wikipedia.org/wiki/HMAC) using SHA-256 as the hashing algorithm.
3. `secret = hmac_digest` and `blinding_factor = hmac_digest % N`.

#### P2PK Derivation
Comment thread
thesimplekid marked this conversation as resolved.

Wallet are able to generate private keys to then have proofs be locked to them.

The following path is used for derivation of those keys: `m/129372'/10'/0'/0'/{counter}`:
Comment thread
thesimplekid marked this conversation as resolved.
Outdated

- 129372': Registered SLIP-0044 coin type for Cashu.
- 10': Purpose for generating private keys for usage in P2PK.
- {counter}: Incrementing counter encoded as an unsigned 64-bit integer in big-endian format.
Comment thread
thesimplekid marked this conversation as resolved.
Outdated
Comment thread
ye0man marked this conversation as resolved.
Outdated

### Code Examples

#### Versioned Secret Derivation
Expand Down
22 changes: 22 additions & 0 deletions tests/13-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,25 @@ The corresponding blinding factors `r` are:
"r_4": "5550337312d223ba62e3f75cfe2ab70477b046d98e3e71804eade3956c7b98cf"
}
```

## P2PK Derivation

Using [NUT-13](13.md) derivation procedure for P2PK, we derive values starting from the following BIP39 mnemonic:

```json
{
"mnemonic": "half depart obvious quality work element tank gorilla view sugar picture humble"
}
```

The public keys derived for the first five counters from `counter=0` to `counter=4` are:

```json
{
"m/129372'/10'/0'/0'/0": "03381fbf0996b81d49c35bae17a70d71db9a9e802b1af5c2516fc90381f4741e06",
"m/129372'/10'/0'/0'/1": "039bbb7a9cd234da13a113cdd8e037a25c66bbf3a77139d652786a1d7e9d73e600",
"m/129372'/10'/0'/0'/2": "02ffd52ed54761750d75b67342544cc8da8a0994f84c46d546e0ab574dd3651a29",
"m/129372'/10'/0'/0'/3": "02751ab780960ff177c2300e440fddc0850238a78782a1cab7b0ae03c41978d92d",
"m/129372'/10'/0'/0'/4": "0391a9ba1c3caf39ca0536d44419a6ceeda922ee61aa651a72a60171499c02b423"
}
```