Official TypeScript/JavaScript SDK for Trinity Protocol v3.1 - Mathematically Provable Multi-Chain Security
π 78/78 Theorems Proven β’ π Multi-Chain β’ βοΈ Quantum Resistant
Quick Start β’ Examples β’ API Reference
- Overview
- Features
- Installation
- Quick Start
- Examples
- API Reference
- Supported Vault Types
- Multi-Language SDKs
- Deployed Contracts
- Development
The official TypeScript/JavaScript SDK for integrating Chronos Vault's mathematically provable security into your applications. Build with confidence knowing every security claim is backed by formal verification.
- β 78/78 Lean 4 formal proofs complete (100%)
- β All 4 critical vulnerabilities fixed
- β Production-ready: November 3, 2025
- β Attack probability: P < 10^-50
- DeFi Protocols: Secure treasury management with multi-sig + time-locks
- DAOs: Decentralized governance with provable security
- Institutions: Enterprise-grade custody across multiple chains
- Developers: Build secure dApps with drop-in vault integration
- Individuals: Self-custody with quantum-resistant encryption
- β Ethereum/Arbitrum L2 - Primary security layer
- β Solana - High-frequency validation
- β TON - Quantum-resistant backup
- β Full TypeScript support with complete type definitions
- β IntelliSense autocomplete for all methods
- β Compile-time error checking
- β Simple, intuitive API
- β Promise-based async/await
- β Comprehensive error handling
- β Built-in retry logic
- β MetaMask (Ethereum/Arbitrum)
- β WalletConnect (Multi-wallet)
- β Phantom (Solana)
- β Solflare (Solana)
- β TON Keeper (TON)
- β TON Wallet (TON)
- β Cross-Chain Bridging - Seamless asset transfers
- β Zero-Knowledge Proofs - Privacy-preserving operations
- β Quantum-Resistant Crypto - ML-KEM-1024 & Dilithium-5
- β Trinity Consensus - 2-of-3 multi-chain verification
- β Time-Lock Vaults - VDF-enforced release schedules
# npm
npm install @chronos-vault/sdk
# yarn
yarn add @chronos-vault/sdk
# pnpm
pnpm add @chronos-vault/sdkRequirements:
- Node.js 18+ or modern browser
- TypeScript 5+ (optional, but recommended)
import { ChronosVaultSDK } from '@chronos-vault/sdk';
// Initialize SDK
const sdk = new ChronosVaultSDK({
network: 'testnet', // or 'mainnet'
chains: ['ethereum', 'solana', 'ton']
});
// Initialize connection
await sdk.initialize();
console.log('β
SDK initialized successfully!');// Create a time-locked vault
const vault = await sdk.createVault({
type: 'time-lock',
unlockTime: Date.now() + 86400000, // 24 hours
assets: [{
token: 'ETH',
amount: '1.0'
}]
});
console.log(`β
Vault created: ${vault.id}`);
console.log(`π Unlocks at: ${new Date(vault.unlockTime)}`);// Get vault details
const status = await sdk.getVault(vault.id);
console.log(`Vault Status: ${status.state}`);
console.log(`Assets: ${JSON.stringify(status.assets)}`);
console.log(`Owner: ${status.owner}`);// Create 3-of-5 multi-sig vault
const multiSigVault = await sdk.createVault({
type: 'multi-signature',
requiredSigners: 3,
totalSigners: 5,
signers: [
'0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb',
'0x123...',
'0x456...',
'0x789...',
'0xabc...'
],
assets: [{ token: 'USDC', amount: '10000' }]
});
// Propose withdrawal
const proposal = await sdk.proposeWithdrawal(multiSigVault.id, {
amount: '1000',
recipient: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
});
// Sign proposal
await sdk.signProposal(proposal.id);
// Execute when 3/5 signatures collected
if (proposal.signatures >= multiSigVault.requiredSigners) {
await sdk.executeProposal(proposal.id);
}// Bridge CVT tokens from Solana to Ethereum
const bridge = await sdk.bridgeAsset({
from: 'solana',
to: 'ethereum',
token: 'CVT',
amount: '100',
recipient: '0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb'
});
console.log(`Bridge initiated: ${bridge.id}`);
// Monitor Trinity Protocol consensus (2-of-3 required)
const consensus = await sdk.getCrossChainConsensus(bridge.id);
console.log(`Verified chains: ${consensus.verified.length}/3`);
// Wait for completion
await sdk.waitForBridgeCompletion(bridge.id);
console.log('β
Bridge completed successfully!');// Generate ownership proof without revealing identity
const proof = await sdk.generateOwnershipProof(vaultId);
console.log('Proof generated:', {
proofType: proof.type,
timestamp: proof.timestamp,
// NO owner address revealed!
});
// Anyone can verify the proof
const isValid = await sdk.verifyProof(proof);
console.log(`β
Proof valid: ${isValid}`);// Create quantum-resistant vault with ML-KEM-1024
const quantumVault = await sdk.createVault({
type: 'quantum-resistant',
encryption: {
algorithm: 'ML-KEM-1024',
signature: 'Dilithium-5'
},
assets: [{
token: 'BTC',
amount: '0.5'
}]
});
console.log('β
Quantum-resistant vault created');
console.log('π Protected for 50+ years against quantum attacks');// Create VDF time-locked vault (mathematically enforced)
const vdfVault = await sdk.createVault({
type: 'vdf-timelock',
vdfIterations: 1000000000, // ~1 hour on modern CPU
assets: [{
token: 'ETH',
amount: '5.0'
}]
});
// VDF guarantees cannot be unlocked early
// Even with infinite parallelization!
console.log('β
VDF time-lock active');
console.log('β±οΈ Unlock requires sequential computation');interface SDKConfig {
network: 'mainnet' | 'testnet';
chains: ('ethereum' | 'solana' | 'ton')[];
rpcUrls?: {
ethereum?: string;
solana?: string;
ton?: string;
};
apiKey?: string;
}
const sdk = new ChronosVaultSDK(config);
await sdk.initialize();// Create vault
await sdk.createVault(config: VaultConfig): Promise<Vault>
// Get vault details
await sdk.getVault(vaultId: string): Promise<Vault>
// List all vaults
await sdk.listVaults(filters?: VaultFilters): Promise<Vault[]>
// Update vault
await sdk.updateVault(
vaultId: string,
updates: Partial<VaultConfig>
): Promise<Vault>
// Lock/unlock vault
await sdk.lockVault(vaultId: string): Promise<void>
await sdk.unlockVault(vaultId: string): Promise<void>
// Delete vault (if empty)
await sdk.deleteVault(vaultId: string): Promise<void>// Bridge assets between chains
await sdk.bridgeAsset(config: BridgeConfig): Promise<BridgeTx>
// Get Trinity Protocol consensus status
await sdk.getCrossChainConsensus(
vaultId: string
): Promise<Consensus>
// Verify Trinity Protocol (2-of-3)
await sdk.verifyTrinityProtocol(
ethereumTxHash: string,
solanaTxHash: string,
tonTxHash: string
): Promise<boolean>
// Wait for bridge completion
await sdk.waitForBridgeCompletion(
bridgeId: string,
timeout?: number
): Promise<BridgeTx>// Generate ownership proof
await sdk.generateOwnershipProof(
vaultId: string
): Promise<Proof>
// Verify ZK proof
await sdk.verifyProof(
proof: Proof
): Promise<boolean>
// Generate private query
await sdk.generatePrivateQuery(
vaultId: string,
queryType: 'balance' | 'ownership' | 'status'
): Promise<PrivateQuery>// Propose withdrawal
await sdk.proposeWithdrawal(
vaultId: string,
withdrawal: WithdrawalRequest
): Promise<Proposal>
// Sign proposal
await sdk.signProposal(
proposalId: string
): Promise<Signature>
// Execute proposal (when threshold met)
await sdk.executeProposal(
proposalId: string
): Promise<Transaction>
// Get proposal status
await sdk.getProposal(
proposalId: string
): Promise<Proposal>The SDK supports 22 different vault types:
- Standard Vault - Simple custody
- Time-Locked Vault - Schedule releases
- Multi-Signature Vault - M-of-N approval
- Geo-Location Vault - Location-based auth
- Quantum-Resistant Vault - Post-quantum crypto
- Zero-Knowledge Vault - Privacy-preserving
- Cross-Chain Fragment Vault - Distributed storage
- VDF Time-Lock Vault - Provable delays
- Inheritance Vault - Estate planning
- Recurring Payment Vault - Automated transfers
- Emergency Access Vault - Disaster recovery
- Social Recovery Vault - Friend-based recovery
- DAO Treasury Vault - Governance integration
- NFT Custody Vault - NFT-specific security
- Staking Vault - Automated staking
- Yield Farming Vault - DeFi integrations
- Insurance Vault - Collateral management
- Escrow Vault - Trustless escrow
- Subscription Vault - Recurring payments
- Donation Vault - Charitable giving
- Grant Vault - Milestone-based releases
- Sovereign Fortress Vault - Maximum security (all 7 MDL layers)
npm install @chronos-vault/sdkpip install chronos-vault-sdkfrom chronos_vault_sdk import ChronosVaultClient
client = ChronosVaultClient(
network='testnet',
chains=['ethereum', 'solana', 'ton']
)
await client.initialize()[dependencies]
chronos-vault-sdk = "3.0"use chronos_vault_sdk::ChronosVaultClient;
let client = ChronosVaultClient::new(Config {
network: Network::Testnet,
chains: vec!["ethereum", "solana", "ton"],
});go get github.com/chronosvault/sdk-goimport "github.com/chronosvault/sdk-go"
client := sdk.NewClient(sdk.Config{
Network: "testnet",
Chains: []string{"ethereum", "solana", "ton"},
})<dependency>
<groupId>org.chronosvault</groupId>
<artifactId>chronos-vault-sdk</artifactId>
<version>3.0.0</version>
</dependency>ChronosVaultClient client = new ChronosVaultClient(
Config.builder()
.network("testnet")
.chains("ethereum", "solana", "ton")
.build()
);| Contract | Address |
|---|---|
| CrossChainBridgeOptimized v2.2 | 0x3E205dc9881Cf0E9377683aDd22bC1aBDBdF462D |
| HTLCBridge v2.0 | 0x6cd3B1a72F67011839439f96a70290051fd66D57 |
| ChronosVault | 0x99444B0B1d6F7b21e9234229a2AC2bC0150B9d91 |
| CVT Token | 0xFb419D8E32c14F774279a4dEEf330dc893257147 |
| Program | Address |
|---|---|
| Trinity Validator | 5oD8S1TtkdJbAX7qhsGticU7JKxjwY4AbEeBdnkUrrKY |
| CVT Token | 5g3TkqFxyVe1ismrC5r2QD345CA1YdfWn6s6p4AYNmy4 |
| CVT Bridge | 6wo8Gso3uB8M6t9UGiritdGmc4UTPEtM5NhC6vbb9CdK |
| Contract | Address |
|---|---|
| Trinity Consensus | EQDx6yH5WH3Ex47h0PBnOBMzPCsmHdnL2snts3DZBO5CYVVJ |
| ChronosVault | EQDJAnXDPT-NivritpEhQeP0XmG20NdeUtxgh4nUiWH-DF7M |
# Clone SDK repository
git clone https://github.com/Chronos-Vault/chronos-vault-sdk.git
cd chronos-vault-sdk
# Install dependencies
npm install
# Build SDK
npm run build
# Run tests
npm test
# Lint code
npm run lint
# Type checking
npm run typecheck# Unit tests
npm run test:unit
# Integration tests
npm run test:integration
# E2E tests
npm run test:e2e
# Coverage report
npm run test:coverage# Build for production
npm run build
# Build with watch mode
npm run build:watch
# Generate type declarations
npm run build:typesFor complete documentation, visit:
| Resource | Description | Link |
|---|---|---|
| Platform | Main application | chronos-vault-platform- |
| API Reference | Complete API docs | API_REFERENCE.md |
| Integration Guide | Code examples | INTEGRATION_EXAMPLES.md |
| Smart Contracts | Contract source code | chronos-vault-contracts |
| Security | Formal verification | chronos-vault-security |
| Repository | Purpose | Link |
|---|---|---|
| Platform | Main application | chronos-vault-platform- |
| Contracts | Smart contracts | chronos-vault-contracts |
| SDK | TypeScript SDK (this repo) | chronos-vault-sdk |
| Documentation | Technical docs | chronos-vault-docs |
| Security | Formal verification | chronos-vault-security |
We welcome contributions!
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
Guidelines:
- Write clear, concise code with comments
- Follow TypeScript best practices
- Add tests for new features
- Update documentation
- Ensure all tests pass
MIT License - see LICENSE file for details.
Copyright (c) 2025 Chronos Vault
- Discord: https://discord.gg/WHuexYSV
- X (Twitter): https://x.com/chronosvaultx
- Medium: https://medium.com/@chronosvault
- Email: chronosvault@chronosvault.org
Chronos Vault SDK - The easiest way to add mathematically provable security to your application. This TypeScript/JavaScript SDK (with Python, Rust, Go, and Java support) gives you drop-in access to Trinity Protocol's 2-of-3 multi-chain consensus, zero-knowledge proofs, and quantum-resistant cryptography.
Our Role in the Ecosystem: We abstract away blockchain complexity so you can focus on building great products. Create vaults, bridge assets, generate ZK proofs, and verify Trinity consensus with simple, type-safe APIsβall backed by 78 formally verified security theorems.
Chronos Vault Team | Trust Math, Not Humans
β Star us on GitHub β’ π¦ Install SDK β’ π SDK Documentation β’ π‘ Code Examples
Built for application developers who want enterprise-grade security without the complexity.