January 2019
Beginner to intermediate
372 pages
11h 17m
English
Let's consider the same example of keeping track of document ownership that we used earlier in NEO application. We will also use the same file with the following content as the asset:
This document was created by Alice.
We will use an md5 (32 characters) hashing algorithm to calculate the asset ID of the file instead of SHA256 (64 characters). This is because the key (bytes32) in the mapping data structure of our contract can accept only 32 characters. The following is the 32-character or 128-bit hash value of the file generated by the md5 algorithm:
c9f50a3bdd2efccb7e34fbd8b42e9675
Once the proof of ownership smart contract is deployed to the blockchain, it can be invoked from the Truffle console. Let's register ...