Blockchains are a way to store data, they are a very specific kind of database. Traditional databases tend to run on one (or more, but let’s keep it simple for clarity’s sake) server with clients wanting to store or read data connecting to it. Blockchains store data in a decentralized way that means that every node in the participating network has all the data locally. When a traditional database server goes down, nobody can access the stored data, decentralized approaches (of which blockchain is just one among many) do not have that problem.

What makes blockchains special is the way they organize data: Data is put into blocks with each block connecting to its predecessor forming the “chain”. The special property that blockchains adapted from an older idea called Merkle Trees is that the connection of the blocks makes the blocks themselves immutable. Here’s how that works.

Say you have a block with 10 names you want to store in a blockchain. After having gathered the data for the block (that does include its metadata like when the block was created for example and the identifier of its predecessor) you “hash” it. Hashing in computer science means to take a text, putting it through a program that creates a new, usually shorter string of text that can be used to check if the text has been changed. See, a hash function always creates the same output given the same text but if you change the text just a tiny bit like adding a whitespace somewhere, the result of the hash function will look completely different. 

An example: The string “tante” hashed with sha256 (which is a well known hash function) is eb4e5ad707b9c63725fdcb1fa645ec5cfdb284884ee3841eef274ed37fcc3c75. The string “tante!” with an added exclamation mark hashes to ead36ca04a4d325c493e3871274efef1c02aa1cfc2f00667e61d560734485a15. Small changes in the text lead to massive changes in the hash so if someone tampered with the contents of the block one could instantly see it and because the results of the hash are so unpredictable it’s almost impossible to find a way around it – if you use a good hash function. Generating a hash is also very fast, so checking a hash for correctness is very easy to do.

Blockchains use those hashes of the blocks to create the connections forming the chain: The newest block links to its predecessor by its hash which in turn links to its predecessor with its hash etc. And because hashing is so cheap, it’s very easy to guarantee that blocks can’t be changed in a blockchain: Because the link to the previous block is the hash, you can’t manipulate the chain. Even if you tried pointing the link to another manipulated block, it would change the hash of the block in hand. This neat trick makes it very hard if not for all intents and purposes impossible to manipulate the contents of a blockchain: When something’s in, it’s in, and you can’t change it. You also probably already know now why you can’t delete data: Removing data would change a block which would have to change the hashes of basically every block after it. This is also the reason why you can never undo a transaction (because that would be changing a block). The only way to reverse a transaction is to have the receiver send the transferred object back.

This is all fine and dandy. Many non-blockchain tools use the same concept (maybe you’ve heard of git which is a tool programmers use to store their code in). What makes blockchains special is that they want to guarantee consistency while being decentralized meaning: Every node in the network (eventually) has the same data, the same blocks. This is a hard problem, especially since in a truly decentralized system without any ruler or admin you don’t have anyone to solve conflicts. So people had to come up with strategies to generate consensus within the network.

Strategies for creating consensus

This consensus problem is where blockchain gets a lot of its problematic reputation from. This is why some blockchains need as much energy as a medium sized country.

So the problem blockchains face is actually quite hard: How do you make sure that you have a consistent data structure when you have neither a referee nor do all nodes know or trust each other? How can you protect the system against manipulation? And very basically: How do you decide who gets to create the next block?

The approach most currently popular blockchains (like Bitcoin or Ethereum) use is called “Proof of Work”: In order to add the next block to the chain, you have to solve a somewhat hard problem whose solution everyone can easily verify. 

In Bitcoin for example, when creating a block you can add some extra text to it, think of it like a “comment”: It doesn’t functionally change the transactions included in the block, but it is used when calculating the hash for the block. That text/comment changes the hash (see above) massively. And gives the chanin enough room to create riddles that are complex enough. 

Say you give people the job to “find a hash that starts with 123”. Even by selecting different sets of transactions or shifting around their sequence you might not be able to match the task, maybe you can’t find a block that creates that kind of hash. The extra “comment” does give you enough wiggle room to try for more different options. People still will have to try a whole lot of times to guess the right text to create a block with that property but it will always be possible. 

After having found a text/comment that created the right kind of hash everyone else can easily see that the solution is correct and everyone can start the race towards creating the next block. If you ever heard about “mining”, that’s what that is: Appending a new block to the chain and getting the attached reward. (In Bitcoin you get a few coins “out of thin air” for mining a block and people who really want their transactions added to blocks quickly can add a bitcoin reward [don’t call it bribe!] as well.)

