# How Tezos Self-Amendment Works

**URL:** https://forum.tezosagora.org/t/how-tezos-self-amendment-works/5401
**Category:** Research and Development
**Created:** [May 10, 2023, 12:22pm UTC](https://forum.tezosagora.org/t/how-tezos-self-amendment-works/5401 "2023-05-10T12:22:31Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Marigold](https://forum.tezosagora.org/user_avatar/forum.tezosagora.org/marigold/32/1009_2.png) [@Marigold](https://forum.tezosagora.org/u/Marigold)
#### Post date: [May 10, 2023, 12:22pm UTC](https://forum.tezosagora.org/t/how-tezos-self-amendment-works/5401/1 "2023-05-10T12:22:31Z")

</div>

By [Lin Oshitani](https://www.marigold.dev/team#core-development)‍

> While the irony of preventing the fragmentation of cryptocurrencies by releasing a new one does not escape us, **Tezos truly aims to be the last cryptocurrency**.

— L.M Goodman, Tezos: A Self-Amending Crypto-Ledger Position Paper

## Why Self-Amending Blockchains?

Blockchains have a problem — It is hard to implement major upgrades. Fundamental changes are possible through socially coordinated hard forks, but this method has several issues:

- There is a technical risk of a temporary network split due to incompatible nodes running in the network.
- There is a social and economic risk of a permanent network split due to the lack of a formal process for resolving disagreements.
- It is unclear who has the final say. The core devs? The stakeholders? Or people with the loudest voice?

This difficulty in updating blockchains hinders their ability to integrate innovations, leading to technical stagnation. What we need is a chain that can seamlessly evolve while minimizing technical and social risks.

And from this need, Tezos, the _self-amending blockchain_, emerged.

## What are Blockchains?

What are “self-amending blockchains”? To understand what they are, we must first take a step back and revisit what blockchains are in abstract terms.

### The Apply Function

At the core, blockchains consist of a state, blocks, and an apply function:

 ![](https://forum.tezosagora.org/uploads/default/original/2X/2/2080141be50039f3a5a5c680dbc744dcfce37839.png)

The _state_ (the yellow table on the left) contains information such as “Alice has 9XTZ and Bob has 1XTZ”. There are also _operations_ like `Transfer (Alice, Bob, 1)`, which means “Alice sends 1XTZ to Bob”. Furthermore, we have _blocks_, a collection of such operations (the blue box in the middle).

Now, by applying the state to the block with `apply (state, block)`, a new state `state'` is created (the yellow table on the right). In the new state, the operations in the block get executed, hence the balance of `Alice` is decreased by one and the balance of `Bob` is increased by one.

### Chain of applies

Now where does the “chain” in “blockchain” come from? It comes from the fact that we apply `apply(state, block)` successively and form a “chain” of blocks and states, as displayed below:

 ![](https://forum.tezosagora.org/uploads/default/original/2X/c/ccc3c30255721afae3ae30e4ed22ea7ad2937c9b.png)

### The Score Function

Is the `apply` function sufficient to define a blockchain? The answer is no, as it doesn’t address how to handle branching. Because blockchains are distributed, two blocks can be created simultaneously at different parts of the network, leading to a branch in the chain:

 ![](https://forum.tezosagora.org/uploads/default/original/2X/2/261139565bcfe6a681c43c445d281baf68a1dac3.png)

In the diagram above, blocks `block a` and `block m` are generated around the same time. Some parts of the network extend blocks after `block a` (up to `block b`), while others extend blocks after `block m` (up to `block n`). To resolve the branching, the network needs to agree on which branch is the _canonical_ branch to build upon.

If you want to read the full blog post, please visit Marigold website 👉 [How Tezos Self-Amendment Works](https://www.marigold.dev/post/how-tezos-self-amendment-works)
