CSV Adapter Core
Chain-agnostic core traits and types for CSV (Client-Side Validation) adapters.
Overview
This crate provides the foundational types and traits for the CSV protocol, a client-side validation system built on the Universal Seal Primitive (USP). Rights are anchored to single-use seals on any chain. To transfer a Right, the seal is consumed on-chain and the new owner verifies the consumption proof locally — no bridges, no minting, no cross-chain messaging.
Key Types
Right— A verifiable, single-use digital right that can be transferred cross-chainHash— A 32-byte cryptographic hash (SHA-256 based)Commitment— A binding between a right's state and its anchor on a blockchainSealRef/AnchorRef— References to consumed seals and published anchorsInclusionProof/FinalityProof/ProofBundle— Cryptographic proofsAnchorLayer— The core trait each blockchain adapter implementsSignatureScheme— Supported signing algorithms (secp256k1, Ed25519)
Installation
Or in your Cargo.toml:
[]
= "0.1"
Features
| Feature | Description | Default |
|---|---|---|
std |
Enable standard library support | ✅ |
tapret |
Enable Taproot commitment support (requires bitcoin crate) |
❌ |
Quick Start
Creating a Right
use ;
// Create a commitment hash
let commitment = new;
// Create an ownership proof
let owner = OwnershipProof ;
// Create a Right
let right = new;
// Transfer to a new owner
let new_owner = OwnershipProof ;
let transferred = right.transfer;
Working with Commitments
use ;
// Create a commitment with all fields
let commitment = simple;
Verifying Signatures
use ;
let signatures = vec!;
let public_keys = vec!;
let is_valid = verify_signatures;
Architecture
The core crate defines the Universal Seal Primitive — a chain-agnostic abstraction for single-use enforcement:
┌──────────────────────────────────────────────────────────────┐
│ csv-adapter-core │
│ │
│ Right ────────────── Portable digital right │
│ Commitment ──────── Hash chain of state transitions │
│ SealRef ─────────── Reference to consumed seal │
│ AnchorLayer ─────── Trait: per-chain implementation │
│ ProofBundle ─────── Inclusion + finality proofs │
│ SealRegistry ────── Cross-chain double-spend prevention │
└──────────────┬──────────┬──────────┬──────────────────────────┘
│ │ │
┌────────┴┐ ┌─────┴┐ ┌─────┴────┐
│Bitcoin │ │Ethereum│ │Sui/Aptos │
│Adapter │ │Adapter │ │Adapters │
└─────────┘ └────────┘ └──────────┘
Each chain adapter implements AnchorLayer using its native single-use mechanism:
| Chain | Level | Seal Type | Guarantee |
|---|---|---|---|
| Bitcoin | L1 Structural | UTXO spend | Native single-use |
| Sui | L1 Structural | Object deletion | Native single-use |
| Aptos | L2 Type-Enforced | Resource destruction | Language-level scarcity |
| Ethereum | L3 Cryptographic | Nullifier registration | Cryptographic single-use |
Examples
See the examples/ directory for usage patterns:
basic_right— Creating, transferring, and verifying Rightscommitment_chain— Building and validating commitment chains
Run examples with:
License
This project is dual-licensed under either:
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contributing
We welcome contributions! Please see our GitHub repository for more information.