Skip to main content
The ValidationProof struct represents a cryptographic proof that a subject has been validated at a specific sequence number. It contains all the metadata needed to verify the validation chain.

Structure

subject_id
DigestIdentifier
required
The identifier of the subject being validated.
schema_id
String
required
The identifier of the schema used to validate the subject.
namespace
String
required
The namespace of the subject being validated.
name
String
required
The name of the subject being validated.
subject_public_key
KeyIdentifier
required
The identifier of the public key of the subject being validated.
governance_id
DigestIdentifier
required
The identifier of the governance contract associated with the subject being validated.
genesis_governance_version
u64
required
The version of the governance contract that created the subject being validated.
sn
u64
required
The sequence number of the subject being validated.
prev_event_hash
DigestIdentifier
required
The identifier of the previous event in the validation chain.
event_hash
DigestIdentifier
required
The identifier of the current event in the validation chain.
governance_version
u64
required
The version of the governance contract used to validate the subject.

Creation Methods

Validation proofs can be created for different types of events:

Genesis Event

let validation_proof = ValidationProof::new_from_genesis_event(
    start_request,
    event_hash,
    governance_version,
    subject_id,
);

Transfer Event

let validation_proof = ValidationProof::new_from_transfer_event(
    &subject,
    sn,
    prev_event_hash,
    event_hash,
    governance_version,
    subject_public_key,
);

Standard Event

let validation_proof = ValidationProof::new(
    &subject,
    sn,
    prev_event_hash,
    event_hash,
    governance_version,
);

Usage

Validation proofs are used to:
  • Prove that a subject has been properly validated
  • Maintain the integrity of the validation chain
  • Allow validators to verify the history of a subject
  • Create a cryptographic link between consecutive events

Methods

get_metadata

Extract metadata from the validation proof:
let metadata: Metadata = validation_proof.get_metadata();

is_similar

Check if two validation proofs represent the same validation:
if validation_proof1.is_similar(&validation_proof2) {
    // Same validation
}
  • Event - Events that are validated
  • Metadata - Event metadata extracted from validation proof
  • DigestIdentifier - Cryptographic identifier
  • KeyIdentifier - Public key identifier
  • Subject - The subject being validated

Build docs developers (and LLMs) love