How do I design a blockchain application?

How do I design a blockchain application?

When I started being interested in the blockchain, I found 2 kinds of literature on the subject: there were evangelizing books and articles that promise radiant mornings to the world using the blockchain, but without any kind of hint how to reach this future, and there were down-to-Earth Internet posts giving details how to code directly the blockchain. Both were very useful to me as a starter and I'm very grateful to the authors. But, but... something was missing.

An example of literature of the first kind is the book from Don Tapscott "The Blockchain Revolution". It describes in detail recent start-ups that use the blockchain in different application domains. It was very comforting to see that there are people who are succeeding in applying their blockchain ideas in the real world. But the book said nothing about the fundamental actors who are actually developing the core software and the helper tools around it. And the book said nothing about the dark sides of the blockchain.

On the other side, for people who want to do hands-on programming, there are posts like "Using Javascript To Write Your First Bitcoin Program Ever" or "Bitcoin Programming With BITCOINJ – Part I"

If you are more interested in programming for Ethereum, you have "The Hitchhiker’s Guide to Smart Contracts in Ethereum"

But I could not find any post intended for a project manager or a software architect, explaining the general architecture of blockchain applications, what development tools are available, what are the cautions to take when developing blockchain applications, what are the limitations of Ethereum and/or of Bitcoin, etc.

This is an ambitious goal and I'll not pretend to address all the above questions in a single post or even two, but I'll try to go in that direction. I hope that this might be of any help for you to better understand the technical landscape. To guide this explanation, we'll also consider a supporting question "does it make sense to set blockchain standards"?

Caveat: I'm not a blockchain master, just an "advanced beginner"... but I try to be as accurate as possible. In any case, your comments are more than welcome.

What is a blockchain network?

In the following text, I'll assume that you know what is a blockchain, a bitcoin and Ethereum. If not, you may want to quickly read my trilogy on LinkedIn describing the blockchain in plain words, the Bitcoin in plain words, and the comparison between Ethereum and Bitcoin in plain words.

Now that you know what is a blockchain itself, what is a blockchain network? - A blockchain network is a set of computers connected together via Internet, listening and transmitting on a same port. Each one is called a node. They participate to the "gossip" network by listening to peer nodes for announcement of new transactions and newly validated blocks, and exchanging data with their peers. Each full node stores a complete copy of the blockchain and can send a copy of any block of it to whichever peer asking for it. Each node maintains, for the virtual machine executing the transactions, the "state of the universe" issued from the data they collect. By consensus, this state should be the same on all nodes.

To access to the data stored in a blockchain or to write data to the blockchain, the node uses a "client" software.

How is organised a blockchain application?

The term "client" was initially used by Bitcoin mainly because, on a peer-to-peer network, there is no server: every node is a client. The purpose of the Bitcoin community is to get rid of any server role that could be considered as an authority. Every node is both a client and a server of the other nodes and equal in rights and in responsibilities to other nodes. Because the initial purpose of Bitcoin was to do transactions in virtual currency, the typical Bitcoin application would be a "wallet" that would exchange currency with other wallets.

To program a specific wallet application that would handle digital assets other than bitcoins, but talking to the bitcoin network, one would link application functions to a Bitcoin blockchain library, written in the desired programming language (for example "Bitcoinj" for Java).

In practice, the maintenance team of the Bitcoin client quickly faced a strong demand to program web applications (instead of standalone applications) that would interface the Bitcoin network. Initially, the need was to support creation of web-based wallets or bitcoin exchanges, and it evolved further to create other alt-coin applications. To satisfy such demands, the "Bitcoin Core" client presented a set of RPC API calls that can be accessed by other processes, when running in "server mode".

In Ethereum, the most frequently used "client" is "geth" (go-ethereum) and it also presents a set of RPC calls that can be invoked by using a JavaScript library named "web3".

To make standalone Ethereum applications, it is still possible (as with Bitcoin) to write code and link it to a library that interacts with the Ethereum Virtual Machine like in the diagram above. But the Ethereum literature strongly advises instead to access Ethereum services by RPC calls inside the same localhost. This is now the most popular way to quickly program a blockchain application: by making RPC calls to a "client node" acting as a server providing access to the blockchain.

With this setup, a blockchain application would be composed of the following pieces:

  • an user terminal running a browser executing HTML code;
  • a web server serving HTML pages to the browser, running JavaScript (or runtime code) implementing business logic and making RPC calls to the "client" for blockchain-related functions ;
  • a blockchain "client" running in server mode that talks to its blockchain peers.

Legacy applications can now be made blockchain-aware by interfacing the dynamic web server.

How are structured the applications themselves ? How is structured the client node ? Would it make sense to set some blockchain standards? See the answers in this follow-up post.


Alvaro Gareppe

Senior Director of Technology

7y

Now that some time has passed (since Oct 2016), can you recommend any book that is focused on "software architect, explaining the general architecture of blockchain applications" ? BTW The articles that you have written are really good, thanks for sharing

Pallav Kumar

Digital Product, Technology Strategy and Transformation Leader. Open Banking | Digital Ecosystems | Partnership Frameworks | API Products

8y

Why only client side programming language i.e. js only in use. Is there any server side programming language like C#, JAVA or SWIFT can be used. Also, is blockchain programming only limited to crypto-currency?

To view or add a comment, sign in

More articles by Khang Vu Tien

  • Explanations of the DeepSeek R1 Technical Paper

    (January 2025) The new #AI model #Deepseek R1 has raised a lot of interest… and a lot of BS 🙃. Here is the explanation…

    26 Comments
  • Reading Notes of ElizaOS

    (Jan 2025) 0-Executive Summary This document contains short working notes when studying the AI Agent creation framework…

  • Inclusive Finance – Machu Picchu Project

    Executive Summary Machu Picchu is a project focused on leveraging 21st-century technologies to improve the livelihoods…

    3 Comments
  • How AI can help humanitarian assistance?

    Calculate closeness between profiles of persons in need. Since 2022, AI-powered chatbots have become very popular.

  • What is Artificial Intelligence?

    This is an attempt to explain Artificial Intelligence (commonly called “AI”) in the broad sense. I should point out…

    5 Comments
  • Qu'est-ce que l'Intelligence artificielle ?

    Ceci est une proposition pour appréhender au sens large l'Intelligence artificielle (appelée couramment "IA"). Je…

    3 Comments
  • No code-no maths: Learn Gen AI (2)

    Ever wonder how chatbots work? You know, those virtual assistants always ready to answer your questions? Let's dive in…

    1 Comment
  • No code-no maths: Learn Gen AI

    `Ever wonder how chatbots work? You know, those virtual assistants always ready to answer your questions? With a…

    6 Comments
  • Inclusive Finance – Machu Picchu Self-Help Protocol [2]

    Photo by Manish Patel on Unsplash How can proven technologies of the 21st century help the persons-in-need reproduce…

    3 Comments
  • Inclusive Finance – Machu Picchu Self-Help Protocol [1]

    Photo by Manish Patel on Unsplash Executive Summary How can proven technologies of the 21st century help the…

    2 Comments

Insights from the community

Others also viewed

Explore topics