OpenTimestamps Integration
Overview
Bitcoin Commons uses OpenTimestamps (OTS) to anchor governance registries to the Bitcoin blockchain, providing cryptographic proof that governance state existed at specific points in time. This creates immutable historical records that cannot be retroactively modified.
Purpose
OpenTimestamps integration serves as a temporal proof mechanism by:
- Anchoring governance registries to Bitcoin blockchain
- Providing cryptographic proof of governance state
- Creating immutable historical records
- Enabling verification of governance timeline
Architecture
Monthly Registry Anchoring
Anchoring Schedule:
- Frequency: Monthly on the 1st day of each month
- Content: Complete governance registry snapshot
- Proof: OpenTimestamps proof anchored to Bitcoin
- Storage: Local proof files and public registry
Code: anchor.rs
Registry Structure
{
"version": "YYYY-MM",
"timestamp": "YYYY-MM-DDTHH:MM:SSZ",
"previous_registry_hash": "sha256:abc123...",
"maintainers": [...],
"authorized_servers": [...],
"audit_logs": {...},
"multisig_config": {...}
}
Code: anchor.rs
OTS Client
Client Implementation
The OtsClient handles communication with OpenTimestamps calendar servers:
- Calendar Servers: Multiple calendar servers for redundancy
- Hash Submission: Submits SHA256 hashes for timestamping
- Proof Generation: Receives OpenTimestamps proofs
- Verification: Verifies proofs against Bitcoin blockchain
Code: client.rs
Calendar Servers
Default calendar servers:
alice.btc.calendar.opentimestamps.orgbob.btc.calendar.opentimestamps.org
Code: client.rs
Proof Generation
OTS Proof Format
- Format: Binary OpenTimestamps proof
- Extension:
.json.ots(e.g.,YYYY-MM.json.ots) - Content: Cryptographic proof of registry existence
- Verification: Can be verified against Bitcoin blockchain
Proof Process
- Calculate Hash: SHA256 hash of registry JSON
- Submit to Calendar: POST hash to OpenTimestamps calendar
- Receive Proof: Calendar returns OTS proof
- Store Proof: Save proof file locally
- Publish: Make proof publicly available
Code: client.rs
Registry Anchorer
Monthly Anchoring
The RegistryAnchorer creates monthly governance registries:
- Registry Generation: Creates complete registry snapshot
- Hash Chain: Links to previous registry via hash
- OTS Stamping: Submits registry for timestamping
- Proof Storage: Stores proofs for verification
Code: anchor.rs
Registry Content
Monthly registries include:
- Maintainer information
- Authorized servers
- Audit log summaries
- Multisig configuration
- Previous registry hash (hash chain)
Code: anchor.rs
Verification
Proof Verification
OTS proofs can be verified:
ots verify YYYY-MM.json.ots
Code: verify.rs
Verification Process
- Load Proof: Read OTS proof file
- Verify Structure: Validate proof format
- Check Calendar: Verify calendar server signatures
- Verify Bitcoin: Check Bitcoin blockchain anchor
- Verify Hash: Confirm hash matches registry
Integration with Governance
Audit Trail Anchoring
Audit log entries are anchored via monthly registries:
- Monthly Snapshots: Complete audit log state
- Hash Chain: Links between monthly registries
- Immutable History: Cannot be retroactively modified
- Public Verification: Anyone can verify proofs
Code: entry.rs
Governance State Proof
Monthly registries prove governance state:
- Maintainer List: Who had authority at that time
- Server Authorization: Which servers were authorized
- Configuration: Governance configuration snapshot
- Timeline: Historical record of changes
Configuration
[ots]
enabled = true
aggregator_url = "https://alice.btc.calendar.opentimestamps.org"
monthly_anchor_day = 1 # Anchor on 1st of each month
registry_path = "./registries"
proofs_path = "./proofs"
Code: config.rs
Benefits
- Immutability: Proofs anchored to Bitcoin blockchain
- Verifiability: Anyone can verify proofs independently
- Historical Record: Complete timeline of governance state
- Tamper-Evident: Any modification breaks hash chain
- Decentralized: No single point of failure
Components
The OpenTimestamps integration includes:
- OTS client for calendar communication
- Registry anchorer for monthly anchoring
- Proof verification
- Hash chain maintenance
- Proof storage and publishing
Location: blvm-commons/src/ots/, blvm-commons/src/audit/