13 min read

On Programmable Money

Where the internet helped with facilitating information transactions, smart contracts will help facilitate value transactions in the open
On Programmable Money

A question I receive frequently is how a cryptocurrency differs from banking online. It's an excellent question. The concept might be obvious to a web 3 native, but even digital natives struggle to understand why they should care. After all, most of their transactions are already online — they grew up with the internet. They transact using multiplayer video games and social media, work on the internet, and use online banks. Cryptocurrencies may seem irrelevant if they never had to visit a physical bank or write physical checks. By the time they had to pay bills, everything had moved online. My goal with this post is to discuss what programmable money means. I'll start with how it differs from banking online or using services like Venmo. Then, I'll get into the importance of the new paradigm.

But first, here are things I'm not writing about. I'm not trying to convince you that crypto is money. I'm assuming you'd gladly accept a free ether no matter what you think of it. Governments may not acknowledge it, but online economies like Axie Infinity and OpenSea are thriving on it. Neither will I talk about how the dollar or other fiat currencies are becoming toilet paper. I'm not interested in convincing people what is and what isn't money. This post explores what it means when money is programmable.

Language & Contracts

If you've ever tried learning to code, there's a good chance you started by printing "Hello, World." If you haven't tried and are reading this on a web browser, you can Right-click > Inspect > go to the console and paste console.log("Hello, World!"), and hit Enter. Anyone can do it. I was 14 when I wrote my first "Hello, World" program. Like many others, I was skeptical because it seemed like magic, so I changed "World" to "Tolu." I watched as the program spit "Hello, Tolu!" back at me. I immediately learned how to remove the hard work by having the program ask me for my name and making it print "Hello, <name>!" At that point, I was no longer the only one having fun. I could show my brothers and parents without having to teach them how to code. All they had to do was type their name and hit Enter. I had to learn to speak a language that the computer understood, but my parents could use the program without knowing its internal workings.

After my first coding session, something clicked, and I knew immediately that programming was more important than all the gaming, drawing, and whatever else I used a computer for at 14. Programming was magic. But it was magic that I owned and controlled. The language allowed me to create a contract with the computer. A contract the computer had to uphold indefinitely. The only time it changed was when I updated the rules. Many people interact with software and have similar expectations. You expected to end up on my blog when you clicked on the link to this post. If you typed "tolusnotes.com" in the address bar instead, you expected the "t" key to show up as "t" without thinking twice about it. The internet allows its users to speak the same language. My blog is designed in a way that most web browsers can display. Browsers are also designed in a way that most people can use and understand. You may not be a technical person, but you can still find your way around the internet because you expect websites and the underlying protocols to uphold their end of the contract. Programmable money allows us to create similar contracts. But before getting to it, I want to make an important distinction.

The numbers you see in your bank accounts are software variables representing money, but the software itself is not money. When you send money from your Venmo balance to another user, money doesn't change hands. Variables change: your account value reduces, and the recipient's increases. Compare this with giving your friend cash where a piece of paper changes hands. If you rip up and burn that piece of paper, that money is gone forever. Nothing happens if you destroy your phone or delete all Venmo's databases and backups. Refunding their users would be a pain, but the money is safe because it was never within Venmo's software.

With cryptocurrencies, software and the information it represents is money. Transacting in ETH is more like trading physical cash. The money leaves one wallet and moves to another. And like burning cash, ETH can be destroyed or burned. Losing the private keys to a crypto wallet is no different than losing a cash wallet. That money is gone indefinitely till you find it.

Even with that distinction, it may be unclear why crypto is important. Why care if money or variables move as long as the end goal is accomplished? After all, you and your friend accept Venmo's variable changes as money moving — you both speak Venmo's language. There's nothing wrong with Venmo-lang till you have to speak Cash App-lang or any other money language. I'll explain in a bit.

When Code Is Money

You've probably heard that there will only ever be 21 million BTC. This limitation is enforced by code that's shared by a bunch of computers. In this case, everyone agrees that code dictates supply. Imagine hitting File > Save in Word, but the information that gets stored represents something of value. This usually is the case. Otherwise, why save it? A word document may very well contain instructions to a treasure chest, but everyone will second guess it. What if it's a fool's errand? What if it isn't, but the treasure has already been claimed? Because the blockchain is open and decentralized, we don't have to second-guess anymore. There are some edge cases, but this is usually the case.

Things get a lot more interesting with smart contracts. Ethereum-like blockchains have more expressive programming languages. This means that code can do more than dictate a few properties about money. Smart contracts are pieces of code that can be executed automatically and have deterministic outcomes. They are similar to programs on your phone or laptop. The major difference here is that they leverage the blockchain. It allows the same program to run on thousands of computers while leveraging a single source of truth to maintain the same state. Remember the "Hello, <name>!" program? We can write something similar with smart contracts. Anytime someone calls the program hello, we can make it write "Hello, <wallet address>!" to the blockchain. It can be that simple.

