Blockchain just did something weird to programming

Blockchain just did something weird to programming

The Etherium project has made a new programming language for smart contracts called Vyper and the way it was designed says something really interesting about the future of programming on blockchains.

Source: https://medium.com/@fabiojose/build-a-smart-contract-to-sell-goods-6cf73609d25

For decades, programming language designers have created countless programming languages in the pursuit of different goals. Programming languages are designed to be fast to run, or easy to learn, or quick to write, or for lots of other reasons. One language can’t do all those things well, so language designers make trade-offs. They may make a language fast but hard to read, or concise but hard to maintain. These goals and trade-offs are well understood and haven’t really changed for decades.

Until now.

Now Vyper has given up a bunch of features in the pursuit of a new goal: to make it hard to lie.

Source: https://medium.com/@fabiojose/build-a-smart-contract-to-sell-goods-6cf73609d25

Vyper is designed for smart contracts which are… well… weird. We all know normal contracts, they’re legal documents that outline the terms of a relationship. They’re written, interpreted and debated by lawyers, judges and the legal system. “Smart” contracts are contracts that are written as computer programs and executed automatically on a blockchain. Smart contracts are a really exciting development and could be the start of a brand new era. Imagine a world without lawyers where the terms of a contract are defined, enforced and run as code. There is no interpretation or debate, just pure abstract unbiased code.

Source: https://medium.com/@fabiojose/build-a-smart-contract-to-sell-goods-6cf73609d25

But here’s the problem: What if a smart contract has a loophole in the code? Or a bug?

Well… you lose all your money and there’s nothing you can do about it.

Without lawyers and courts and judges there’s no debate, no recourse. It doesn’t matter what the program was intended to do, it only matters what the program actually does. The program runs, you lose your money. End of story. This isn’t theoretical, it has already happened. Like the time someone found a bug in an Etherium smart contract and stole $55 million dollars and was nothing happened to them.

What makes this problem really bad is that writing tricky, buggy and misleading code isn’t hard. In fact it’s easy. In fact it’s so easy that inexperienced software developers do it by accident all the time. Writing tricky buggy code is the default. Professional software developers spend most of their lives desperately fighting to write code that’s easy to understand.

Sometimes just for laughs developers will write hard to read code on purpose. Here is a flight simulator written in a way that’s almost impossible for a person to read, and shaped like a plane just for fun.

Source: https://medium.com/@fabiojose/build-a-smart-contract-to-sell-goods-6cf73609d25

So what happens when someone hands you a smart contract shaped like a plane? What if you read the code and are “pretty sure” it’s a plane? How sure do you have to be? Remember, if you’re wrong, or miss a subtle loophole, you lose all your money with no recourse.

Will Vyper make sure that if the code looks like a plane, it is a plane? Can it solve this core issue in smart contracts?

In the end, like everything in the wild weird world of crypto currencies, Vyper and smart contracts leave me with so many mind blowing questions. In 20 years, will lawyers be replaced by programmers for at least some things? If smart contracts replace normal contracts, will lawyers learn to code? Or will we hire specialist programmers to review smart contracts? Will programmer lawyers try to trick each other with loophole filled smart contracts? Or will smart contracts find a new niche and not replace normal contracts at all? Could Vyper be the first loophole proof programming language?

Regardless of what the future holds, I just love it when weird new things happen in technology, and I can’t wait to see what happens.