Why are smart contracts smart?

Getting a Home Loan Using a Smart Contract

Louwrens
11 min readJul 11, 2023
Photo by Kostiantyn Li on Unsplash

For context, read the 2-minute preface here.

Introduction

To start the series, I thought it would be best to compare a “smart” contract with a “traditional” contract that most people are familiar with a home loan. In this blog, we’ll explore the similarities and differences between taking out a home loan using a smart contract vs a traditional contract. We’ll evaluate these two types of contracts by comparing four aspects: the parties involved, the validity of the contract, the terms and consequences, as well as their enforcement in court. By the end, you’ll be able to decide whether using a smart contract for your next home loan is a good idea.

Throughout the series, we’ll delve deeper into what a “smart” contract is. But for now, let’s define a “traditional” contract as follows:

  • It’s an agreement.
  • It’s written using English words.
  • It’s written on a physical piece of paper.
  • It’s printed out and signed with a pen by all parties involved.

And let’s define a “smart” contract as follows:

  • It’s an agreement.
  • It’s written in a programming language.
  • It’s written on a computer.
  • It’s deployed to a blockchain.
  • It’s signed with a private key by all parties involved.

The world has moved towards signing “traditional” contracts digitally to varying degrees. At the simple end of the spectrum, you can scan your pen-and-paper signature onto a PDF document. At the more complex end, there is software that can digitally sign a document in a way that ensures its authenticity and integrity. To avoid confusion between the latter and how we sign things in smart contracts, we’ll stick to the traditional pen-and-paper model of “traditional” contract signing.

Now, let’s set the scene. Imagine you’re considering buying your first home and need financial assistance. You approach a bank to borrow money for purchasing the house. The contract we’re going to discuss is the loan agreement between you and the bank.

Parties Involved

There are five main parties involved in this contract in the “traditional” setting:

  • First, there is the lawyer from the bank who wrote the contract. Although typically a team of lawyers is involved, we’ll simplify it to one person for clarity.
  • Second, there’s you, the borrower, who wants to buy the house.
  • Third, there’s the bank as an institution providing you with the loan that has reserved funds (liquidity) gathered from other depositors.
  • Fourth, there is a bank representative facilitating the transaction.
  • Lastly, there are one or more witnesses who also need to sign the contract.

In a traditional contract, these parties are “real” people and are recognized by the law as such — even the banking institution. Each party reads the contract and signals its agreement by signing on a piece of paper, usually on a dotted line. Sometimes, initials are required on each page to confirm that they’ve read and agreed to the terms on that page. Certain rules, rituals, and checkpoints are in place to protect all parties involved when entering into a contract. Although I’m not a lawyer and don’t know all the details behind these checks and balances, our legal system has established them over many years to ensure fairness and protect the parties involved.

Here are some key points about this process:

  • All parties involved in the transaction have access to the entire contract before signing.
  • The bank will collateralize the loan using the house being bought to ensure that they can recoup their funds if they can’t pay back the loan anymore.
  • Although borrowers may not understand all the legal terminology, there is trust in the banking institution since other people have taken out home loans with that bank before. The borrower trusts that the contract they are signing is in order. For the average borrower who primarily cares about the interest rate, total monthly repayments, and loan term, the bank provides a service by taking care of the legal aspects.
  • The bank, including the lawyers and representatives, receives compensation from the borrower in fees for facilitating the transaction and ensuring all the necessary rules and rituals are followed.
  • The bank receives an incentive for providing their cash reserves (liquidity) to the borrower in the form of interest paid by the borrower which they pass on (taking a cut) to their depositors who initially invested the capital into the bank.
  • The witnesses usually do not receive payment for adding their signatures as an acknowledgment of the transaction. You might buy your colleague a beer for signing as a witness if you’re nice enough.
  • All parties receive a signed copy of the contract as proof that the transaction has taken place.
  • The language in the contract is usually airtight, but with a good lawyer, you can find so-called loopholes that could let in some air if you try hard enough.

