From Bitcoin to Programmable Blockchains

From Bitcoin to Programmable Blockchains

In my last article, I explained how Bitcoin and blockchain work. After learning that, I thought I had a pretty good high-level understanding of blockchain. But then people started throwing terms at me — smart contracts, gas, gwei, ERC-20, Proof of Stake — and I realized I had no idea what any of these meant.

That’s when I began my learning journey into programmable blockchains.


The Core Concept Remains

At its heart, the concept of a blockchain doesn’t change. A blockchain is still a chain of interlinked blocks. Each block contains a set of transactions, and each block’s header stores a hash of the previous block, creating an immutable chain. I briefly touched on this earlier.

In Bitcoin, transactions are simple:

  • Mary pays Bill 10 BTC.
  • Olivia pays Anthony 5 BTC.

Every transaction just transfers the currency bitcoin from one person to another. This design is powerful but limited, because the transactions can only do one thing: move coins around.


Making Transactions “Smart”

What if we could make transactions more than just transfers? What if they could call functions that execute more complex logic and update state in a distributed system?

This is the idea of a smart contract.

You can think of a smart contract as a decentralized “app.” It exposes functions that users can call, and it maintains internal state.

Imagine a contract called BillCoin.

  • It exposes two functions: checkBalance and transfer.
  • It has a state: the total supply of BillCoin and the balances of every account that has ever owned BillCoin.

If a user wants to check their BillCoin balance, they don’t need to rely on a single bank or central database. They call checkBalance function on this smart contract, and every node in the network can return the result. If they call transfer, the contract updates the balances accordingly.

Unlike Bitcoin, which only tracks one currency, a programmable blockchain like Ethereum supports a whole network of smart contracts running arbitrary functions.


The Ethereum Virtual Machine (EVM)

So how does Ethereum make this work?

Every full node in Ethereum runs the Ethereum Virtual Machine (EVM). The EVM:

  • Stores not only account balances but also the bytecode of every smart contract.
  • Executes functions deterministically so that all nodes get the same result.
  • Maintains the global state of all contracts across the network.

This is one of the most remarkable aspects of Ethereum: every node can execute the same functions of every smart contract, ensuring consistency without central authority.


Paying for Computation: Ether, Gas, and Gwei

Running smart contracts isn’t free. Validators (the nodes that process and validate transactions) need to be compensated.

That’s where Ethereum’s native currency, Ether (ETH), comes in.

  • Every transaction requires gas, a unit that measures computational work.
  • Gas is priced in gwei, where 1 gwei = 0.000000001 ETH.
  • When you send a transaction, you pay gasUsed × gasPrice.
  • This prevents spam, ensures validators are rewarded, and creates a market for block space.


Immutability and the Merkle Patricia Trie

Bitcoin uses a Merkle tree to structure transactions. Ethereum extends this idea with the Merkle Patricia Trie (MPT) to store account balances, contract storage, and code.

Here’s how it works:

  • Each account in Ethereum (whether user or contract) has an address (a 20-byte hex string).
  • Each contract’s storage is broken down into keys (also hex).
  • The MPT organizes these keys into a tree of nibbles (4-bit hex digits).

For example, imagine Bill’s BillCoin balance is stored under a key like:

0xABCD1234...

In the trie, this address is broken into nibbles (A → B → C → D → 1 → 2 → 3 → 4…) until reaching the leaf node, which stores the balance value.

If Bill’s balance changes:

  • The leaf node hash changes.
  • That change cascades upward, altering the parent hashes.
  • Eventually, the root of the trie (called the storageRoot) changes.
  • The storageRoot is recorded in the block header, so everyone immediately knows the state has changed.

The trie uses three types of nodes:

  1. Leaf nodes → store actual values.
  2. Extension nodes → compress paths where only one branch exists.
  3. Branch nodes → split into multiple paths (0–F).

This design allows Ethereum to provide cryptographic proofs of account balances and contract storage, just like Bitcoin does for transactions.


Proof of Stake: Ethereum’s Consensus

Ethereum originally used Proof of Work (like Bitcoin), but since the Merge in 2022, it now runs on Proof of Stake (PoS).

Here’s how it works:

  1. Validators stake ETH as collateral.
  2. Every 12 seconds, one validator is chosen at random to propose a new block.
  3. Other validators attest (vote) on whether the block is valid.
  4. If a block gets enough attestations, it’s added to the chain.
  5. Validators earn rewards for proposing and attesting honestly. If they cheat or go offline, part of their stake is slashed.

This system is more energy-efficient than Proof of Work and still keeps the network secure through economic incentives.


Beyond Bitcoin

Bitcoin was the first generation: digital money with decentralization and immutability. Ethereum and programmable blockchains are the second generation: they turn blockchains into decentralized computers that can run any logic.

Studying Bitcoin gives a foundation. Studying Ethereum shows how that foundation can support a new digital economy.


Link to the article: https://billsbyte.substack.com/p/from-bitcoin-to-programmable-blockchains

A valuable piece showing how programmable blockchains extend the vision from Bitcoin to Ethereum — from smart contracts to PoS and the EVM.

To view or add a comment, sign in

More articles by Bill Chan

Others also viewed

Explore content categories