SeedBundle parsing and generation library.
b"SeedBndl"
and focusing on the subkey_id
and can declare a chain of subsequent derivations of a 32 byte seed in the form m/68/1/65/8
where we apply subkey_id
s 68, 1, 65, then 8 in turn.Encoded in MSGPACK binary format.
To better facilitate rust/javascript interoperability, the rust library will treat msgpack "ext" types as binary data.
javascript
// seed_bundle is a top-level array
'seed_bundle':array [
// literal 'hcsb0' version / heuristic marker
'id_ver':str,
// list of SeedCiphers define how to decrypt
'cipher_list':array [
'cipher_1':SeedCipher,
'cipher_2':SeedCipher,
// ..
'cipher_N':SeedCipher,
],
// additional second-level encoding app data
'app_data':bin,
]
javascript
// the PwHash type SeedCipher defines a straight-forward
// pwhash secret that is use to secretstream encrypt a seed
'seed_cipher':array [
// for the pw hash cipher, this is a literal 'pw'
'type':str,
// argon2id 16 byte salt
'salt':bin,
// argon2id mem limit capped to u32 for js compatibility
'mem_limit':int,
// argon2id ops limit capped to u32 for js compatibility
'ops_limit':int,
// secretstream 24 byte header
'header':bin,
// secretstream 49 byte cipher
'cipher':bin,
]
javascript
// Security Questions SeedCipher defines a pwhash cipher
// based on concatonating 3 answers that are lcased/trimmed
'seed_cipher':array [
// for the pw hash cipher, this is a literal 'qa'
'type':str,
// argon2id 16 byte salt
'salt':bin,
// argon2id mem limit capped to u32 for js compatibility
'mem_limit':int,
// argon2id ops limit capped to u32 for js compatibility
'ops_limit':int,
// the first security question to be answered
'question_1':str,
// the second security question to be answered
'question_2':str,
// the third security question to be answered
'question_3':str,
// secretstream 24 byte header
'header':bin,
// secretstream 49 byte cipher
'cipher':bin,
]
sodium_kdf32
- seed derivation
[32 byte sub-seed]
)b"SeedBndl"
argon2id32
- generates secret for seed secretstream encryption
[32 secret bytes]
)[16 salt bytes from bundle]
MODERATE
MODERATE
secretstream_xchacha20poly1305
push_final/pull_final
with entire contentsLicense: Apache-2.0