Skip to content

belljustin/stamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stamp

The StampStorage contract is a simple ethereum contract whose purpose is to record proof of document existence at a given timestamp.

The SHA256 hash of a document is submitted to the contract which will be "stamped" with a datetime represented as seconds since the epoch. Anyone can verify the existence and check the timestamp of these stamps on the public blockchain.

Stamp API

Submitting stamps

To avoid broadcasting frequent and numerous document stamps - which may be prohibitively expensive - document hashes can be combined into a Merkle Tree and the tree root submitted for stamping. Document hashes submitted to the Stamp API are periodically batched and submitted in this way.

Document proofs

A subset of the tree nodes, which are sufficient to prove a valid document is included in a stamp, may be retrieved after the stamp has been mined. The proof's size is proportianal to log(n), where n is the number of documents submitted in the stamp. Others can independently and trustlessly:

  • verify this proof forms a valid merkle tree,
  • its root is stored in the StampStorage contract,
  • and check the stamp timestamp, t proving the document existed at least since time t.

Install

Run make go to:

  • generate the go contract code from the solidity contract
  • build the stamp server binary

Run make truffle to:

  • compile all the solidity contracts
  • perform ethereum migrations on geth network

Database

Database migrations are run with rambler. To apply the next database migration, run rambler -c sql/rambler.json apply. To revert to the previous migration, run rambler -c sql/rambler.json reverse

Run

docker-compose up
./build/stamp -config config.json

Configuration

An example configuration file can be found at config.json.

contract

  • address: the hex address of the contract
  • host: geth node hostname
  • port: geth node port
  • interval: period, in seconds, to submit a new stamp
  • privateKey: path to the Keystore File (UTC / JSON)
  • password: used to decrypt the keystore file

Requirements

API

About

A distributed, zero-trust way to timestamp document hashes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published