So Proof of Work is really just guessing words and numbers really quick. Because creating the next block is rewarded in most chains there is a motivation to invest a lot of power into finding it which is why the more a Bitcoin for example is worth, the more energy it makes sense to burn in order to create the next block and get rewarded with coins. 

There are other strategies. The other popular one is called “Proof of Stake” and allows the person who has the most “tokens” (we’ll get to what that is later) to decide what the next block is gonna be and if they abuse that power their tokens might be gone. This one needs less energy but has other problems (for example the inherent power imbalance between those with few and those with many tokens: A person who’s rich will always win in a conflict with a person with fewer tokens).

Traditional databases don’t face that challenge because clients log in and the database server can just – like a referee – decide who gets to have their data written first. The decentralized architecture of blockchains requires building consensus though because otherwise the “chain” would break into unlimited different strands of blocks with nobody knowing whose truth to believe in. If my chain says that I have 1000 Bitcoins and yours says I have zero, we have a problem.

You can store basically any data in blockchains. But most blockchains currently in use store transactions, meaning the movement of tokens or values from one account to another. Let’s talk tokens.

Tokens and NFTs

We know how blockchains work but it’s still unclear what exactly for example a Bitcoin is. Not on a theoretical level, let’s not get into the theories of value and money here but on a technical level. 

Blocks on the Bitcoin blockchain store transactions between accounts. An account is created by generating the secret cryptographic keys for it and starts out with 0 Bitcoin. Through creating a new block or by getting Bitcoins sent your way your account changes its balance. Bitcoins are not “things”, not even “digital things”, but rather an abstraction for the thing the ledger of accounts tracks. You “have” a Bitcoin if your account says you have >1 BC in it. But you could not take it out as an object like you could get cash from your bank. Bitcoins are just a narrative shorthand for talking about numbers moving between accounts.

But not all blockchains have a data model as simple as Bitcoin. Ethereum for example – the other big blockchain people use – has a concept called “Smart Contracts”. The name is kind of misleading because they are not contracts really but just pieces of code that run under certain conditions. These bits of code can do all kinds of stuff, even create new kinds of digital objects.

In a way, the Bitcoin blockchain supports exactly one smart contract, and that is bitcoin and how to send it around. On Ethereum, you can create new contracts and functionality by deploying it into the chain itself. So you could create a new token called “Testcoin” on the Ethereum blockchain that is handled by your smart contract.

Most tokens are what’s called “fungible”: That means that it doesn’t matter which token you have, they are all the same. It also means you can cut them up, send pieces of them somewhere and then “put them together” with other pieces from other tokens. They are basically like traditional money: It doesn’t matter which 10 EUR note you have (unless you used one as a notepad but that’s beyond the point here) and you can take only 0.50 EUR of your 10 EUR and give them away. 

At some point, people figured out that you could create tokens that are different, “non-fungible”.  This means that you cannot just cut them up and that it matters if you have the token with the number 1 or 13. This is most often used to represent either a physical good or something else that’s supposed to be unique: That’s what NFTs are. NFTs are special because they do in a certain way go against an essential truth of the digital: Costless reproducibility. Only one person can have one specific NFT in their account, it cannot be reasonably cloned. You could create a different token with the same content but it would be a different object on a blockchain. The fake would be instantly visible basically.

Otherwise NFTs are like other tokens on a blockchain. They can be moved between accounts and the smart contract governing them can for example enforce that they only move when the required conditions on the blockchain are met: The transfer would only trigger when the payment went through for example.

DAOs

DAOs or “decentralized autonomous organizations” are basically smart contracts with a mission. When we usually think about an organization we think of people with some form of common goal and a set of rules that govern how the organization runs. That usually includes some form of hierarchical power structure or other forms of making common decisions. DAOs try to take the human out of the equation by basically implementing the “code is law” ideology.

A DAO is a smart contract that makes decisions about something based on information and events. A common idea is for example to write code that decides when and where to invest money. People can invest their tokens in the DAO which then makes decisions about those funds according to the code in the contract. But DAOs can basically be implemented for anything you can think of. 

DAOs are relevant because while technologically they are just smart contracts they are a form of organization (which one could consider a form of a social technology) that wasn’t really used in that way before blockchains. 

This was the very basic part about the technology. There’s a lot more detail of course and blockchains with some other properties and claims but for the general idea I think we got you covered. 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Category

nice to know

Tags

, , , , , , ,