Proof Of Existence Ethereum Smart Contract
Why
Prove that a document existed at some point.
What
This smart contract stores hash values keyed by a numeric ID on the Ethereum blockchain. Only the contract creator (owner) is allowed to add hashes but anyone can verify a hash.
Prerequisites
Understanding Ethereum and Smart Contracts:
- http://www.lawandblockchain.eu/what-is-ethereum/
- https://medium.com/@preethikasireddy/how-does-ethereum-work-anyway-22d1df506369
Basic understanding of Solidity:
Experience with Javascript
Getting Started
npm install
npx truffle develop
starts an in-memory Ethereum blockchain with "immediate mining" ideal for testing and opens a console.npm run test
automatically compiles ProofOfExistence.sol, migrates it to your local test chain, and executes ProofOfExistence.spec.js test.
What's Missing
Documentation and configuration to deploy the contract to Ethereum testnets or live.
Help And Further Reading
- Truffle Docs
- https://blog.zeppelin.solutions/the-hitchhikers-guide-to-smart-contracts-in-ethereum-848f08001f05
- truffle-contract is a handy contract abstraction that makes interacting with a contract more convenient than using web3 directly
- Infura is a hosted Ethereum node cluster so you don't have to run your own client/node when deploying to Ethereum's test or live networks. How to configure truffle to use Infura
- Security considerations when coding Smart Contracts with Solidity