XLS: XRP(L) community defined Suggestions, Proposals, RFCs / Standards / Drafts & discussions, to be added to the core protocol, used for platform & apps devemopment, etc.
MIT License
191
stars
51
forks
source link
XLS-12d: Secret Numbers (Derive XRPL account keypairs based on 8x 6 digits) #15
Existing XRPL account secrets are prone to typo's and not that user friendly. Using numbers means the secrets will be language (spoken, written) agnostic. Existing secrets (family seed, mnemonic) may be intimidating for the public that's relatively new to cryptocurrencies / blockchain technology & very prone to user error (eg. when writing down or reading).
Background
The common formats for XRPL account secrets are (at the time of writing the first (TypeScript) Secret Numbers implementation, July 2019):
Family Seed, eg. sh1HiK7SwjS1VxFdXi7qeMHRedrYX
Mnemonic, eg. car banana apple road ...
Both secrets contain characters that can be easily confuesed or misread. A range of numbers (0-9) is easier to write down (alphabet of just 10 defferent chars (numbers)).
The Secret Numbers encoding method can be used on HEX private keys as well. As HEX private keys are hardly being used & for the sake of offering backwards compatibility for generated Secret Numbers, I propose this to be used with the entropy that can be used for ripple-keypairs as well.
Secret Numbers
A secret based on the Secret Numbers standard contains 8 blocks of 6 digits: the first five digits are int representations of the entropy, the 6th digit is a checksum based on the five preceding digits + the block number.
A block indicator can be added to make it easier for users to enter the right block:
A. 554872
B. 394230
...
H. 258676
The first five digits are the decimal representation of a chunk of the entropy buffer, and will be in the range of 0 - 65535 (0000 - FFFF).
Compatibility
Secret Numbers can be used as entropy-param for eg. the generateSeed method of ripple-keypairs. This means a secret based on the Secret Numbers standard can always be turned in a family seed for backwards compatibility with existing XRPL clients.
Encoding / Decoding
Secret Numbers contain 6 digits in the range of 0-9 per position.
Secret numbers contain 5 digits (int) entropy and a 6th checksum.
The checksum digit is based on the 5 digits entropy and the block position. This way a block of 6 digits entered at the wrong position (A-H) can be detected as being invalid.
A "Secret Number"-chunk should be represented as a string containing six digits, as there can be leading zeroes.
Calculating
Position is the block number starting at zero (0 - 7). The position then multiplied & incremented (* 2 + 1) to make sure it results in an odd number.
calculateChecksum(position: number, value: number): number {
return value * (position * 2 + 1) % 9
}
XLS-12d: Secret Numbers
Derive XRPL account keypairs based on 8x 6 digits
Abstract
Existing XRPL account secrets are prone to typo's and not that user friendly. Using numbers means the secrets will be language (spoken, written) agnostic. Existing secrets (family seed, mnemonic) may be intimidating for the public that's relatively new to cryptocurrencies / blockchain technology & very prone to user error (eg. when writing down or reading).
Background
The common formats for XRPL account secrets are (at the time of writing the first (TypeScript) Secret Numbers implementation, July 2019):
sh1HiK7SwjS1VxFdXi7qeMHRedrYX
car banana apple road ...
Both secrets contain characters that can be easily confuesed or misread. A range of numbers (0-9) is easier to write down (alphabet of just 10 defferent chars (numbers)).
The Secret Numbers encoding method can be used on HEX private keys as well. As HEX private keys are hardly being used & for the sake of offering backwards compatibility for generated Secret Numbers, I propose this to be used with the entropy that can be used for ripple-keypairs as well.
Secret Numbers
A secret based on the Secret Numbers standard contains 8 blocks of 6 digits: the first five digits are int representations of the entropy, the 6th digit is a checksum based on the five preceding digits + the block number.
A secret now looks like:
A block indicator can be added to make it easier for users to enter the right block:
The first five digits are the decimal representation of a chunk of the entropy buffer, and will be in the range of
0 - 65535
(0000 - FFFF
).Compatibility
Secret Numbers can be used as entropy-param for eg. the
generateSeed
method of ripple-keypairs. This means a secret based on the Secret Numbers standard can always be turned in a family seed for backwards compatibility with existing XRPL clients.Encoding / Decoding
Calculating
Position is the block number starting at zero (0 - 7). The position then multiplied & incremented (
* 2 + 1
) to make sure it results in an odd number.Samples
44913 * (0 * 2 + 1) % 9
0 * (2 * 2 + 1) % 9
65535 * (3 * 2 + 1) % 9
65535 * (4 * 2 + 1) % 9
52625 * (7 * 2 + 1) % 9
Implementations
Representations
String
Human Readable & entry
QR Codes