Skip to content

Instantly share code, notes, and snippets.

@maraoz
Created July 26, 2016 19:04
Show Gist options
  • Save maraoz/5d0b78707a50195fe6e680945cd511ac to your computer and use it in GitHub Desktop.
Save maraoz/5d0b78707a50195fe6e680945cd511ac to your computer and use it in GitHub Desktop.
// Proof of Existence contract, version 1
contract ProofOfExistence {
// state
bytes32 proof;
// constructor
function ProofOfExistence() {
}
// calculate and store the proof for a document
function notarize(string document) {
proof = calculateProof(document);
}
// helper function to get a document's sha256
function calculateProof(string document) returns (bytes32) {
return sha256(document);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment