API_REFERENCE.md
TimeChain Protocol Stack - Complete API Reference
Version: 1.0.0Date: December 6, 2025
Status: Production Ready
Table of Contents
- Cryptography Module
- WEAVE P2P Module
- ForkNode CRDT Module
- TNP Navigation Module
- VEST Audit Module
- ForkNode-VEST Hybrid Module
- System Integration Module
- AEGIS Access Control Module
- Deployment Module
- Benchmarks Module
Cryptography Module
Location:.tcproto/crypto/src/
Ed25519 Digital Signatures
Returns: Tuple of (PublicKey, SecretKey)
Example:
message: Byte slice to signsecret_key: Secret key for signing
Example:
message: Original messagesignature: Signature to verifypublic_key: Public key for verification
true if signature is valid, false otherwiseError: None (returns bool directly)
Example:
BLAKE3 Hashing
data: Data to hash
Example:
Order-Preserving Encryption
plaintext: Integer value to encryptkey: Encryption key
Example:
Noise Protocol
initiator:trueif initiating handshake
Result<Session, NoiseError> containing sessionErrors:
NoiseError::HandshakeFailed if protocol failsExample:
AEAD Encryption
plaintext: Data to encryptkey: 32-byte encryption keynonce: 12-byte nonce (unique per message)
Result<Vec<u8>, CryptoError> containing ciphertextErrors:
CryptoError::InvalidKey, CryptoError::EncryptionFailedExample:
ciphertext: Encrypted datakey: 32-byte encryption keynonce: 12-byte nonce used for encryption
Result<Vec<u8>, CryptoError> containing plaintextErrors:
CryptoError::InvalidKey, CryptoError::DecryptionFailed, CryptoError::AuthenticationFailedExample:
Time Utilities
WEAVE P2P Module
Location:.tcproto/mesh-node/src/
Mesh Node
Underlay Support
ForkNode CRDT Module
Location:.tcproto/fork-node/src/
LSEQ Identifiers
Three-Way Merge
base: Common ancestor timelinebranch_a: First branchbranch_b: Second branch
Result<Timeline, MergeError> containing merged timelineErrors:
MergeError::ConflictUnresolvableExample:
TNP Navigation Module
Location:.tcproto/tnp-node/src/
Fork Detection
timeline_a: First timelinetimeline_b: Second timeline
Option<(u64, u64)> containing (common_length, divergence_point)Example:
Navigation
timeline: Timeline to searchoperation_id: Operation ID
Result<Operation, NavigationError>Errors:
NavigationError::OperationNotFoundExample:
VEST Audit Module
Location:.tcproto/vest-node/src/
Sealing
timeline: Timeline to sealkeypair: Ed25519 keypair for signing
Result<Seal, VestError> containing sealErrors:
VestError::SealFailedExample:
Audit Trail
Merkle Proofs
trail: Audit trailentry_index: Index of entry to prove
Result<MerkleProof, VestError>Example:
ForkNode-VEST Hybrid Module
Location:.tcproto/forknode-vest/src/
Encrypted CRDT
System Integration Module
Location:.tcproto/system/src/
Protocol Stack
Latency Monitor
AEGIS Access Control Module
Location:.tcproto/aegis-node/src/
Zero-Knowledge Proofs
credential: User credentialstatement: Statement to prove
Result<Proof, AegisError>Example:
Access Control
Deployment Module
Location:.tcproto/deployment/src/
Configuration
Deployment Manager
Orchestration
Monitoring
Backup & Restore
Benchmarks Module
Location:.tcproto/benchmarks/
Benchmark Results
SLA Validation
Error Handling
All modules returnResult<T, ErrorType> for error handling.
Common Error Types
Example Usage
Complete End-to-End Flow
Contributing
To extend the API:- Implement trait in target module
- Add unit tests
- Update API reference
- Ensure backward compatibility
API Version: 1.0.0
Last Updated: December 6, 2025
Status: Production Ready ✅