Unlike most natural languages, the same piece of code means the exact same thing to most computers worldwide. console.log("Hello, World!") will do the same thing whether it is running on Chrome on a Mac or Firefox on Windows. Its outcome is deterministic. With computing devices, every human being can understand the same language regardless of background. And with smart contracts, we can do the same thing with money.

Smart contracts can hold and control money. They can be wallets. Like Venmo, you can transfer money from your bank into a smart contract. You can withdraw it, spend it, or send it to another wallet or contract. Unlike Venmo, the contract does not need hundreds of employees. Venmo can change its rules at any time, but smart contracts are immutable once deployed. Take Uniswap, for example. The protocol currently generates over $3 million in revenue per day with a fraction of Venmo's team size. Anyone unhappy with the latest Uniswap V3 can remain on V2, go back to V1, or even switch protocols.

It's not an apples-to-apples comparison. Venmo's basic feature, sending and receiving money, doesn't require advanced smart contracts. A better comparison would be sending money from Venmo to Cash App. Things start to break because they are closed systems. Venmo users don't speak Cash App and vice versa. Translating from Venmo-lang to Cash App-lang doesn't make much sense. First, Venmo would rather have the recipient download its app and speak Venmo-lang. But most importantly, translating from one to the other will require them to trust each other with KYC checks, fraud prevention, customer data, and much more. Smart contracts largely remove the need for translators in finance by helping us speak the same language through code.

Programmable Money

I think this is best explained with an example. Think about a will. A straightforward one that states how wealth should be distributed after a woman's death:

  • 50% to charities that feed the hungry
  • 50% split evenly between her children

The number of interpretations humans can derive from this is mind-boggling. What exactly counts as a charity? Do charities feeding hungry animals count? What if one of the children runs one of those charities? It can and usually does get very messy, even with witnesses involved. Data gets lost in translation, and translators are not cheap. The will could be more specific:

  • 25% to specific charity X, 25% to specific charity Y
  • 25% to child A, 25% to child B

This is more explicit, but no one would trust it even if it were written and signed by Hope. People need an unbiased third party to make sure the message hasn't been tampered with. But the third party is usually another human. Recently, people were able to record videos of their wills. It was short-lived, thanks to deepfakes.

What if we took people out of the process and trusted code instead? Before her death, Hope can use her private keys to sign the message onto the blockchain. Provided her keys were kept secret, everyone can agree that the message really is from her. Once written, it's stored forever and can't be tampered with without a significant amount of computing power that's going to cost many multiples of Hope's small fortune. Up until recently, we haven't agreed on a global source of truth. We've had to depend on escrow accounts, brokers, and intermediaries to facilitate many transactions. But if parties agree ahead of time that the blockchain is a tamper-proof source of truth, we can cut out the middleman. Why don't we rewrite them using smart contracts?

  • send 25% of wallet balance to charity X wallet
  • send 25% of wallet balance to charity Y wallet
  • send 25% of wallet balance to child A wallet
  • send 25% of wallet balance to child B wallet

These are specific instructions that should be good enough. But knowing humans, executing it can still lead to multiple outcomes. Smart contracts have deterministic outcomes meaning they can tell us exactly how much should be sent to each wallet. They're also programs, so we really don't need humans to execute them. The contract can facilitate the transaction on its own. When the time comes, the program can distribute the money. But how will it know when Hope passes?

Here's where real life merges with code. The smart contract can't automatically verify that Hope passed away. It needs an external data source to verify that the event happened. Blockchain oracles aim to be the third-party data providers for smart contracts. They are also decentralized, often aggregating data from different sources to form a consensus. In this scenario, multiple oracle nodes can scan off-chain data sources for the woman's death certificate. Once consensus is reached on her time of death, the oracle can inform the smart contract to proceed with the next steps. But that's a more advanced use case. Many deployed smart contracts don't need external data sources. The information available on the blockchain is sufficient for many use cases.

So far, things look normal, but what if Hope doesn't trust her children? She can bake in variables like the cause of death into the smart contract. She can choose to donate 100% to charity if she doesn't die of natural causes. She can have the smart contract burn the whole fortune if she dies of poison because she really loves food, and it would be a shitty way to die. My point is that the possibilities are endless—everything changes when money can be programmed.

Beyond Money

