zots_core/lib.rs
1//! # zots-core
2//!
3//! Core library for zOpenTimestamps providing hashing, proof format
4//! serialization, and verification logic for Zcash blockchain timestamping.
5//!
6//! ## Overview
7//!
8//! This crate provides the fundamental types and operations for creating
9//! and verifying timestamp proofs:
10//!
11//! - **Hashing**: SHA-256 (default) and optional BLAKE3 hashing of files and data
12//! - **Proof Format**: JSON and compact CBOR+Base64 serialization
13//! - **Attestations**: Blockchain attestation records
14//!
15//! ## Example
16//!
17//! ```rust,no_run
18//! use zots_core::{TimestampProof, ZcashAttestation, Network, hash_file};
19//!
20//! // Hash a file
21//! let hash = hash_file("document.pdf").unwrap();
22//!
23//! // Create a proof
24//! let mut proof = TimestampProof::new(hash);
25//!
26//! // Add an attestation (after blockchain confirmation)
27//! proof.add_attestation(ZcashAttestation::new(
28//! Network::Testnet,
29//! [0u8; 32], // txid bytes
30//! 3739654, // block height
31//! 1734293400, // block time
32//! 0, // memo offset
33//! ));
34//!
35//! // Serialize to JSON
36//! let json = proof.serialize().unwrap();
37//!
38//! // Or to compact format for embedding
39//! let compact = proof.to_compact().unwrap();
40//! ```
41//!
42//! ## Security Warning
43//!
44//! This is experimental software. Do not use on mainnet with real funds.
45//! The code has not been audited.
46
47pub mod error;
48pub mod hash;
49pub mod proof;
50
51pub use error::{Error, Result};
52pub use hash::*;
53pub use proof::*;