Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • documents/rfcs
  • matograine/rfcs
  • 1000i100/rfcs
  • LukeMarlin/rfcs
  • tuxmain/rfcs
  • pokapow/rfcs
6 results
Select Git revision
Loading items
Show changes
Commits on Source (2)
# DUBP conventions for Hierarchical Deterministic Wallet
## Master seed generation
Master seed should be generated from a [Dubp-Mnemonic].
## Key derivation
Key derivation should use [BIP-Ed25519] specifications.
## Key derivation scheme
First derivation step should be an hardened derivation and represent an `account_id`.
`account_id` is an integer beetween `0` and `(2^24) - 1`.
There are 4 types of accounts :
| Account type | `account_id` value conditions |
|-|-|
| Member | `account_id == 0` |
| Transparent | `account_id != 0 && account_id % 3 == 0` |
| Semi-opaque | `account_id % 3 == 1` |
| Opaque | `account_id % 3 == 2` |
### Account types
Transparent: classic non-member wallet
Semi-opaque: A wallet that uses a single-use public key for each payment to itself (cash back and change transaction), but always uses the same public key for all payments received.
Opaque: A wallet using single-use public keys for each payment received and for each payment to oneself (cash back and change transaction).
### Semi-opaque account derivation scheme
The payment receipt keypair is obtained by derivation `0'` from the semi-opaque account keypair.
For self-payment, it is first necessary to derive the so-called "internal keypair", by derivation `1'` from the semi-opaque account keypair.
Then, each single-use public key is obtained by soft derivation of the "internal public key".
So, the ith payment to oneself is made on the `m/a'/1'/i` keypair, where `a` is the `account_id` of the semi-opaque account.
### Opaque account derivation scheme
For payments to oneself, the scheme is identical to the semi-opaque account scheme.
For external payments, it is first necessary to derive the so-called "external keypair", by derivation `0'` from the opaque account keypair.
Then, each single-use public key is obtained by soft derivation of the "external public key".
So, the ith outward payment is made on the `m/a'/0'/i` keypair, where `a` is the `account_id` of the opaque account.
[Dubp-Mnemonic]: https://git.duniter.org/documents/rfcs/blob/dubp-mnemonic/rfc/0014_Dubp_Mnemonic.md
[BIP-Ed25519]: https://drive.google.com/file/d/0ByMtMw2hul0EMFJuNnZORDR2NDA/view
### Examples
#### Example 1
mnemonic: `"acquire flat utility climb filter device liberty beyond matrix satisfy metal essence"`
seed: `0x4643ecce02b307e3eacd6c838c520c2768882e5e4f1877121b443c5f14c16848`
account_id: `2`
External public key (path `m/2'/0'`): `HWy7CLMNJCvk7QYYax5xxbLoqDqMj9fv5DSnfLcmpjEe`
external chaincode: `EQt2iaLkHD9BArGwp2daFxrCNCDBC76AwErg7HmGgSBq`
Third external address (path `m/2'/0'/3`): `BuerND7fRF1DWV8KxYftmwQ3gLWenPE3TGeb3cJnWNAd`