CSV Adapter Sui
Sui adapter for CSV (Client-Side Validation) with object-based seals.
Overview
This crate implements the AnchorLayer trait for Sui, using owned objects with one-time attributes as seals. Sui provides L1 Structural single-use enforcement through its object model — when an object is consumed (transferred/deleted), it cannot be reused.
Key Features
- Object Seals: Native Sui single-use enforcement (structural guarantee)
- Checkpoint Proofs: Deterministic finality via checkpoint certification
- Dynamic Fields: Commitment anchoring via object metadata
- Ed25519 Signatures: Native Sui signing scheme
- Testnet Support: Full testnet RPC compatibility
- Mock RPC: Built-in mock for offline testing
Installation
Or in your Cargo.toml:
[]
= "0.1"
Features
| Feature | Description | Default |
|---|---|---|
rpc |
Enable real Sui RPC client | ❌ |
Quick Start
Creating a Sui Anchor Layer
use ;
// Create adapter with mock RPC for testing
let adapter = with_mock.unwrap;
// Or with configuration (requires `rpc` feature)
// let config = SuiConfig::new(SuiNetwork::Testnet);
// let rpc = ...;
// let adapter = SuiAnchorLayer::from_config(config, rpc).unwrap();
Working with Object Seals
use SuiAnchorLayer;
use ;
let adapter = with_mock?;
// Create a seal from a Sui object
let seal = adapter.create_seal?;
// Publish a commitment
let commitment = new;
let anchor = adapter.publish?;
Checkpoint Proof Verification
use CheckpointVerifier;
// Verify a checkpoint certification
let verifier = new;
let is_final = verifier.verify_finality?;
Architecture
SuiAnchorLayer
├── Object Seals ← L1 Structural single-use
├── Dynamic Fields ← Commitment publication
├── Checkpoint Proofs ← Narwhal consensus finality
├── Seal Registry ← Double-spend prevention
└── RPC Client ← Sui fullnode interaction (optional)
Seal Lifecycle
- Create: Derive a seal from a Sui object ID
- Consume: Transfer/delete the object (seal is gone)
- Anchor: Create dynamic field with commitment
- Verify: Checkpoint proof confirms consensus finality
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.