Smart contracts are faster and cheaper alternatives. In our example, the smart contract can distribute the funds within seconds of the death certificate getting uploaded and verified. All this at a fraction of the cost. They are also reusable. Hope may be gone forever, but the smart contract she created will live on. Others can leverage it to distribute their wealth when they die. It'll be as simple as changing the death certificate that'll trigger the event, what wallets should receive the funds, and how much should be sent to each of them. This is very common today in decentralized finance. Contracts are deployed in public, so there isn't a need to keep the code private. For example, when a company raises millions of dollars to create a set of contracts, they usually pay to audit and verify that the code will work as designed and won't easily get hacked. Anyone, regardless of funding, can go to Github and clone their entire code base. They can then deploy it as their own (after replacing every mention of the other company's name and symbol, of course.)

Smart contracts are also composable, meaning newer contracts can leverage existing contracts. Hope's death can set off a chain of events. Her smart contract depends on the oracle for confirmation of her death. Her life insurance payout could also depend on the same oracle. If Hope wanted to control how her life insurance would be distributed, she could include an additional condition where her smart contract waits for the life insurance payout before distributing her savings + insurance payout. This can go on and on. All of it is in the open, and anyone with an internet connection can follow the chain of events as they get executed.

Recap

If software is eating the world, then smart contracts are having a feast. Though it's just getting started, it has upgraded banks, brokerages, and market makers with DeFi. Many technologists expect the labor force to lose jobs to machine learning. That's happening gradually, but smart contracts are here today, and their impact is being felt. I'd compare market capitalization vs. team size, but it's a misleading metric, especially in crypto. First, unlike a traditional company, the entire community contributes to the success of protocols they care about. Things are built in public. It's like having unlimited eyes (both good & bad) on your product as you build. Second, and most importantly, they are not companies. The business structure behind many successful web 3.0 projects are DAOs or Decentralized Autonomous Organizations. Essentially a decentralized cooperative with rules and governance enforced with the help of smart contracts. Some are social, like Friends With Benefits which I'm a member of. Others come together to collectively invest in everything from real estate to NFTs to an entire NBA team.

There are many lenses to view what is going on in the crypto world right now, but I believe viewing it through the language lens simplifies it a lot. Think about how far language has brought our species. It may be impossible to imagine, so think about how far an open language has brought the internet. The internet unleashed an unthinkable wave of creativity and cooperation. Many internet companies we can't live without today are barely in their 20s, yet look how far we've come. All because we were able to communicate with each other and trusted technology to translate for us. Smart contracts are the next logical step. Where the internet helped with facilitating information transactions, smart contracts will help facilitate value transactions in the open. Strangers worldwide can now coordinate their time and capital freely without needing to trust each other or central entities.


Rent Seekers

Things as simple as betting with friends or as complicated as real estate title transfers, which aren't all that bad once you look into it, can be handled by smart contracts without insane service fees. It isn't the solution to every problem, but it is very good at eliminating middlemen. If you're looking to build and need some ideas, go after rent-seekers that provide little to no value.

Hacking & Security

There are downsides when code is money. The main drawback people focus on is security. We can create a set of instructions for money to execute automatically, but there are people interested in making the program execute differently. But I don't think security will be a big issue in the near future. With crypto especially, incentives are clearly aligned. The benefits of building in public far outweigh its drawbacks, and closed loops will not be able to keep up. I'm not suggesting that hacks will end indefinitely. They won't. But humans behave accordingly when incentives are properly placed.

"Smart" Contracts

If you're technical, you'll realize that smart contracts are neither new nor smart. I didn't want to get into its history, but they were proposed by computer scientist and cryptographer Nick Szabo back in 1994. They're also not smart at all. A smartphone is clearly superior to a dumbphone in functionality. But smart contracts don't do much, and that's the beauty of it. What changed is the combination of smart contracts and the blockchain.

CBDCs

Central Bank Digital Currencies will most likely be programmable. If designed properly, they should be interoperable with existing blockchains. I should be able to use my USD CBDC on Ethereum or Solana. But this is just speculation. I have no idea if what the government plans to release will be transparent or not. It's difficult to imagine it getting adopted if it's not as good as or better than existing solutions in terms of stable currencies.

Is It Really Programmable?

At face value, programmable money may have the same velocity as variable money. After all, code is code. However, two essential properties are the intermediaries and the openness of the system.

  • if the intermediaries aren't automated (100% code), it's not programmable money. If the money ends up in a closed system, it's no longer programmable money. For example, USDC moving into a bank account is no longer programmable for obvious reasons.
  • a grey area is when crypto sits in a centralized exchange like Coinbase vs. a wallet that you own the private keys to. That crypto is programmable, but only by Coinbase. You can move it out and do programmable things with it, but not while it's on Coinbase. It's not necessarily a bad thing. The full breadth of possibilities can be overwhelming for most people. CEX, like Coinbase, can simplify access to underlying protocols and remove complexities. In other words, Coinbase-lang is less powerful than DeFi but far better than the alternative.

Weird Tidbit

If you're still reading by now, then WOW. Storytime.
I watched Guns Akimbo a few days ago. In the movie, Daniel Radcliffe was forced to participate in a real-life deathmatch. The chaos was live-streamed to a platform not unlike twitch. Since I was thinking about smart contracts, I imagined that the live-stream viewers could create secondary markets based on the outcome of the match. I could imagine some type of futures market where things like kill-streak and expected death time affected option prices — all powered by smart contracts and oracles. In that dystopia, viewers would be able to profit or lose from options contracts on participants' lives. It felt weird including it in the main post granted my primary example already focused on someone passing away. But the more I thought about it, a Hunger Games x Big Short sounds like a pretty amazing box office move.


If you enjoyed this post, forward it to your friends or post it on social media. Subscribe (email/feedly/rss) | I post stuff on twitter (@tolusnotes)