Crates.io | hc_seed_bundle |
lib.rs | hc_seed_bundle |
version | 0.2.5 |
source | src |
created_at | 2021-09-30 19:44:17.489806 |
updated_at | 2024-09-20 20:54:23.640581 |
description | SeedBundle parsing and generation library. |
homepage | |
repository | https://github.com/holochain/lair |
max_upload_size | |
id | 458850 |
size | 58,991 |
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.
// 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,
],
// 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 contentsLicense: MIT OR Apache-2.0