Comprehensive instructions on how to set up the Concordium Wallet for Web, create an account in the Concordium Wallet for Web, get some testnet CCD and run a local front end can be found in wCCD front-end-set-up section.
The front end supports the following two flows with the Concordium Wallet for Web (or Concordium Wallet for Mobile that uses WalletConnect):
Compute the file hash of a selected file => register its file hash in the smart contract
Compute the file hash of a selected file => retrieve the timestamp and witness (sealer account) that registered the file hash
Select the registration tab to register the file hash and the display tab to look up the timestamp and witness (sealer account) of an already registered file.
A file hash is an algorithmic way to assign a unique string to a file using a cryptographic hash function (e.g., SHA-2) based on the file content. Changing the file’s content would result in a completely new file hash. The eSealing smart contract expects a file hash of length 256-bits as an input parameter because of the used HashSha2256 type.
Register a file#
Select the Registration tab to register the file hash as shown below:
View timestamp and witness#
Select the Display tab to look up the timestamp and witness (sealer account) of an already registered file as shown below:
Use Concordium Client#
The front end is connected to a deployed eSealing smart contract on the Concordium testnet with this source code.
You can interact directly with the smart contract using
concordium-client and your local node
that is running at port 20001 to register a file hash as follows:
$concordium-client contract update 2481 --entrypoint registerFile --sender <YourAccount> --energy 30000 --parameter-json fileHash.json --grpc-port 20001
fileHash.json file with a file hash as content similar to:
Comprehensive instructions on how to set up a local Concordium testnet node on port 20001 (or alternatively link to a remote node via grpc),
concordium-client can be found in Setup the development environment.
In Unix-like systems you can calculate the sha256 hash of a file with the following command:
You can view the
witness (sealer account) of an already timestamped file as follows:
$concordium-client contract invoke 2481 --entrypoint getFile --parameter-json fileHash.json --grpc-port 20001
What is the cost of using your account to seal a file?#
The cost is currently approximately 4-5 cents (Euro) to register a file hash in the smart contract on mainnet. Displaying the timestamp and witness (sealer_account) of a file hash is free of charge because you don’t send a transaction, you just look up the values from the chain.