Rust client SDK: trait-based vector-core + vector-client + vector-cli#10
Open
L0STE wants to merge 30 commits into
Open
Rust client SDK: trait-based vector-core + vector-client + vector-cli#10L0STE wants to merge 30 commits into
L0STE wants to merge 30 commits into
Conversation
… SingleTxRegister
Add `#![forbid(unsafe_code)]` to all three crates (core, client, cli) and `#![deny(missing_docs)]` to the two library crates. Document every previously undocumented public item (~55 in core, ~31 in client) so both crates compile clean under all-features and per-scheme feature flags (falcon512, hawk512).
…eign ops render raw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A Rust client SDK for Vector, in three workspace crates, restructured from the existing
crates/coreinto a trait-based, feature-gated design at parity with the TypeScript SDK — plus an async RPC client and a CLI.vector-core(crates/core, restructured)SchemeMeta/Signer/Verifier/Derivable/Registrationtraits, aVector<S>facade,Op/Artifact+ deterministic JSON wire, offlineverify_artifact,chain/branch, HKDF sub-account lanes. All five schemes sign and verify. No I/O.vector-client(crates/client, new)tokio+solana-rpc-client):nonce/status, artifact broadcast, fund-in-PDA migration builders, andscan_migration(authority-migration audit).vector-cli(crates/cli, new, binvector)inspect/review/verify(offline) +nonce/advance/scan(RPC).Modular by scheme
Per-scheme cargo features (
ed25519/secp256k1/eip191default;falcon512/hawk512opt-in) gate each scheme's crypto, so--no-default-featuresgenuinely excludes the post-quantum dependencies. The facade is generic over the scheme'sSigner; construction is sync and offline (air-gap friendly), and only the client crate touches the network.Cross-implementation parity (proven, not asserted)
Because Ed25519 / secp256k1 / EIP-191 sign deterministically, the test suite includes byte-for-byte fixtures generated by the TypeScript SDK: Rust deserializes a genuine TS artifact, verifies its signature offline, re-serializes it identically, and reproduces it bit-for-bit from the same seed — proving the advance digest, the signature, and the JSON wire all match across SDKs (the EIP-191 envelope is covered explicitly). Hawk-512 keygen-from-seed determinism is also pinned.
Trust hardening
verify_artifactchecks the artifact's actual advance instruction (canonical shape + PDA binding) and recomputes the digest over the real layout, so "offline verify == will run on-chain" holds. It is panic-free on hostile input (bounds-checked digest/PDA, no debug-only asserts).thiserror):VerifyError,DeserializeError,ClientError— no stringly-typed errors in the library surface.#![forbid(unsafe_code)]on all three crates;#![deny(missing_docs)]on both libraries.advance_index, mutated advance accounts, trailing bytes, zeroed sig, missing PQ pubkey) and malformeddeserialize_artifactinputs are covered.Testing
vector-core: 35 unit + 7 cross-impl parity tests (all features).vector-client: 8 unit (+2#[ignore]on-chain).vector-cli: 5 unit.cargo fmt+cargo clippy --all-features --all-targets -D warningsclean across all three crates.Notes
vector-common; the client digest/encoding is necessarily a separate implementation (zero-copy SBF vs host buffer-build), and the two are kept in agreement by the byte-for-byte parity fixtures above — not by a shared crate.cargo build-sbfis required to producetarget/deploy/vector_falcon512.sobefore the Falcon mollusk tests run (CI/env concern, pre-existing).vector advance --scheme falcon512returns a clear error: Falcon-512 has no seed-based keygen, so CLI advance is unsupported for it (use the SDK). All other schemes are supported.Usage: per-crate
README.mdundercrates/{core,client,cli}.