rippled
|
Produces a sequence of secp256k1 key pairs. More...
Public Member Functions | |
Generator (Seed const &seed) | |
~Generator () | |
std::pair< PublicKey, SecretKey > | operator() (std::size_t ordinal) const |
Generate the nth key pair. More... | |
Private Member Functions | |
uint256 | calculateTweak (std::uint32_t seq) const |
Private Attributes | |
uint256 | root_ |
std::array< std::uint8_t, 33 > | generator_ |
Produces a sequence of secp256k1 key pairs.
The reference implementation of the XRP Ledger uses a custom derivation algorithm which enables the derivation of an entire family of secp256k1 keypairs from a single 128-bit seed. The algorithm predates widely-used standards like BIP-32 and BIP-44.
Important note to implementers:
Using this algorithm is not required: all valid secp256k1 keypairs will work correctly. Third party implementations can use whatever mechanisms they prefer. However, implementers of wallets or other tools that allow users to use existing accounts should consider at least supporting this derivation technique to make it easier for users to 'import' accounts.
For more details, please check out: https://xrpl.org/cryptographic-keys.html#secp256k1-key-derivation
Definition at line 120 of file SecretKey.cpp.
|
explicit |
Definition at line 161 of file SecretKey.cpp.
ripple::detail::Generator::~Generator | ( | ) |
Definition at line 180 of file SecretKey.cpp.
|
private |
Definition at line 127 of file SecretKey.cpp.
std::pair<PublicKey, SecretKey> ripple::detail::Generator::operator() | ( | std::size_t | ordinal | ) | const |
Generate the nth key pair.
Definition at line 188 of file SecretKey.cpp.
|
private |
Definition at line 123 of file SecretKey.cpp.
|
private |
Definition at line 124 of file SecretKey.cpp.