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