Now let’s paint the picture of the parties and how this plays out when we start to use a smart contract for this loan agreement instead.

  • Instead of the lawyer from the bank who writes the contract, there is now a developer, or team of developers, that codes up the smart contract.
  • There’s still you, the borrower, who wants to buy the house.
  • Instead of using the bank as an institution that provides liquidity, we will replace the institution and its services with a smart contract, in other words, a set of instructions. To make it clearer going forward, we’ll refer to this smart contract as the “smart” bank. Again, we’ll allow depositors to “invest” funds and get enumerated when you borrow their invested funds by the interest you pay to them. Further, the developers of the “banking smart contract” will be enumerated for their effort to maintain, update, and improve the smart bank by fees being paid when interacting with the smart bank.
  • We are able to do away with the bank representative facilitating the transaction as you as the borrower can now directly speak to the smart bank’s reserves and choose the interest rate, currency, loan term, and repayment amounts that suit your needs.
  • As for the witnesses who also need to sign the contract, no need for that when we are on the blockchain as all the miners in the network will verify the transaction took place. So instead of having 2 or 3 witnesses acknowledging that the transaction took place, we now have thousands.

Below, we describe the key points mentioned above when a smart bank is used instead:

  • Not just the parties involved have access to the entire contract before signing, anyone who wishes can read it. In this case, the contract is written in code and not English, but for the average Joe who doesn’t understand the legal jargon in English anyway, this makes no difference.
  • The smart contract won’t be able to collateralize your home, and this is probably the biggest difference between taking out a loan with the bank versus taking it out with a smart contract. For a smart contract, you have to provide your collateral upfront to ensure that the smart bank can pay their depositors’ interest as well as recoup the total amount they are going to lend you if you don’t pay back the principal or the interest. This might feel counterintuitive. Why would you need a loan for $100,000 if you already have more than $100,000 that you need to supply as collateral? Usually, you need to supply 1.5 to 3 times the amount you want to borrow. Well, there are two reasons. First, you might own something other than dollars. If you own Ethereum, Bitcoin, or even an expensive NFT, you might not want to sell those assets or the person you’re buying the house from doesn’t want an NFT of an ape as payment for their house, but rather cold hard cash. In these cases, you’d like to borrow against these assets to get something more liquid and acceptable, such as dollars, to buy your house. Another reason the crypto-rich like to take out loans against their crypto assets is due to capital gains tax. If you bought 1 BTC back in 2014, there is a hefty capital gains tax waiting for you if you convert that 1 BTC into dollars. However, if you use that as collateral for a loan and take out USD, no capital gains are realized, and you can use your capital more efficiently rather than just HODLing.
  • I mentioned borrowers may not understand all the legal or coding terminology. However, similar to the traditional setup, there is trust in successful smart banks since other people have taken out home loans with that smart bank before. The borrower again trusts that the contract they are signing is in order. For the average borrower who primarily cares about the interest rate, total monthly repayments, and loan term, the smart bank team provides a service by taking care of the coding aspects.
  • The smart bank team also receives compensation from the borrower in fees for ensuring the smart contract is coded with best practices and that all the “loopholes” have been addressed.
  • Depositors directly receive an incentive for providing their cash reserves (liquidity) to the borrower in the form of interest paid by the borrower.
  • The witnesses, in this case, do require some form of payment in the form of GAS. We’ll do a deep dive into what GAS is in an upcoming blog, but in essence, this is money you pay to miners to confirm that your transaction with the smart bank is valid.
  • An improvement on the traditional setup is that not just the parties involved in the contract receive a signed copy of the contract as proof that the transaction has taken place. Instead, anyone can view what the loan terms agreed to be. If the “username” of the parties involved isn’t associated with the person’s identity, then everyone can see that the transaction took place, but no one knows who the particular person in real life is. This is referred to as the trustless aspect that blockchains offer. Person A can loan Person B funds without the need for either party to verify who the other is or whether they can trust each other for this particular transaction.
  • Similarly, as in English, with a good lawyer, you can find loopholes. Here with a good hacker, you can find loopholes, but the more tried and tested the contract, the fewer loopholes there are. And for some of the projects like AAVE, which hold upwards of $5 billion at the time of writing, if no hackers have been able to steal the funds with that much incentive on the table, chances are the code is written airtight.

Validity of the Contract

