Develop blockchain “Trusted Diploma” in 15 minutes. Step by step instruction

Surfing the Web, I have noticed several articles about Emercoin and The Bitfury Group success story.

Emercoin blockchain changes the educational sector with "Trusted Diploma" verification system

First several times I just skipped them, but then decided to look inside.

“We are very happy to work with the innovative Emercoin team on this crucially important project. The Trusted Diploma platform will help our school build a secure and immutable database of education certificates, which will help our graduates as they pursue successful careers,” said Mikheil Batiashvili, the BTU university rector (today — Minister of Education, Science, Culture and Sports of Georgia).

https://medium.com/media/1a4bc71e135f6d79866f326e5b63dde4/href

OK, clear! I have decided that we can create the similar diploma certification prototype in 15 minutes.

It’s a Piece of Cake!

Ready to start?

1! 2! 3! GO!

Product Requirements

Product requirements help to turn the vision of a product into reality by outlining what engineers should build. The necessary minimum consists of uses roles and system functions.

On MVP we expect only two roles:

  • universities or colleges staff
  • students and public community

University staff role— provide diploma:

  • prepare digital copy or scan of diploma
  • gather student information: Name and Surname, Specialty, Date, Group, etc.
  • put required information in a diploma certification system

Students & public users

  • validate diploma information

Diploma System Logic

  • guarantee that only university can add diploma information
  • support any diploma formats
  • provide read-only open public access 24/7 (including files and text data)

Assumptions

extra security level, public transaction visibility, zero budget 🙂

Solution Design Architecture

  1. IPFS is using to store diploma files. Every unique file (including diploma) has own unique hash.
  2. University staff input student information data and unique diploma hash is taken from IPFS to Transaction Data of Ethereum blockchain.
  3. For every University is announced a unique public address to guarantee authority. One transaction dedicated to one diploma

Let’s take a look at what happens when you add files to IPFS:

  • Each file and all of the blocks within it are given a unique fingerprint called a cryptographic hash.
  • IPFS removes duplications across the network and tracks version history for every file.
  • Each network node stores only content it is interested in, and some indexing information that helps figure out who is storing what.
  • When looking up files, you’re asking the network to find nodes storing the content behind a unique hash.
  • Every file can be found by human-readable names using a decentralized naming system called IPNS.

Step 1. Creation Diploma file

In a fantastic world, all Universities use one standard format of the digital diploma. However, in real life, there are a lot of different options with unclear name conventions:

  • pdf diploma copy
  • a predefined .pdf template with locked design and filled student data
  • low-quality scan or photo

We have to work with all of them!
Create own ‘handmade’ file in MS Word or MS Paint, input your personal or test data and save as pdf or jpeg. Don’t worry about the quality of document as it’s just testing.

My ugly example

Step 2. Upload file network. Check unique hash

Next step put this file in the blockchain.

We know that public blockchain cannot support media file storing. So we have to use another solution. Upload files to IPFS and store only hash to the public blockchain

The unique file has the unique hash. If we upload diploma file to IPFS than hackers cannot change it as hash will be re-created.

Go to https://globalupload.io/

Upload your diploma file. Copy and save you hash

QmZLuAQNzXZnzrZwyhusnyJW2HTna8zrPqwwNr2NtPen5P

Step 3. Adding data in blockchain

Open notepad and create your own diploma record including hash of diploma:

Andrii Ryzhenko;Ukraine;Kiev;Master;FI-82;KPI; 2018;QQmZLuAQNzXZnzrZwyhusnyJW2HTna8zrPqwwNr2NtPen5P

But Ethereum data transaction supports hex format. Use a convector “text to hex” and transfer actual record

Convert a String to Hex – Online Hex Tools

My example

My hex text

416e647269692052797a68656e6b6f3b556b7261696e653b4b6965763b4d61737465723b46492d38323b4b50493b20323031383b516d5a4c7541514e7a585a6e7a725a77796875736e794a573248546e61387a72507177774e72324e7450656e3550

Now we ready send data to the Ethereum blockchain.

Time to install MetaMask. Skip if you used it before

I usually use MetaMask web plugin.

Go to www.metamask.io website and follow a basic instruction to install it. Save mnemonic words to restore access in case issues.

Next, go https://faucet.rinkeby.io/

Finish a simple quest. Copy you account address from MetaMask to Google+ post.

Input link to faucet form and select 3 days delay for 18.75 Ethers.

Wait for account balance update

Run Ethereum Transaction

Go to the Ethereum MetaMask wallet. Select Rinkeby Test Network. Additionally, you can use public Ethereum network or run own private Ethereum networks (MS Azure or Google Cloud).

Click SEND, input data:

  • Recipient Address: Select any (in future it’s can be student address or Ministry of Education portal)
  • Amount: 0 (in future it’s can be 0.0000000171 to mark transaction)
  • Transaction Data (optional): paste your hex output. Transaction data must be a hex string

Click NEXT

Increase Gas Limit (better add zero, as 21000 wei is not enough. Ethereum spends 68 gas for non-zeros byte)

Click SEND

Wait for transaction results

Step 4. Validation of the diploma

Open link of your last transaction in MetaMask.

Validate the main parameters of the Ethereum transaction:

  • Transaction status is “Success”
  • Is address From is filled and its equal to University account
  • Check “Input Data” filed, but don't forget change selection of UTF-8 option

My transaction link example

Rinkeby Transaction 0x4d38f11fc2aba277b44a2cfba8a7775bf8739339edff999d7e6a29b0e0dc567f

Copy hash string to browser link https://ipfs.io/ipfs/{copy_your_file_hash}.

Open the diploma file and compare it with uploaded version.

Summary

  • University diploma certification system on blockchain is up and running
  • Only authorized staff can upload data from the unique address. Everybody can check diploma
  • 15 minutes project with zero budget

Don’t forget share or like the article to help other people discover and read it.

Thanks a lot!


Develop blockchain “Trusted Diploma” in 15 minutes. Step by step instruction was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: