NOVA SDK for Rust
Version: 1.0.0 (Mainnet)
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
- š”ļø Session-Based Auth - OAuth flow (no private key handling)
- š 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:
[]
= "1.0.0"
= { = "1", = ["full"] }
ā ļø 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.
Quick Start
1. Get Credentials
Visit nova-sdk.com to:
- Create your NEAR account (e.g.,
alice.nova-sdk.near) - Get session token at
/api/auth/session-token
2. Basic Usage
use ;
use fs;
async >
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-CBC:
- 256-bit symmetric keys
- Random IV per encryption
- PKCS7 padding
- SHA256 hashing for integrity
Transaction Recording
File metadata (CID/hash) is recorded on-chain automatically during composite_upload.
// Query group transactions
let txs = sdk.get_transactions_for_group.await?;
for tx in txs
API Reference
Initialization
// Default (mainnet)
let sdk = new?;
// Custom config
let sdk = with_config?;
Group Management
// Check authorization
sdk.auth_status.await?;
// Register group
sdk.register_group.await?;
// Add member
sdk.add_group_member.await?;
// Revoke member
sdk.revoke_group_member.await?;
File Operations
// Upload
let result = sdk.composite_upload.await?;
// Retrieve
let retrieved = sdk.composite_retrieve.await?;
Error Handling
The SDK uses a custom NovaError enum:
use NovaError;
match sdk.composite_upload.await
š Security Considerations
- Never commit session tokens - Use environment variables
- Verify network - Check
sdk.network_id()before operations - Validate file hashes - Compare after retrieval
- Use TLS - Always connect over secure connections
- Rotate tokens - Refresh JWT tokens regularly
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