Blockcerts Guide For Absolute Beginners ( 2021)

Ghita EL AMLAQUI
4 min readMay 20, 2021

Hello, in this article i will be talking about Blockcerts open source project and how to make it work. You can consider this article as your quick start guide, since the official quick start of Blockcerts is not fully detailed. So if you are a beginner and you don’t know where to start, well good news you are in the right place.

Before we move to the technical part, I would like to remind you of some important definitions.

What is Blockcerts ?

Blockcerts is a set of standards developed for participants to issue and verify records, working with any blockchain. It is based on joint work done at the MIT Media Lab, and at Learning Machine. This software was made available free and open source.

What are Blockcerts’ components ?

We have : cert-tools, cert-schema, cert-issuer and cert-verifier. They work together to help you create a project to issue and verify documents.

  • cert-tools: is used for generating templates

A python library, which allows generating a certificate template first, and then instantiating the template into one or more certificates. It generates a JSON version of the certificate.

>>Link to Github repo: https://github.com/blockchain-certificates/cert-tools

  • cert-schema: Only needed by template creators for validating their templates.

cert-tools validates against cert-schema before writing the files, so you don’t have to run it separately.

>>Link to Github repo: https://github.com/blockchain-certificates/cert-schema

  • cert-issuer:

A python library that issues blockchain certificates by creating a transaction from the issuing institution to the recipient on the Bitcoin/Ethereum blockchain that includes the hash of the certificate itself.

>>Link to Github repo: https://github.com/blockchain-certificates/cert-issuer

  • cert-verifier and cert-verifier-js: Used to verify documents

cert-verifier is a python library while cert-verifier-js is a Javascript library. Both of them are for verifying blockchain certificates.

>>Link to Github repo: https://github.com/blockchain-certificates/cert-verifier, https://github.com/blockchain-certificates/cert-verifier-js

The figure below shows the process of creating a digital diploma in the blockchain. First, the institution selects which fields are going to be used. Some fields are static and are the same in all the diplomas, for instance, the institution’s name. However, the student’s name and the course title are dynamically filled for each diploma. In the example shown there can be course descriptions and the number of ECTS. The digital diploma is signed by the institution and then hashed and stored in a transaction to the recipient in the blockchain.

Digital diploma using Blockcerts

Now that you understand how the certifying process using Blockcerts works, we can move to our step-by-step guide. After these 13 steps you will be able to issue and verify certificates.

1- Prerequisites: Python 3.7.9 & pip, Visual Studio tools, GCC compiler.

2- Setup the virtual environment of Python:

a- Install the virtual environment: pip install virtualenv

b- Create a virtualenv folder: virtualenv env

c- Activate the virtualenv: source ./venv/Scripts/activate

d- Deactivate the env (when you are done): deactivate

3- Clone the repository:

git clone https://github.com/blockchain-certificates/cert-issuer.git && cd cert-issuer

4- Modify setup.py :

Go to the line 13, and make it look like this:

with open(os.path.join(here, ‘README.md’), encode=’utf-8’) as fp:

5- Install cert-issuer:

Run the command:

python setup.py install

6- Solve Pysha3 dependencies conflict:

a- Go to ~\cert-issuer\venv\Lib\site-packages\merkletools-1.0.2-py3.7.egg\EGG-INFO

b- Open the file called: requires and change pysha3==1.0b1 to pysha3>=1.0b1

7- Jsonschema version conflict

a- Go to ~\Blockcerts-test\cert-issuer

b- Open requirements file and change the last line from jsonschema==3.0.0 to jsonschema<=3.0.0

8- Create a bitcoin testnet wallet:

Visit this website to generate your wallet credentials: Link

9- Store the private key:

Create in your cert-issuer directory a file named pk_issuer.txt, and paste your private key from your wallet in it.

10- Issuer information:

Create a file in your cert-issuer directory and name it: conf.ini

conf.ini should contain this:

issuing_address = <insert your public key here>chain=bitcoin_testnetbitcoindusb_name=./key_file=./pk_issuer.txtunsigned_certificates_dir=./data/unsigned_certificatesblockchain_certificates_dir=./data/blockchain_certificateswork_dir=./cert-issuer/workno_safe_mode

11- Get some coins:

Generate some free testnet bitcoin in your wallet. Visit one of these websites:

You can track your transactions here: https://www.blockchain.com/explorer

12- Unsigned certificates:

Copy the unsigned certificate examples from ~cert-issuer/examples/data-testnet/unsigned_certificates/

to this directory ~cert-issuer/data/unsigned_certificates/

13- Issue certificates:

Run the command:

python cert_issuer -c conf.ini

NB :

If you get this error: OSError: [WinError 126] module could not be found

Solution : Download libeay32 from here and place it in C:\Windows\System32

If you have other issues, i highly recommend to go check Blockcerts community forum here, you will find the answer.

And Voila, now you can issue and verify any type of documents. You can also certify a batch of documents at the same price as issuing one single document, just visit the cert-isser repository for more details here. They have explained it pretty well.

If you want me to cover more topics about Blockcerts let me know in the comments.

Thank you !

--

--