Expand description
Signed + password-encrypted invite tokens for network access control.
§Design
A BillPouch network is private by default. The only way to join is to receive an invite token from an existing member. The token:
- Contains the
NetworkMetaKey— the 32-byte random secret that protects file metadata on the network. - Is signed by the inviter’s Ed25519 key so the recipient can verify the invite is authentic.
- Is encrypted with a password shared out-of-band (Signal, phone call, etc.). The password is never stored anywhere.
§Wire format
hex(
salt(16) — Argon2id salt for password KDF
|| nonce(12) — ChaCha20-Poly1305 nonce
|| ciphertext — encrypt(
payload_len(4, LE u32)
|| payload_json
|| ed25519_signature(64)
)
)§Usage
Inviter:
let blob = create_invite(&identity, "amici", None, 24, "shared-password").unwrap();
println!("{blob}");Invitee:
let payload = redeem_invite("<blob>", "shared-password").unwrap();
save_invite_key(&payload).unwrap(); // writes NetworkMetaKey to diskStructs§
- Invite
Payload - The plaintext content of an invite token.
Functions§
- create_
invite - Generate a signed + password-encrypted invite token for
network_id. - redeem_
invite - Decrypt, verify and parse an invite token.
- save_
invite_ key - Persist the
NetworkMetaKeyfrom a redeemed invite to local storage.