Transaction Bundles

Transaction Bundles - Technical Specification

This document describes the transaction bundle format, which packages all components of a Roru transaction into a single, verifiable unit.

Bundle Structure

Bundle Format

Transaction Bundle:

pub struct TransactionBundle {
    pub header: BundleHeader,
    pub inputs: Vec<Input>,
    pub outputs: Vec<Output>,
    pub proof: Proof,
    pub nullifiers: Vec<Nullifier>,
    pub public_data: PublicData,
    pub signature: Signature,
    pub metadata: BundleMetadata,
}

Bundle Header

Header Format:

pub struct BundleHeader {
    pub version: u8,              // Bundle version
    pub network_id: u32,          // Network identifier
    pub timestamp: u64,            // Creation timestamp
    pub expiry: Option<u64>,       // Expiry timestamp (if any)
    pub bundle_hash: Hash,        // Hash of bundle
}

Input Structure

Input Format

Input Definition:

Input Components

Note Commitment:

  • Pedersen commitment to note

  • Proves note exists

  • Hides note value

  • Binding commitment

Merkle Proof:

  • Proof note exists in tree

  • Path from leaf to root

  • Verifies inclusion

  • Logarithmic size

Nullifier:

  • Prevents double-spending

  • Unique per note

  • Unlinkable

  • Verifiable

Authorization:

  • Proves spending right

  • Signature or proof

  • Device attestation (if used)

  • Validates ownership

Output Structure

Output Format

Output Definition:

Output Components

Commitment:

  • Pedersen commitment

  • Added to state tree

  • Hides value

  • Binding

Encrypted Note:

  • Encrypted note data

  • Only recipient can decrypt

  • End-to-end encryption

  • Privacy-preserving

Recipient Address:

  • Shielded address format

  • Cannot be linked

  • Privacy-preserving

  • Verifiable

Proof Structure

Proof Format

Proof Definition:

Proof Components

Input Proof:

  • Proves input notes exist

  • Validates nullifiers

  • Verifies authorization

  • Ensures notes not spent

Output Proof:

  • Proves output notes valid

  • Validates commitments

  • Checks recipient format

  • Ensures value ranges

Balance Proof:

  • Proves value conservation

  • Hides individual values

  • Verifies no overflow

  • Ensures correctness

Authorization Proof:

  • Proves spending right

  • Validates signature

  • Checks device (if used)

  • Ensures ownership

Nullifier Set

Nullifier Format

Nullifier Structure:

Nullifier Verification

Verification Process:

  1. Check nullifier not in set

  2. Verify nullifier format

  3. Validate nullifier generation

  4. Add to nullifier set

Verification Code:

Public Data

Public Data Format

Public Data Structure:

Public Data Usage

Use Cases:

  • Public fees

  • Compliance requirements

  • Transparent operations

  • Optional metadata

Signature

Signature Format

Signature Structure:

Signature Verification

Verification Process:

  1. Recover public key

  2. Verify signature

  3. Check authorization

  4. Validate format

Verification Code:

Bundle Metadata

Metadata Format

Metadata Structure:

Bundle Serialization

Serialization Format

Binary Format:

Serialization Code:

Deserialization

Deserialization Code:

Bundle Validation

Validation Process

Validation Steps:

  1. Verify bundle format

  2. Verify signatures

  3. Verify proofs

  4. Verify nullifiers

  5. Verify balance

  6. Verify constraints

Validation Code:

Bundle Hashing

Hash Calculation

Hash Formula:

Hash Implementation:

Performance

Bundle Sizes

Typical Sizes:

  • Header: ~64 bytes

  • Input (per): ~500 bytes

  • Output (per): ~300 bytes

  • Proof: ~1-2 KB

  • Nullifiers: 32 bytes each

  • Signature: ~96 bytes

  • Total: ~2-5 KB (typical)

Optimization

Optimization Techniques:

  • Compress proofs

  • Batch operations

  • Efficient serialization

  • Reduce redundancy

Security

Security Properties

Integrity:

  • Bundle hash prevents tampering

  • Signatures ensure authenticity

  • Proofs ensure correctness

  • Nullifiers prevent double-spending

Privacy:

  • Values hidden in commitments

  • Addresses encrypted

  • Proofs hide information

  • No linkability

Conclusion

Transaction bundles provide:

  • Completeness: All transaction data

  • Verifiability: Cryptographic proofs

  • Privacy: Hidden information

  • Efficiency: Compact format

  • Security: Cryptographic guarantees

Understanding bundles is essential for transaction processing.

Last updated