Skip to content

Commit

Permalink
Merge branch 'main' into external-prover
Browse files Browse the repository at this point in the history
  • Loading branch information
DougAnderson444 authored Feb 14, 2025
2 parents 8007868 + 6942979 commit 413bea8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ dag_cbor = ["serde_cbor", "serde_cbor/tags"]
multibase = { version = "1.0", git = "https://github.com/cryptidtech/rust-multibase.git" }
multicodec = { version = "1.0", git = "https://github.com/cryptidtech/rust-multicodec.git" }
multihash = { version = "1.0", git = "https://github.com/cryptidtech/multihash.git" }
multikey = { version = "1.0", git = "https://github.com/cryptidtech/multikey.git" }
multisig = { version = "1.0", git = "https://github.com/cryptidtech/multisig.git" }
multikey = { version = "1.0", git = "https://github.com/DougAnderson444/multikey.git" }
multisig = { version = "1.0", git = "https://github.com/DougAnderson444/multisig.git" }
multitrait = { version = "1.0", git = "https://github.com/cryptidtech/multitrait.git" }
multiutil = { version = "1.0", git = "https://github.com/cryptidtech/multiutil.git" }
rand = "0.8"
Expand Down
1 change: 1 addition & 0 deletions src/serde/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ impl ser::Serialize for Cid {
#[cfg(feature = "dag_cbor")]
{
use multicodec::Codec;

// build the byte string for DAG-CBOR according to the spec
// https://github.com/ipld/specs/blob/master/block-layer/codecs/dag-cbor.md#links
let mut v = Vec::new();
Expand Down
14 changes: 9 additions & 5 deletions src/vlad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,20 @@ use multisig::Multisig;
use multitrait::{Null, TryDecodeFrom};
use multiutil::{BaseEncoded, CodecInfo, DetectedEncoder, EncodingInfo};

/// the Vlad multicodec sigil
/// The Vlad multicodec sigil
pub const SIGIL: Codec = Codec::Vlad;

/// a multibase encoded Vlad that can decode from any number of encoding but always encodes to
/// A multibase encoded Vlad.
///
/// Can decode from any number of encodings but always encodes to
/// Vlad's preferred Base32Lower multibase encoding (i.e. liberal in what we except, strict in what
/// we generate)
pub type EncodedVlad = BaseEncoded<Vlad, DetectedEncoder>;

/// A verifiable long-lived address (VLAD) represents an identifier for loosely coupled distributed
/// systems that combines a random unique idenitfier (none) with the content address of a
/// A verifiable long-lived address (VLAD).
///
/// A VLAD represents an identifier for loosely coupled distributed
/// systems that combines a random unique idenitfier (nonce) with the content address of a
/// verification function in executable format.
///
/// The goal is to avoid the anti-pattern of using public keys as identifiers. Public keys are
Expand All @@ -40,7 +44,7 @@ pub struct Vlad {
}

impl Vlad {
/// verify a Vlad whose nonce is a digital signature over the Cid
/// Verify a Vlad whose nonce is a digital signature over the Cid
pub fn verify(&self, mk: &Multikey) -> Result<(), Error> {
let vv = mk.verify_view()?;
let cidv: Vec<u8> = self.cid.clone().into();
Expand Down

0 comments on commit 413bea8

Please sign in to comment.