-
Notifications
You must be signed in to change notification settings - Fork 77
Deterministic pay to public key generation #331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -39,6 +39,18 @@ 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 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}`: | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| - 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. | ||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this using BIP32? Should be more clear.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, I'll make it clearer |
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| This will allow wallets to swap proof that are still locked to a public key during a restore process. | ||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| ### Code Examples | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| #### Versioned Secret Derivation | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder of this should just be a new nut would be easier to track who supports it and think we should avoid changing existing nuts where we can especially widely supported ones like nut13. Though it would be a very small nut.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about the same but I don't think it's needed in this case. Maybe if we start making more deterministic generation we would move it there.