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.
``` // seedbundle is a top-level array 'seedbundle':array [ // literal 'hcsb0' version / heuristic marker 'id_ver':str,
// list of SeedCiphers define how to decrypt 'cipherlist':array [ 'cipher1':SeedCipher, 'cipher2':SeedCipher, // .. 'cipherN':SeedCipher, ],
// associated application data 'app_data':bin, ] ```
``` // the PwHash type SeedCipher defines a straight-forward // pwhash secret that is use to secretstream encrypt a seed 'seed_cipher':array [ // literal 'pw' indicates the pw hash cipher type '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, ] ```
``` // Security Questions SeedCipher defines a pwhash cipher // based on concatonating 3 answers that are lcased/trimmed 'seed_cipher':array [ // literal 'qa' indicates the security question cipher type '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 contents