csv-adapter-sui 0.1.0

Sui adapter for CSV (Client-Side Validation) with object-based seals
Documentation

CSV Adapter Sui

Crates.io Documentation License

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

cargo add csv-adapter-sui

Or in your Cargo.toml:

[dependencies]
csv-adapter-sui = "0.1"

Features

Feature Description Default
rpc Enable real Sui RPC client

Quick Start

Creating a Sui Anchor Layer

use csv_adapter_sui::{SuiAnchorLayer, SuiConfig, SuiNetwork};

// Create adapter with mock RPC for testing
let adapter = SuiAnchorLayer::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 csv_adapter_sui::SuiAnchorLayer;
use csv_adapter_core::{Hash, AnchorLayer};

let adapter = SuiAnchorLayer::with_mock()?;

// Create a seal from a Sui object
let seal = adapter.create_seal(Some(object_id))?;

// Publish a commitment
let commitment = Hash::new([0xAB; 32]);
let anchor = adapter.publish(commitment, seal)?;

Checkpoint Proof Verification

use csv_adapter_sui::CheckpointVerifier;

// Verify a checkpoint certification
let verifier = CheckpointVerifier::new(checkpoint);
let is_final = verifier.verify_finality(&transaction)?;

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

  1. Create: Derive a seal from a Sui object ID
  2. Consume: Transfer/delete the object (seal is gone)
  3. Anchor: Create dynamic field with commitment
  4. Verify: Checkpoint proof confirms consensus finality

License

This project is dual-licensed under either:

at your option.

Contributing

We welcome contributions! Please see our GitHub repository for more information.