Command-line tool to create and verify OpenTimestamps proofs
Maintained. Last release 5 weeks ago, commits in 2 of the last 26 weeks. Weaker on commit activity and release cadence.
pip install opentimestamps-clientOpenTimestamps Client
Command-line tool to create and validate timestamp proofs with the OpenTimestamps protocol, using the Bitcoin blockchain as a timestamp notary. Additionally this package provides timestamping of PGP signed Git commits, and verification of timestamps for both Git commits as a whole, and individual files within a Git repository.
Requirements
- Python3
While OpenTimestamps can create timestamps without a local Bitcoin node, to verify timestamps you need a local Bitcoin Core node (a pruned node is fine).
Installation
Either via PyPi:
$ pip3 install opentimestamps-client
or from source:
$ python3 -m pip install -e .
On Debian (Stretch) you can install the necessary system dependencies with:
sudo apt-get install python3 python3-dev python3-pip python3-setuptools python3-wheel
Usage
Creating a timestamp:
$ ots stamp README.md
Submitting to remote calendar https://a.pool.opentimestamps.org
Submitting to remote calendar https://b.pool.opentimestamps.org
Submitting to remote calendar https://a.pool.eternitywall.com
You'll see that README.md.ots has been created with the aid of three remote
calendars. We can't verify it immediately however:
$ ots verify README.md.ots
Assuming target filename is 'README.md'
Calendar https://alice.btc.calendar.opentimestamps.org: Pending confirmation in Bitcoin blockchain
Calendar https://bob.btc.calendar.opentimestamps.org: Pending confirmation in Bitcoin blockchain
Calendar https://finney.calendar.eternitywall.com: Pending confirmation in Bitcoin blockchain
It takes a few hours for the timestamp to get confirmed by the Bitcoin blockchain; we're not doing one transaction per timestamp.
However, the client does come with a number of example timestamps which you can try verifying immediately. Here's a complete timestamp that can be verified locally:
$ ots verify examples/hello-world.txt.ots
Assuming target filename is 'examples/hello-world.txt'
Success! Bitcoin block 358391 attests existence as of 2015-05-28 CEST
You can specify JSON-RPC credentials (USER and PASS) for a local bitcoin node like so:
$ ots --bitcoin-node http://USER:PASS@127.0.0.1:8332/ verify examples/hello-world.txt.ots
Assuming target filename is 'examples/hello-world.txt'
Success! Bitcoin block 358391 attests existence as of 2015-05-28 CEST
Incomplete timestamps are ones that require the assistance of a remote calendar to verify; the calendar provides the path to the Bitcoin block header: