Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RFCs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
documents
RFCs
Commits
a298fca0
Commit
a298fca0
authored
3 years ago
by
Vincent Texier
Browse files
Options
Downloads
Patches
Plain Diff
Mettre à jour rfc/0019_Duniter_V2_derivation_path_convention_hd_wallets.md
parent
1aeebda4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
rfc/0019_Duniter_V2_derivation_path_convention_hd_wallets.md
+71
-0
71 additions, 0 deletions
rfc/0019_Duniter_V2_derivation_path_convention_hd_wallets.md
with
71 additions
and
0 deletions
rfc/0019_Duniter_V2_derivation_path_convention_hd_wallets.md
+
71
−
0
View file @
a298fca0
# Duniter V2S conventions for Hierarchical Deterministic Wallet
## Master seed generation
Master seed should be generated from a [BIP-39-Mnemonic].
## Key derivation
Key derivation should use [Substrate-Derivation-Path] specifications.
## Key derivation scheme
First derivation step should be an hardened derivation and represent an
`account_id`
.
<mnemonic>//<account_id>
`account_id`
is an integer beetween
`0`
and
`(2^24) - 1`
.
There are 3 types of accounts :
| Account type |
`account_id`
value conditions |
|-|-|
| Member |
`account_id == 0`
|
| Transparent |
`account_id != 0 && account_id % 2 == 0`
|
| Opaque |
`account_id % 2 == 1`
|
*
**Transparent:**
Classic non-member wallet (even)
*
**Opaque:**
A wallet using single-use public keys for each payment received and for each payment to oneself (odd).
### Opaque account derivation scheme
For
**self-payment**
, it is first necessary to derive the so-called "internal keypair", by derivation
`//1`
from the opaque account keypair.
<mnemonic>//<account_id>//1
Then, each single-use public key is obtained by soft derivation of the "internal public key".
<mnemonic>//<account_id>//1/i
Where
`i`
is the payment to oneself number, beginning from 1.
For
**external payments**
, it is first necessary to derive the so-called "external keypair", by derivation
`//0`
from the opaque account keypair.
<mnemonic>//<account_id>//0
Then, each single-use public key is obtained by soft derivation of the "external public key".
<mnemonic>//<account_id>//0/i
Where
`i`
is the public key derivation number, beginning from 1.
[
BIP-39-Mnemonic
]:
https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
[
Substrate-Derivation-Path
]:
https://docs.substrate.io/v3/tools/subkey/
### Examples
#### Example 1
*
**Mnemonic:**
`"acquire flat utility climb filter device liberty beyond matrix satisfy metal essence"`
*
**Seed:**
`0xc7de9b8c771078445f31b7e7ce0ef58b588ac37f85359527b7267ac3ad2d25f5`
*
**Address:**
`5HBUc4C28AWThgPZ47TKoY9RTebMJbkfrLKWveWH6EzfAye4`
*
**Account ID:**
`1`
*
**Type:**
Opaque
*
**First External Public Key**
*
**Path:**
`"acquire flat utility climb filter device liberty beyond matrix satisfy metal essence//1/0/1"`
*
**Address:**
`5CcNUmAo5P4K9LC68fgqFKNDTcxZ7zheLeLgk4mnADXeor2K`
*
**Third External Public Key**
*
**Path:**
`"acquire flat utility climb filter device liberty beyond matrix satisfy metal essence//1/0/3"`
*
**Address:**
`5FpnSswqc97MScQ8cvEjXcT13kNBuNArJKFCxUU6SqeYoBrN`
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment