Tired of ads? Enjoy an ad-free experience by signing up.
  • Insights
    This article was written by a TIA community member. Insights pieces undergo the same rigorous editorial process that newsroom-produced articles have.
Omer Goldberg · · 9 min read

How I understood blockchain by building one in 4 weeks

programmer-typing

Photo credit: Welcomia

There are countless articles and news stories calling blockchain the greatest invention since the internet. On the other hand, there is an equally large camp saying that although the tech is great, there is no real use case.

Until recently, I’ve been somewhere in the middle. Intrigued, I began researching blockchain, reading several articles and white papers and participating in a workshop.

My aim is to explain what I’ve learned so far on my blockchain journey and walk you through an Ethereum-inspired blockchain implementation, which I’ve been working on the past four weeks.

What I cannot create, I do not understand

Two weeks ago, Blockchain Academy TLV, which promotes active and productive technical blockchain discussion, kicked off its inaugural session. During the first meeting, Leonid Beder discussed blockchain basics and live coded a basic blockchain implementation in Typescript.

Although it was a lot of new material to process in an hour, I was hooked. Toward the end of the workshop, Leonid announced a surprise!

surprise-gif

I like surprises!

There would be a competition to see who could make the most creative and “awesome” pull request to the basic blockchain we had just built.

My work over the past two weeks

I had been itching to learn more about blockchain, and I believe that building one is the best way to do that. So, I set out to build an Ethereum-inspired blockchain with the following features:

  • An accounting system where users can register accounts (external accounts), initiate transfers of funds, register contract accounts, and deploy smart contracts across the network
  • Transaction-based state machine
  • Secured and validated transactions and state transitions
  • Capability to allow users to write smart contracts and decentralized applications where they can create their own arbitrary rules for ownership, transaction formats, and state transition functions

Accounts

The global shared state of nodes on the network is composed of accounts, which hold important information such as:

  • Address: This will serve as the name of the account, similar to what we did in the workshop.
  • Balance: This refers to the amount of funds owned by the account.
  • Nonce: If the account is externally owned, nonce represents the number of transactions sent from the account’s address.

A single shared state across the network

External and contract accounts

Smart contracts with permissions

Transaction validation

State transition function

Example contracts

Conclusion

Stay ahead in Asia’s tech landscape

You've reached your 2 free content limit for the month. Sign up for free to read the full story.

🏄 For casual readers / 👶 Free

Basic

US$0

Free forever

Get instant access to this article and more every month

0 premium content

Unlimited news briefs

5

5 articles

Ad-free reading experience

Just US$0 per day

⌛Sign up in 20s. No payment details needed.

📖 For learners / 👍 Starter

Lite

US$4.92/month

Billed annually at US$59/year

Get instant access to this article and more every month

4

4 premium content

Unlimited news briefs & articles

Ad-free reading experience

Just US$0.17 per day

Cancel anytime

Our subscriber community includes professionals from these companies:

Stay updated on the go with our mobile app.

Get latest insights with smoother, more personalized experience through TIA mobile app.

Community Writer

Omer Goldberg

Omer Goldberg is a software developer and entrepreneur, originally from New York, now in Tel Aviv.