Verifiable Long-Lived Address (VLAD) implementation: a combined Multisig whose message holds the WASM first-lock bytecode and whose signature is by an ephemeral key pair.
A Vlad is a newtype over a combined Multisig. The Multisig message field holds the binary WASM of a first-lock script. The signature is over that script, signed by an ephemeral key pair. The Vlad validates that the inner Multisig is combined (non-empty message) and that the message begins with the \0asm WASM magic bytes.
The goal is to avoid the anti-pattern of using public keys as identifiers. Public keys are subject to compromise and rotation, so identifiers derived from key material become invalid when keys change. A Vlad replaces the public-key identifier with a random identifier (the signature bytes) plus a cryptographic commitment to a validation function (the WASM script).
This crate contains only the Vlad half of the former bs-multicid workspace crate. The Cid half lives in the standalone multi-cid crate. The split lets a downstream crate depend on only the type it needs: multi-vlad depends on multi-key and multi-sig but not on multi-hash, which was only required by Cid.
- Features
- Install
- Usage
- Feature Flags
- The Split from
bs-multicid - Testing
- Maintainers
- Contribute
- License
Vladnewtype over a combinedMultisig.- Builder pattern for
Vladfrom a signing key and a WASM message. - WASM validation: rejects messages that do not begin with the
\0asmmagic bytes. - Combined-signature validation: rejects detached signatures (empty message).
verify()against the signing key viamulti-keyandmulti-sig.- Multibase encoding via
multi-baseandmulti-util.EncodedVladdetects the encoding on decode and always encodes toBase32Lower. - Serde integration under the
serdefeature. Human-readable formats give a struct with amultisigfield; binary formats give the raw bytes. - DAG-CBOR support under the
dag_cborfeature viamulti-cbor.
Add this to your Cargo.toml:
[dependencies]
multi-vlad = "0.1"MSRV: Rust 1.95 (required by multi-key).
use multi_vlad::Builder;
use multi_key::EncodedMultikey;
let mk = EncodedMultikey::try_from(
"fba2480260874657374206b657901012064e58adf88f85cbec6a0448a0803f9d28cf9231a7141be413f83cf6aa883cd04"
).unwrap().to_inner();
let msg = vec![0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00]; // WASM magic + version
let vlad = Builder::default()
.with_signing_key(&mk)
.with_message(&msg)
.try_build()
.unwrap();
// verify the Vlad against the signing key
vlad.verify(&mk).unwrap();
// round-trip through bytes
let bytes: Vec<u8> = vlad.clone().into();
let decoded = multi_vlad::Vlad::try_from(&bytes[..]).unwrap();
assert_eq!(vlad, decoded);| Feature | Default | Effect |
|---|---|---|
serde |
yes | Enables serde serialization for Vlad. |
dag_cbor |
yes | Enables CBOR support for Vlad via multi-cbor. |
xmss |
yes | Enables XMSS post-quantum signature support via multi-key. |
-
examples/ed25519.rs— Build and verify a Vlad with a random Ed25519 ephemeral key pair. Runnable:cargo run --example ed25519
-
examples/xmss.rs— Build and verify a Vlad with an XMSS-SHA2_10_256 post-quantum ephemeral key pair. XMSS is a stateful hash-based scheme: a single key can sign a bounded number of messages (2^h for height h), which is necessary for a Vlad because the same ephemeral key must sign both the Vlad and the first provenance-log entry. Runnable:cargo run --example xmss
The former bs-multicid workspace crate contained two types: Cid and Vlad. These types do not import from each other. They have disjoint dependency sets:
Cidneedsmulti-hashfor theMultihashfield.Vladneedsmulti-keyandmulti-sigfor the innerMultisig.
Splitting the crate lets a downstream crate depend on only the type it needs. For example, wacc needs Cid but not Vlad, so wacc does not pull in multi-key or multi-sig.
The multi-vlad crate is the Vlad half. The multi-cid crate is the Cid half. Vlad does not depend on wacc or multi-hash. The WASM is opaque bytes; the code validates it only by the \0asm magic header. The Script type lives in provenance-log, not wacc.
cargo test --all-features
cargo clippy --all-targets --all-features -- -D warnings
cargo doc --all-features --no-deps- Dave Grantham dwg@linuxprogrammer.org
Pull requests go to the cryptidtech/multi-vlad
repository. Sign commits with GPG. Use Conventional Commits messages.
Licensed under Apache-2.0.
See LICENSE for the full text.