NOVA SDK for Rust

Version: 1.0.3 License: MIT Network: NEAR Protocol Mainnet Crates: nova-sdk-rsarrow-up-right

A Rust SDK for NOVA's secure, decentralized file-sharing primitive on NEAR. NOVA hybridizes on-chain access control with off-chain TEE-secured keys via Shade Agents, using nonce-based ed25519-signed tokens for ephemeral, verifiable access. This ensures privacy-first data sharing for AI datasets, healthcare/financial records, and sensitive documents.

Features

  • 🔐 Zero-Knowledge Architecture - Keys managed in TEE; never exposed to SDK

  • 🌐 IPFS Storage - Decentralized file storage via Pinata

  • ⛓️ NEAR Blockchain - Immutable access control & transaction logs

  • 🛡️ API Key Auth - Secure authentication via API keys (get yours at nova-sdk.com)

  • 🔑 Automated Signing - MCP server signs transactions using keys from Shade TEE

  • 👥 Group Management - Fine-grained membership with automatic key rotation on revocation

  • 🚀 Composite Operations - Simplified workflows for upload/retrieve

Installation

Add to Cargo.toml:

[dependencies]
nova-sdk-rs = "1.0.3"
tokio = { version = "1", features = ["full"] }
chrono = "0.4"

⚠️ Mainnet Notice

NOVA v1.0.0 operates on NEAR mainnet by default. All operations consume real NEAR tokens.

Typical costs:

  • Register group: 0.05 NEAR ($0.15 USD)

  • Upload file: ~0.01 NEAR + IPFS storage

  • Retrieve file: ~0.001 NEAR

For development, use testnet configuration:

Note: On testnet, IPFS operations are mocked (in-memory storage). Blockchain operations use real testnet with faucet tokens.

Quick Start

1. Prerequisites

  1. Create a NOVA account at nova-sdk.comarrow-up-right

  2. Generate an API key from the "Manage Account" menu

  3. Fund your account with NEAR tokens for transaction fees

2. Basic Usage

Core Concepts

Groups

Groups manage shared access to encrypted files. Each group has:

  • A unique identifier (group_id)

  • An owner who manages membership

  • A shared encryption key stored off-chain in Shade Agent/TEE (never stored publicly).

  • A list of authorized members

Access Control (Ephemeral Tokens)

NOVA uses signed tokens for key access:

  • Generate payload (group_id/user_id/nonce/timestamp/signing_pk_b58).

  • Sign with ed25519 (from account keypair).

  • Claim on-chain (claim_token): Verifies sig/membership/nonce (5min window), returns token.

  • Present to Shade: TEE decrypts key, verifies checksum, responds transiently.

Encryption

All data is encrypted client-side using AES-256-GCM:

  • 256-bit symmetric keys (retrieved from Shade TEE)

  • 12-byte random IV per encryption

  • Authenticated encryption with integrity verification

  • SHA256 hashing for file integrity

  • Keys never leave the client unencrypted

Transaction Recording

File metadata (CID/hash) is recorded on-chain automatically during composite_upload.

Authentication

The SDK uses API keys for secure authentication. Get your key at nova-sdk.comarrow-up-right:

  1. Create or log into your NOVA account

  2. Click "Manage Account"

  3. Click "Generate API Key"

  4. Copy the key (shown only once!)

Note: One API key per account. Generating a new key invalidates the old one.

API Reference

Initialization

Group Management

File Operations

Deprecated methods (still work, but emit warnings):

Error Handling

The SDK uses a custom NovaError enum:

🔐 Security Considerations

  1. Never commit API keys - Use environment variables

  2. Verify network - Check sdk.network_id() before operations

  3. Validate file hashes - Compare after retrieval

  4. Use TLS - Always connect over secure connections

  5. Regenerate API keys - If compromised, generate a new key at nova-sdk.com

  6. Client-side encryption - Keys are fetched from TEE and used locally; encrypted data travels separately from keys

Examples

See the examplesarrow-up-right directory for complete working examples:

  • simple_upload.rs - Basic file upload

  • group_management.rs - Managing groups and members

Contributing

Contributions are welcome! Please:

  1. Fork the repository

  2. Create a feature branch

  3. Add tests for new functionality

  4. Ensure all tests pass (cargo test)

  5. Submit a pull request

License

MIT LICENSEarrow-up-right - Copyright (c) 2026 CivicTech OÜ

Resources

Support

Last updated