From 2ce332e47e5b6c703875a605f99635bdc63714b3 Mon Sep 17 00:00:00 2001 From: lescuer97 Date: Mon, 19 Jan 2026 15:40:39 +0100 Subject: [PATCH 1/4] pay to public key standard derivation --- 13.md | 10 ++++++++++ tests/13-tests.md | 22 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/13.md b/13.md index 0bf9cc35..4d06c070 100644 --- a/13.md +++ b/13.md @@ -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 + +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}`: + +- 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. + ### Code Examples #### Versioned Secret Derivation diff --git a/tests/13-tests.md b/tests/13-tests.md index 8e74446a..7149c58a 100644 --- a/tests/13-tests.md +++ b/tests/13-tests.md @@ -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" +} +``` From 75fa183195372089ade021225eeafe86245daf23 Mon Sep 17 00:00:00 2001 From: lescuer97 Date: Wed, 21 Jan 2026 13:58:24 +0100 Subject: [PATCH 2/4] fix: wording --- 13.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/13.md b/13.md index 4d06c070..da7071f7 100644 --- a/13.md +++ b/13.md @@ -41,14 +41,16 @@ The HMAC-SHA256 KDF is built as the following: #### P2PK Derivation -Wallet are able to generate private keys to then have proofs be locked to them. +Wallet are able to generate private keys is a deterministic way to have proofs locked to them. -The following path is used for derivation of those keys: `m/129372'/10'/0'/0'/{counter}`: +The following BIP32 derivation path for derivation of the key: `m/129372'/10'/0'/0'/{counter}`: - 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. +This will allow wallets to swap proof that are still locked to a public key during a restore process. + ### Code Examples #### Versioned Secret Derivation From 04cce64daae99d95b23c55548defd9a709cc662f Mon Sep 17 00:00:00 2001 From: lescuer97 Date: Fri, 27 Mar 2026 15:45:03 +0100 Subject: [PATCH 3/4] use correct purpose and tests --- 13.md | 8 ++++---- tests/13-tests.md | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/13.md b/13.md index da7071f7..f215c320 100644 --- a/13.md +++ b/13.md @@ -41,12 +41,12 @@ The HMAC-SHA256 KDF is built as the following: #### P2PK Derivation -Wallet are able to generate private keys is a deterministic way to have proofs locked to them. +Wallet are able to generate private keys in a deterministic way to have proofs locked to them. -The following BIP32 derivation path for derivation of the key: `m/129372'/10'/0'/0'/{counter}`: +The following BIP32 derivation path for derivation of the key: `m/129373'/10'/0'/0'/{counter}`: -- 129372': Registered SLIP-0044 coin type for Cashu. -- 10': Purpose for generating private keys for usage in P2PK. +- 129373': Purpose picked for P2PK derivation. +- 10': Account for generating private keys for usage in P2PK. - {counter}: Incrementing counter encoded as an unsigned 64-bit integer in big-endian format. This will allow wallets to swap proof that are still locked to a public key during a restore process. diff --git a/tests/13-tests.md b/tests/13-tests.md index 7149c58a..be3b9dcb 100644 --- a/tests/13-tests.md +++ b/tests/13-tests.md @@ -106,10 +106,10 @@ The public keys derived for the first five counters from `counter=0` to `counter ```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" + "m/129373'/10'/0'/0'/0": "021693d45f4fdf610ae641fedb0944fb460fbb8264f21c19d2626c3da755fcbbcb", + "m/129373'/10'/0'/0'/1": "0395461ab678058c0ed6aa39f38dda490eaa163e9ad27070b23ec3d06b41e07535", + "m/129373'/10'/0'/0'/2": "02a05e4e593a633e9b4405f01c9632c8afde24cb613017a1aee56fd76291ad26d1", + "m/129373'/10'/0'/0'/3": "033addea25c3873b93d67d536c61c9d9c993f6efd8b9dfa657951b66b5001e51dd", + "m/129373'/10'/0'/0'/4": "03c964bdf42fc82b6c574615746eeca37527a24f1fdfc1b34a732c53843b5744a5" } ``` From c1ca8a17fa8aec051dec5633285ad6d8b5d4d79e Mon Sep 17 00:00:00 2001 From: Rob Woodgate Date: Fri, 10 Jul 2026 23:18:47 +0100 Subject: [PATCH 4/4] Update 13.md --- 13.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/13.md b/13.md index f215c320..6b8d7787 100644 --- a/13.md +++ b/13.md @@ -41,7 +41,7 @@ The HMAC-SHA256 KDF is built as the following: #### P2PK Derivation -Wallet are able to generate private keys in a deterministic way to have proofs locked to them. +Wallets are able to generate private keys in a deterministic way to have proofs locked to them. The following BIP32 derivation path for derivation of the key: `m/129373'/10'/0'/0'/{counter}`: