NOVA SDK for Rust
Version: 1.0.3 License: MIT Network: NEAR Protocol Mainnet Crates: nova-sdk-rs
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
Create a NOVA account at nova-sdk.com
Generate an API key from the "Manage Account" menu
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.com:
Create or log into your NOVA account
Click "Manage Account"
Click "Generate API Key"
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
Never commit API keys - Use environment variables
Verify network - Check
sdk.network_id()before operationsValidate file hashes - Compare after retrieval
Use TLS - Always connect over secure connections
Regenerate API keys - If compromised, generate a new key at nova-sdk.com
Client-side encryption - Keys are fetched from TEE and used locally; encrypted data travels separately from keys
Examples
See the examples directory for complete working examples:
simple_upload.rs- Basic file uploadgroup_management.rs- Managing groups and members
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Add tests for new functionality
Ensure all tests pass (
cargo test)Submit a pull request
License
MIT LICENSE - Copyright (c) 2026 CivicTech OÜ
Resources
Support
Issues: GitHub Issues
Discussions: GitHub Discussions
Last updated