Sign ipfs CID hashes and content version (in an ethereum compatible way)
This tool is an easy way to sign a distribution of files (e.g. a web page or a distributed app). It's intended to be used with ipfs CIDs, so that you can directly access the signed content on any IPFS gateway.
Check out our online example.
Additionally there is a solidity resolver contract which works directly with the signatures created by contenthash-signer-ens. The contract can be updated by anybody with a valid signature. It stores only the most recent ipfs cid (based on the signed version number).
Example usage:
- Checkout the repo and cd into the repo.
- Run
npm install- Create a signature of the js/ directory along with the version 'v1.2.3':¹
./examples/generate.js ----noninteractive "$(ipfs add -r -q --only-hash js" 2>/dev/null | tail -1)" v1.2.3 <<< "0xdc68bd96144c2963602d86b054ad67fd62d488edd78fecf44aa8d8cd90d59f35" > SIGNATURE- optionally validate the just create signature:
./examples/validate.js SIGNATURE¹) you need to have the 'ipfs' command line tool installed
https://github.com/berlincode/contenthash-signer-ens
Code and documentation copyright Ulf Bartel. Code is licensed under the MIT license.