DLT, Let’s Talk About Smart Contracts.

Michael Francis
Geek Culture
Published in
4 min readMay 22, 2021

--

Photo by Cytonn Photography on Unsplash

All those digital ledger folks talk about this mythical beast known as the smart contract. I assume we all know what a regular contract is? I like to think of a contract as a document between two or more counterparties that describes a fair and equitable exchange of goods and services. A contract may be as simple as the verbal contract I have with my children; if you walk the dogs and empty the dishwasher each day, I will give you an allowance every week. Completely unsolicited, I have to acknowledge Greenlight, which makes this process crazy easy. I can tell you that my children are quick to remind me about the payment side of the deal if I default.

A simple contract between family members is only as enforceable as the trust we put in each other. This enforcement is manageable with my family, but what happens when I need something accomplished by somebody I don’t know or don’t trust. That’s when we draw up a written contract and sign it; we might even have it drawn up by specialists, lawyers and have it witnessed or notarized.

If you have read my prior posts, you’ll notice a lot of the same terms here. We ‘sign’ transactions on a blockchain, and we cant use witnesses to perform the role of a digital notary. At its simplest form, I can place a document on a DLT, I can sign it, the counterparties can sign it, and we now have a contract that is irrefutable. I can prove that I signed it; you can prove that you signed it. Ah, but there is a problem; I don’t know who the person on the other end is. For some contracts, this does not matter. I don’t need to know who you are, but there are many things for which blind trust is not enough.

Let’s say it was a dog walking contract; I agree to pay you five dollars for each time you walk my dog. How do I know you took the dog out? You tell me that you did, but I can’t prove whether you did or not. You ask me for payment etc. We can bring in a third party to adjudicate and perhaps get some evidence in the’ real’ world. It’s also not a lot of money, though I do care about my dog getting walks.

In the digital world, this is where a smart contract comes in. We write a contract that describes the transaction, and we also nominate a third party to be the witness. I send the payment to the smart contract. This payment can be returned to me by the witness, returned to me after some time, or sent to the dog walker. The dog walker notifies the contract that they have walked the dog. Finally, the witness updates the contract to say that they saw the dog walker walk the dog. The payment is released, and the dog walker receives payment. In many circumstances, I don’t even need to know the person’s identity providing the service as long the witness can prove that the service has happened.

I don’t have to stop there, though; we can build a more complicated contract, perhaps one that requires three out of five witnesses to sign for completion of the service. This three out of five is a way of mitigating the risk of a single witness in collaboration with the service provider is out to defraud. Probably not needed for the dog walker example, but handy if the transactions are more valuable.

DLTs like Etherum take these contracts even further in providing a fully programmable smart contract. Bitcoin is programmable through a simple stack-based language, but the validators only trust a limited set of contracts for safety’s sake. Bitcoin is a lot more complex than most believe.

Generally, when people refer to smart contracts, they refer to the Ethereum style of fully programmable smart contracts. It’s important to note that while these contracts give great flexibility, they also add an element of risk; they are only as good as the code. If you are a programmer, you will know what I am getting at.

Smart contracts are a rapidly evolving field with new uses and implementations arriving. It’s an exciting time to be a programmer.

--

--