Now, why is this loan contract considered valid? A contract is valid when both parties willingly agree to its terms. In the traditional case, you approach the bank and express your desire to borrow money for a home. The bank evaluates your financial situation, checks your creditworthiness, and if they find you eligible, they offer you a loan with specific terms and conditions using the house you plan to buy as collateral. If you willingly agree to those terms and sign the loan agreement with your signature using a pen, then the contract is considered valid by our age-old legal system which society has come to an agreement (consensus) that these are the rules and laws and if you stray from them, we have judges and courts to resolve any disputes.

As with the traditional system, in smart contract land, your signature represents your consent and agreement on a particular agreement. However, there is no pen, nor your scribble to prove it’s you who signed. Instead, blockchains use what is referred to as public/private key cryptography to verify your signature. This is why blockchains, Bitcoin, Ethereum, and NFTs are often referred to as “crypto”. Why should you and the rest of the world trust the crazy moon math that is cryptography? Well, because there are peer-reviewed mathematical proofs that guarantee that certain axioms will always hold if used in the prescribed way. This is one up on the traditional setting where a person’s signature scribble can easily be replicated or copied. There is one rule though, you have to keep your PRIVATE keys PRIVATE! You’d think this would be obvious from the name, but this is really where the trust comes in that a user is who they say they are, or that you agreed to the terms and conditions. Only a user with a particular private key can sign an agreement on the blockchain in a particular way, and it’s easy (using cryptography) to verify who the signer of a particular message was, without revealing their private key.

Therefore, it’s the magic moon math that is cryptography that gives blockchain transactions and agreements their validity. But as with the traditional system where if somebody fakes your signature scribble they can impersonate you, if somebody takes hold of your private keys, they can also impersonate you and sign agreements on your behalf. There is a saying, “Not your keys, not your crypto.”

Terms and Consequences

The loan agreement includes important details such as the loan amount, interest rate, repayment period, and any additional fees or charges. It also specifies your responsibilities as the borrower, such as making monthly mortgage payments on time and maintaining homeowner’s insurance. The consequences of breaking the contract typically involve financial penalties, damage to your credit, and the bank taking legal action to recover their money by foreclosing on the property. This means they would take possession of the house.

For the smart bank, there is no need for any dirty legal intervention or damage to your credit score. If you default, the smart bank seizes the collateral you put forth. This is the case when it comes to smart contracts, code is law. If the rules and instructions in the smart contract say that all funds will be seized if payment is not made by a specific date, it’s seized. No takes-backsies. NO appealing in the court, no renegotiating the payment terms.

This might seem a bit harsh at first, but this ensures that all actors are held to the same standard in front of the law — something our traditional system doesn’t do very well.

Enforcement in Court

If either party fails to fulfill the obligations outlined in the loan contract, the other party can take legal action.

In the traditional setting, if you default on your mortgage payments, the bank can initiate foreclosure proceedings through the court system to reclaim the property and recover the money. This involves a legal process that can be lengthy and costly for both parties. The court will examine the terms of the contract, review the evidence presented, and make a decision based on the applicable laws and regulations.

On the other hand, in a smart contract scenario, the enforcement is done automatically through the code of the contract itself. If you default on your payments, the smart contract will execute the predefined consequences without the need for court involvement. The terms and conditions are self-executing, and there is no need for intermediaries or third parties to enforce the contract.

While the automatic execution of smart contracts provides efficiency and eliminates the need for legal proceedings, it also means that there is no room for subjective interpretation or negotiation. Once the smart contract is deployed, it operates according to its code, and the outcome is predetermined.

Summary

In summary, using a smart contract for a home loan offers several advantages such as efficiency, transparency, and automatic execution. It eliminates the need for intermediaries, reduces the potential for fraud, and provides a more streamlined process. However, it also comes with its limitations, such as the upfront collateral requirement and the lack of flexibility for renegotiation or appeal.

It’s important to note that the use of smart contracts in the context of home loans is still in its early stages, and there are legal and regulatory considerations that need to be addressed. The technology is evolving, and there will likely be advancements and refinements in the future.

Ultimately, whether using a smart contract for a home loan is a good idea depends on individual preferences, risk tolerance, and familiarity with blockchain technology. It’s essential to weigh the pros and cons and seek professional advice before making any financial decisions.

--

--