Skip to content

inblockio/DataSymmetry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DataSymmetry

Target: Store SHA3 - 512bit (64Byte) on the Ethereum Blockchain.

Context: To be able to proof ownership over data, it is essential to entanglement the data with Account and Time to be able to put Data into Spacetime. This is a MVP which proofs that the owner of the Wallet (Account) wrote a SHA3 Hash of a data structure to the main-chain and with it entangles it with time through the transaction done and witnessed on the Ethereum Blockchain. The SHA3 Hash can be the result of a file or a merkle-tree. With the source data statically stored and preserved it is possible to proof the existence and potential ownership over that digital asset.

Dependencies

  1. yarn command line tool;
  2. sha3sum command line tool (-a 512) $FILENAME
  3. Alchemy API Key or access to an Ethereum node for advanced users;
  4. Ethereum Wallet e.g. Metamask (Recommended: Metamask);
  5. Blockchain Explorer e.g. Etherscan.io
  6. Top up your Ethereum Wallet to be able to pay for transactions by using a Faucet for a test network or by using real Ether for mainnet deployment.

Witness contracts

Current: AquaWitness (v2)

Address: 0x269Ff9a5CB9BD5319bd95b248d2579Aa1e9D78FE (ETH mainnet)

Gas-optimized contract supporting both SHA3-256 and SHA3-512 hashes:

  • witness(bytes32) - for SHA3-256 (36 bytes calldata, ~23k gas)
  • witness(bytes32,bytes32) - for SHA3-512 (68 bytes calldata, ~23k gas)

Events are fully indexed for efficient log filtering by hash.

Selectors:

  • witness(bytes32) = 0x114ee197
  • witness(bytes32,bytes32) = 0x3771f888

Legacy: EventWriter (v1)

Address: 0x45f59310ADD88E6d23ca58A0Fa7A55BEE6d2a611 (ETH mainnet, Sepolia, Holesky)

Old contract using write(bytes32[2]). Still on-chain; old witnesses remain verifiable.

Usage

  1. Generate the SHA3 hash of your file: sha3sum -a 256 $FILENAME or sha3sum -a 512 $FILENAME
  2. For SHA3-256: call witness(bytes32) with the hash directly
  3. For SHA3-512: split the 64-byte hash into two 32-byte halves and call witness(bytes32,bytes32)

Deploy your own (event) writer contract

Test

yarn run test

Deploy

Local test environment

prepare: get a local node with npm run node

deploy: yarn run testWriterDeploy or yarn run testEventWriterDeploy

Ropsten

prepare: replace ALCHEMY_API_KEY and ROPSTEN_PRIVATE_KEY* in hardhat.config.js *You need to export a Ethereum Wallet Private Key from your Ethereum Wallet and copy it over to your script.

deploy: yarn run goerliWriterDeploy or yarn run goerliEventWriterDeploy yarn run mainnetWriterDeploy or yarn run mainnetEventWriterDeploy

  • configuration is provided to deploy on ropsten and mainnet as well (see hardhat.config.js)
  • for a list of all available scripts look at the file package.json

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors