src/crypto is Seed Exact's own port of the Seed client's cryptography. The app has no daemon and does not import @seed-hypermedia/client, so every signed byte it publishes is produced here, in pure JavaScript that runs inside the data module runtime. The module has no ambient clock and no Node dependency: time and (for tests) randomness are arguments.
Responsibility
Derive keys from recovery phrases and encode account ids.
Build and sign the blobs the app publishes: Changes, version Refs, Comments, profile updates.
Sign request envelopes for the notify service and the agents server.
Encrypt, serialize and parse vault state in the Go daemon's exact format.
Prove byte equality with the original client through generated vectors.
Files
File | Role | Page |
|---|---|---|
BIP-39, SLIP-10, Ed25519, principals, base64, HKDF, XChaCha20-Poly1305, UUID, timestamps | ||
Desktop | ||
CIDs, the zero-signature convention, signer shapes | ||
The four signed blob builders | ||
Block and id types, | ||
Agents and notify request envelopes | ||
Vault file envelope, sealing, state codec | ||
Generated CBOR and gzip bundle | ||
| Runtime self-test, vectors, generator | |
Public surface, plus |
How the pieces relate
flowchart TB
V["vendor/codecs.js: encode, strictEncode, decode, gzip"] --> B[blob.ts and signing.ts]
P[primitives.ts] --> B
B --> CH[change.ts]
B --> RF[ref.ts]
B --> CM[comment.ts]
CH --> PR[profile.ts]
RF --> PR
B --> EN[envelopes.ts]
V --> SC[state-codec.ts]
P --> VA[vault.ts]
SC --> VA
EV[envelope.ts] --> VA
FX["fixtures/rn-client.json"] -. checks .-> CH
FX -. checks .-> CM
FX -. checks .-> SC
FX -. checks .-> ENWho uses it
Consumer | What it imports |
|---|---|
Mnemonic and key pair functions through | |
| |
| |
| |
| |
AEAD, base64, state codec, envelope codec |
Dependency versions are listed in Dependencies. Anything in this module that loops over crypto operations must respect the 100 ms turn budget.
In this section
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime