Crypto Currencies and NFTs explained

I got asked today what Bitcoins and NFT (Non-Fungible Tokens) are all about. So I thought I’d write something.

Banking on blockchains

Let's start with your bank. Whenever you receive some money (yay!) or pay a bill (boo!) your bank adds a transaction record to a list held in your account records. If I was running the bank, I'd be very worried about someone messing with this transaction list. I wouldn’t want a cunning programmer who works for me giving themselves extra cash, deleting their spending records or fiddling with their transactions.

One way to stop such tampering is to turn a transaction list into a blockchain. Each bank transaction is now stored in a block which is linked to the ones before and after it. Each block contains a cryptographic hash of the block before it in the chain.

What's a cryptographic hash? I hear you ask. It's a way of validating the contents of a block of data. What does that mean? Well, assume that I want to store my name, "Rob Miles", and I want you to be able to prove that the stored name is correct.

I could store my name along with a value that proves the name is correct. A bad way to do this would be to store "Rob Miles" and the number 829. The value 829 is the result of adding the character codes for my name together. The letter R has the value 82, o is 111 and, b is 98 and so on. When you read back the name you calculate the check value from the data and compare it with the stored value. If they are different either the hash or the data are wrong. This validation mechanism is called a checksum and it is used throughout computer networks to detect data corruption caused by transmission noise.

We don't use checksums to validate the data in a block because it is too easy to fool. You could use 829 to prove a name was "Rob Miles", but this value would also work for the name of my strange cousin "Rpa Miles" because character code for p is one greater than o, and the character code for a is one less than b. A cryptographic hash is a transformation created to produce a different value for every unique lump of data that it receives. Of course, this is not really possible. If the hash value is of finite size (say perhaps 10 digits) and the block of data being hashed is very large (say perhaps a megabyte) there must be lots of blocks of data that would generate the same hash, but the chances of this happening are sufficiently small for us not to have to worry about this. A cryptographic hash has one other feature, it is designed to be non-reversible. In other words, it should be very hard to work out the data contents of a block given the hash value.

If a block contains the cryptographic hash of the one before it in the chain it makes it impossible to modify a block without breaking the chain, since the hash value in the following block would now be wrong. It is also impossible to add or remove blocks in the chain because his would also corrupt the hash values.

Block chains are actually a great way to store data. Consider hospital patient records. You could store details of each patient in a huge data structure and then modify the contents of that structure each time something about the patient changes. If they change their name your program would have to find the patient record, modify the name in the record and store the record again, which would be quite hard work. It would be much better to hold each patient record as a blockchain. Rather than change the properties of the patient record you just add another block to the chain that describes the change you have made. The disadvantage is that to get the up-to-date status of a patient you have to scan down the blockchain, but the advantage is that you get a complete history of changes to the record for free, because all changes are stored in the chain.

Manage your own money

So, blockchains provide a great way to store structured data, but what about cash? Lets assume that you want to start your own currency. You don't want to tie it to any particular bank or organisation. Instead, you want the currency to be as open and useable as possible. Well, it turns out that a blockchain can help here.

You create a library of software that allows anyone to use their computer to host and manage account blockchains. Transactions are inherently secure because they are stored as blocks in the chain. The account storage is robust because the blockchains are stored on lots of machines which talk amongst themselves and make sure that all the chain stores are synchronised. The only problem that you have now is persuading people to run your currency server code on their machines. Enter our digital currency.

Up until now humanity has based its currencies on something physical, starting with things like lumps of gold but more recently coins and bank notes. We manage our money using phones and computers but underpinning it is the principle that you can walk into a bank and ask for your cash in physical form to take home and hide under your mattress (don't do this). The bank just holds a number that specifies how much cash you have, not the money itself.

A digital currency replaces the gold or bank notes with the solution to a digital puzzle. This solution must be calculated by a powerful computer and once it has been obtained and verified it can be used in transactions. The process of creating these solutions is called "mining". Around the world (usually where the electricity is cheap) you can find buildings full of computers working on solving these puzzles and adding solutions to the blockchains of their owners. They are literally making money. The mining computers also host the blockchain servers that underpin the currency, recording the movement of the digital cash using blocks in account blockchains.

It's possible for you to start with no digital money, run your computer for a while, generate some currency of your own and start spending it but a quicker way to get started is create an account with a broker who will exchange your digital currency into old-style cash and back. You use a program that acts as your "digital wallet". Once you have signed into the program you can use it to give other people your digital cash or ask your broker to move your money in and out of the digital domain.

No visible supports

The problem with a digital currency is that it is not underpinned by anything. If you look carefully at a British banknote, you will see that written on it is the phrase "I promise to pay the bearer on demand the sum of x pounds", where x is the value of the bank note. In olden times each banknote was backed by gold. You could go into the Bank of England and ask them to exchange your pound notes for lumps of gold from the treasury. We moved off the "gold standard" a long time ago but the principle remains. The UK government stands behind your wallet. The Bank of England works to make sure that the pound has a particular value of itself and in relation to other currencies. It is unlikely that all our pounds will suddenly become worth a lot more or a lot less. It has to be like this otherwise nobody could do any business.

No such safeguards exist for digital currencies. Massive speculation can (and does) cause their value to skyrocket and then plummet. Digital brokers can vanish taking their customer's money with them. If someone finds a bug in the software that implements the currency the whole thing could disappear overnight. Investing in a digital currency is not without risk, to put it mildly.

Bitcoin is the most popular digital currency. It's been going since 2008. You can buy bitcoins, or parts of them and use them to pay for stuff or as an investment. They are never going to replace proper money though. One issue is that the time it takes to complete a transaction (create a block, add it to the blockchain and replicate it over multiple servers) is around 10 minutes. So, by the time you'd managed to pay for your cup of coffee using a bitcoin it would be rather cold.

Another popular digital currency is Ether. This currency is underpinned by an open-source framework called Etherium. Blockchains stored in Etherium can also hold transactions managing Non-Fungible tokens or NFTs. So, what is a non-fungible token?

Non-fungible fun and games

The word fungible means "interchangeable". If I buy a batch of bricks to build a wall all the bricks will be the same size and shape and I can use any one brick in place of any other. My bricks are fungible. If I want to make unique bricks (perhaps for a wall of remembrance) I could carve a different message on each one. Now I can't swap one brick for another without changing the wall. So, a non-fungible token is one that can be proved to be unique.

If you think about it, it would be quite easy to copy a "non-fungible" brick. You'd just have to create a new brick with an identical message on it. However, when the Etherium system creates a non-fungible token it makes sure that the new token is unique within the Etherium universe. The token can then be moved between owners using transactions that are stored in a block chain by the Etherium system. I can purchase a non-fungible token by using a broker to get some Ether funds and use them to buy it. The transaction is stored in an Etherium blockchain and I can use this as proof that I own that non-fungible token.

Owning a non-fungible token sounds like it might be fun, but it gets real when we link the token to something else. One of the problems with the digital universe is that it is very difficult to maintain and manage "ownership" of an asset. You might have created a photograph or piece of music but once you put it into the digital domain it is very hard to stop people taking copies for free. And when you do find someone who has copied your work it is also hard to prove that you're the original owner.

The Etehrium system lets you bind a non-fungible token to a digital asset (which could be a document, a picture, a music track or any other data file). The binding process generates a transaction in a block chain managed by Etherium linking the non-fungible token with the asset. We can then create another transaction that records the purchase of the non-fungible token by the “owner” of the asset. This allows the owner to say "I own this". The digital asset can still be copied, but at least the owner has a a way of proving they have been wronged and claiming some recompense. An owner of a non-fungible token can sell it to someone else, which generates another transaction which is added to a blockchain.

Brave new world

So, at this point we have currency system which operates outside the "normal" banking space and a way of digitally conferring "uniqueness" on things and proving ownership of them - at least within the Etherium system itself. And now human nature can take over. The first thing that happens is that a lot of people pile into the digital currency arena and push up the value of everything. This does not mean that the digital currency has any inherent value, it just means that lots of people think it has. The second thing that happens is that people start assigning non-fungible tokens to anything and everything and an industry springs up generating things that have no value except for the fact that they have unique non-fungible tokens assigned to them. Remember that owning a non-fungible token that represents an item doesn't give you any control over that item, it just means that you can brag about what you’ve got and raises the vague possibility that in a perfect world you might be able to get some royalties or perhaps sell the "ownership" to another person in the future. Someone compared the whole thing to "selling plots of land on the moon" and I can see their point.

And here we are. Apparently, London tube stations are full of adverts offering the chance to join this new revolution. I can see why people might be interested in getting involved. In a world where if you play by the rules, work hard, save and do all the right things you still can't afford to buy the house that you want (even though your parents and grandparents managed to get theirs quite handily) you might feel that you deserve a short-cut of some kind. And perhaps the early adopters will do quite well out of it. But I worry that time has already passed.

It might be fun to buy non-fungible tokens directly from an artists who’s work you really admire, but to be honest I’d rather go down to the Ferens Art Gallery open exhibition and buy something physical to hang on the wall.