Episode 37

Smart Contracts

Watch on YouTube

About this episode

In this episode, Alec and Jack delve into the evolution, functionality, and future potential of smart contracts within the Web3 ecosystem.

We begin by tracing the history of contractual agreements from ancient times to the digital age, highlighting the shift towards automation and decentralization. The discussion progresses through the technical underpinnings of smart contracts, emphasizing their role in automating agreements in a trustless environment.

Key applications across industries such as finance, supply chain, and entertainment are explored, showcasing the transformative impact of smart contracts.

The episode wraps up with a look towards the future, considering the integration of AI and IoT with smart contracts, underscoring the balance needed between automation and the nuanced complexities of legal agreements.

Transcript

Auto-generated from the episode audio.

so I've seen that some of the estimates for smart contracts and what they could save to the supply chain industry generally every year is around 500 billion to one trillion I think one of the most well-known projects was the Walmart project where they had lots of disputes around delivery and Providence of good and the average time it took was seven days to prove Providence of a product and just by using distributed Ledger technology and smart contracts in this it went down to 2.2 seconds which is quite an immediate impact for quite a big company welcome to another episode of the untangling web 3 podcast I'm joined today by Jack Davis as I'm always joined how are you doing today Jack I never had such a special intro before thanks Al yeah getting nervous yeah I thought maybe with there's a special guest coming in that I wasn't expecting but no it's just us today yeah no doing well pretty into the swing of things of the new year now at the time of recording you

everyone's talking about this ETF as always it potentially is being going to be approved while we're recording this so let's let's find out later but yeah pretty good how are you yeah not too bad it seems like all anyone is talking about right now is the ETF I'm kind of just hoping that it's going to pass soon and we can move back to the things apart from ETF but you are right and speaking of other things that aren't the Bitcoin ETF today we'll be talking about smart contracts Jack how do you feel about smart contracts I feel like it's a term that is used way too much and bandied around and I think there's a debate over how smart they really are but it's no getting away from the fact that it is a fundamental component of web three right a lot of a lot of defi a lot of apps in web 3 run off them so it's worth us taking the time to break them down explain exactly what they are I think

yeah you're right I mean it's a shock that you're being a Negative Nancy about this but I actually completely agree with you like contracts are boring right a contract is an agreement between two parties where they promise to do something and when we're talking about smart contracts it's just how can we automate that in a way and I think a lot of people miss that they think it's more intelligent than it actually is and it's effectively just automated execution of code and the code equals a contract but maybe we're getting a bit ahead of ourselves and should we go to the start of all things contracts yeah why not we just said they're boring so why don't we spend the first few minutes of the episode talking about them in great detail exactly so let's go back to where everything always starts it's always ancient times Mesopotamia 3000 BC really exciting stuff I think one of the earliest texts that we ever recorded was code of hamurabi and this was effectively one of the first

contracts it was rules for commercial interactions and Provisions for contracts and their regulation classic capitalism started nice and early and one of the interesting facts around this was that they were actually written on tablets and the beautiful thing about this was they were sealed and this was meant to provide a tamperproof record of the contract so you write the contract and if someone disputes it a thousand years down the line or something like that you crack open the seal and say well these are the terms don't know how usable that is but it's quite interesting to see that they were using the term tamper proof back in those days that's interesting you know we've always had the same problems right there's different ways of solving them we've got slightly more advanced solutions to the Tampa proof problem now with blockchain but yeah so the contracts have been around we talked about the Bara system and whether or not it really exists but this idea of you needing to mediate exchange right and not just change

exchanging items for items but having ways of encoding and and writing down different types of value exchange right and that's where contracts come in their ways of defining the obligations on both parties and they've been around for so long ancient Rome as well developed brought them even further forward cefin them bringing in this idea of having sets of rules and sets of contracts that can apply in various different areas so it goes back a very long way and it's something I think we're all still familiar with right even through its development through things like the modern age in the 17th 18th century you have the Industrial Revolution for example you have that demand coming in for you have new Industries happening you need to codify more complex interactions you need to standardize legally binding contracts because one of the issues with contracts is if one party doesn't hold up their obligations what do you do and effectively through throughout the centuries we've had this evolution of the legal system alongside the evolution of contracts to

allow you to have basically a means of recourse when things go wrong yeah you know that classic meme how many times a day does someone think about Rome Jax is every hour of every day always but yeah I think one of the most interesting things about the evolution of contracts when you were talking about the 17th and 18th century was a shift towards more standardized and like legally binding contracts that anyone could use and this was really to do with like complexity of industrialized ation and a globalized interconnected economy they had things like corporations there was no longer people making contracts with people it was entities like legal entities making contracts with other entities and they could you know enter contracts own properties be liable for things and they weren't really people they were just entities that people invested into and that was is quite interesting and I think that's particularly related to how we view Dows now and like the stepping stone of you know people making contracts with people and then entities making

contracts with entities kind of similar to maybe one of the steps of dows making contracts with Dows all the participants in Dows and how we think okay how does this work who's accountable but really there are mechanisms that exist today that should apply to Dows and Dows aren't really anything special yeah I think so we've come to the Modern Age effectively everything's been paper based up until this contracts are physical obviously in paper on paper up until the end of the 20th century effectively I think it's good to take a step back at this AG before we move into the digital age to really Define what is a contract in quite simple terms yeah exactly it's something that makes sense intuitively to us right what is a contract it's something you you maybe will sign when you are employed an employment contract you might have a contract for a loan or something we've all seen them but they all share kind of common features right so typically a kind of raw contract so the raw

form what is actually the content of it you have the terms of the contract so that essentially is the details of what each party is obliged to do and that's clearly stated so what are the obligations on party involved in a value exchange essentially that's the core second part what is the exchange of value what is being exchanged is it Goods Services money which what is each party promising the other and that can obviously vary in different cases but that's the through line through basically virtually all contracts you know to oversimplify at the risk of angering any kind of contract law professionals you know in the audience that is a simple thing right you have the terms of the contract and then you have what is being exchanged and both parties then upholding to those those rules and that exchange of value yeah I mean this is a massive oversimplification when we're looking into this there was like 10 different items and I was like godamn this is way too complicated let's really take it

back to make it relevant and understandable for smart contracts so yeah you're right the contract itself whereas most people can think of it the document it has terms in it and some kind of exchange of value def based on those terms and then the next bit if we categorize and kind of group things together is the signing and consent you have this physical document on paper that says someone needs to do something if something happens and then I have to sent to it it could be both parties multiple parties and this is effectively me applying my identity in some way and consent to the terms that are in the document and there's some boring things around you know the person that signs it must be free and sound of mind to do so but there are the three really high level things that we want to Define in a contract and the signatures of a contract it's the terms The Exchange and the signatures or the consent that actually to those terms in the exchange

of value and then now we can come to the digital age right so obviously contracts move from paper based to the digital age for obvious reasons convenience efficiencies and all these kind of things and at first digital contracts were exact replicas of the physical contracts the terms were written out in you know word for example signatures were still just little squigglies like little images that you could make on your pad and it would just be JPEG that you put onto the digital file but then they got so so much smarter and where it gets really interesting yeah exactly it takes time for technology to properly affect different Industries right and yeah most of us who've interacted with a contract digitally will have been probably via PDF right and you're signing it doing a little squiggly with your mouse it's impossible to do but you know it's kind of just mimicking what we have in the physical world with paper based contracts and now what we've seen over the kind of last 20 years or so

maybe slightly longer is actually integrating the more robust Technologies into securing these contracts better ways for signing them right so we talk about digital signatures a lot that's a core component of what digital contracts are in the Modern Age okay so we use digital signatures we use these cryptographic foundations that we've had working for kind of 40 50 years now we trust them and they're being used ever more in our daily lives to secure these contracts so let's give an example here so Jack's talking about digital signatures and we haven't really Define them properly but we can talk about them at a high level if we like think about the issues we have with say physical contracts and digital contracts in the way I just explained it so imagine you know I send Jack a contract say I'm paying him $1 millionar for his autograph as Jack would really like to do in the future he signs it and then sends it back to me so now I know what his signature looks like this

little visual squiggly effectively I could just use that signature for any contract I could even change our original contract to say that Jack owes me a million dollars like for anyone that's had to have their parents sign homework for parents evening all this kind of stuff it's so easy to just forge your mom's signature and just change it to anything and this is one of the big issues that we had before digital signature technology was actually used for digital contracts yeah that's why I'll never sign a contract with you I like I'm I don't trust you but yeah one thing I found interesting is my first ever memory of signing something was I think it was my library card when I was kind of eight or nine years old yeah yeah what else would it be and the interesting thing was I remember writing my signature for the first time terrible as it was and thinking you know how is this how is this safe can't this be reused right and this problem you're talking

about is what we call like replayability basically that's the kind of the I wasn't thinking about it in those terms when I was eight or nine but now much older you can see what these things actually are right this is a known problem because you can take that signature you can once you've seen it you can reproduce it very easily on a different document you can transfer that signature to another document and The Binding from between the actual signature that's on a given document is is quite it's quite loose right it doesn't bind to your identity very well that's where the digital signatures improve on this so much not only are they bound to documents but you know we say they depend on the document right so one signature will apply to one document that same signature can't just be lifted and put on another document that's part of the the cryptography guarantees that are baked in but you can then also link the keys used to sign these documents to a real world identity

which is Again part of the power of this you can prove very easily the signature belongs or is associated with a given person in the digital world I'm just still stuck on the idea of you being like 10 years old in a library having an existential crisis being like they could use this signature for anything what about my bank accounts and my investment and all this kind your character Arc is so obvious you are so obviously going to go into the world of web 3 having a breakdown at 10 years old in the library but yeah so we don't want to go too deep into digital signatures we're going to have an entire episode but I think it'll probably detract too much from the idea and concept of smart contracts generally so what Jack just described is effectively digital signatures are mathematical computations in a way and they kind of go beyond the visual squigglies that we were used to before that and added all the benefits that Jack said so to keep it simple

digital signatures apply to say contracts like we just talked about them they will prevent changes so if anyone tries to change the contract after it's been signed with a digital signature the signature won't work anymore so this shows that the contract was altered or that it's actually not been altered that's quite a powerful thing and then the second main benefit we get from this is it stops signature theft so each digital signature is unique and can't be copied to another document so it's like a lock that only fits one key and that keeps the signature safe from being used or stolen as Jack just mentioned and that's really powerful it really starts to apply like strong identity characteristics and strong proof ability to say if I've got a key that's linked to Jack's identity and a signature that only he can generate for this document then he has to have signed it assuming that the key didn't get misplaced or something like that so that is digital contracts right we're kind of up to scratch

and that's where we're at in the Modern Age effectively yeah and was one other point I mentioned there right is that why these signatures are so powerful digital signatures now is that they also have more legal weight than they did previously as well right so more recently they have been given equal legal status to physical signatures I mean arguably physical signatures maybe should go down a peg in the UK they a digital signature or electronic signature has the same way as a written one as the eign act in America so yeah it's just worth mentioning that from a legal perspective when we talk about contracts giving you legal means of recourse when something goes wrong the digital signatures now they help enforce that so yeah we're now in this world of modern digital contracts we've gone from clay to paper to digital to let's say modern or cryptographic digital contracts which is much more powerful and then you hit the early 90s and we start getting this new term come about which is smart contracts

right so where did that come from my understand standing is there was this very intelligent fell called Nick Zabo from who originated the concept of smart contracts in 1994 so he was a computer scientist a cryptographer and he was effectively doing research into digital contracts and digital currencies and I think he first coined the term smart contract which is so misused as me and Jack said earlier in the show um in 1994 and effectively his vision was quite simple it was around the idea of automated systems that could EX Ute the terms of any contract so you're effectively codifying smart contract terminology into hardware and software that could be executed and I really like the analogy that they use they compare like a smart contract to a vending machine just as a vending machine automatically enforces the sale I put my money in I know what I expect it's transparent and then the kind of the smart contract as the vending machine is executed when I put my money in to give to dispense the

crisps or the chocolate whatever I'm mean meeting that's effectively what he wanted to do was to use Smart contracts to automatically enforce the terms that are encoded into some software piece yeah and you know when Nick zaro started talking about smart contracts it was very Visionary thinking right and it kind of had a few different components so it had the cryptographic elements that we talked about having digital signatures it had this idea of automation at the heart of it as you said so being able to automatically execute contracts instead of having to kind of do manual physical processes and also that he this idea of using a distributed Network to enforce them as well and how they get executed which is really interesting and lots of this I don't want to say inspired Bitcoin but you can definitely see similarities between what was in these thinkings from Zabo in in the early 90s and what we eventually end up with with Bitcoin and I'll just say one reason you don't love the word smart contract

is because in the 1990s that term was used to describe the objects in the Stanford Digital Library project right they look very different to what we mean in the modern world we have three smart contracts but you know it's interesting that that term has been around for a very long time right I say so just to bring it back to what we were talking about earlier when we said a contract has three important pieces at a high level the terms the signature and the exchange of value we've talked about how digital signature technology has kind of reinforced the terms and made them difficult to change or tamperproof in a way we've talked about how this that is done by enforcing digital signature technology and this whole idea of smart contracts is effectively improving the exchange of value concept So it's talking about how the exchange of value can be automated based on some terms and also what Jack mentioned there is zambo was thinking about how these contracts could be hosted in a distributed Ledger

and that also makes the terms more transparent more visible two parties are transacting or over a contract is very easy to prove that both parties had the same terms if it's hosted in a distributed Ledger for example yeah and zaro was looking at this from this perspective of money really right he was very interested in digital Cash System so the contracts he was looking at were really payment contracts you know terms and conditions for paying people in a distributed way and he came up with the ideas for bit gold as well in the similar time so he was thinking about this from a digital cash digital money type scenario and that's what led things forward there's another type of contract I'm not going to go into the detail called ricardian contracts I'm just going to name drop it in there because there's an kind of alternative but similar thinking that was happening in parallel so you know maybe we'll pick up on that another episode yeah ricardian contracts going to get big of yeah if

you want to see episode on ricardian contracts just send us an email but yeah so following on from Nick zaro's early early writings and some of the projects that were worked on then you don't have too much happening until the Advent of Bitcoin right and I said you know there are similarities in Bitcoin that's the first time we really saw all these ideas of cryptography automation distributed execution across a network for payments and for these kind of smart programs okay we call it like programmatic money sometimes so you see number of years weight and then Bitcoin comes out 2008 and 2009 that popularizes blockchain and blockchain fast becomes you know people see it very much then as the platform upon which we can have Smart contracts it's the way and the infrastructure for implementing these ideas that were first thought about of 15 20 years ago then you come to 2015 with ethereum and that really takes off as the de facto smart contract platform right so all the way from 1990s to the present

day ethereum was the point really that marked the widespread use and you becoming a household name effectively of smart contracts it became a smart contract platform where you could deploy them on the blockchain they kind of Liv as their own entities right it's funny that you say uh contracts over time have developed from representing individuals to corporations as entities now smart contracts have a take on a life of their own right and we'll kind of get into the details of how they work in a minute but really that you can think of them as like first class citizens in the web three World okay so just to take it back to what a smart contract is like me and Jack were saying it's effectively a self-executing contract right with the terms of the agreement between the parties written in code okay and it is hosted in a distributed ideally hosted a distributed blockchain Network as Jack just mentioned so let's just give an example just to explain how this would work so the first stage

would be to set up a contract so I can program a smart contract that says this car can be used for three days for 00 okay and then there's some payment elements if Jack sees the smart contract he pays to the smart contract 00 in digital currency for example which the smart contract holds in escrow on behalf of the two parties which is another benefit of this then the contract says okay well the condition's been met so he's transferred 100 to me that's the terms once the payments confirmed the smart contract will then automatically unlock the car for Jack's use and then the smart contract will end the contract after three days and the car will be automatically locked ending the rental agreement fairly simple example but I think it kind of highlights why we would want to use this yeah and the key point there is that all these different rules well again there there are some more complex examples that are harder but most rules that you can think of in a contract

can be translated into one of these machine executable uh versions right something in that works in a smart contract that can be executed and verified by a node in a blockchain network right so yeah it's interesting how much of this can be ported over it's not to say that all you need is a smart contract and we'll kind of get on to the legal regulatory side of this later but you get some distinct benefits of this way of doing things right first and foremost you do get this automated execution that we talk about so your smart contract is effectively living on let's say the ethereum network right it lives on the ethereum blockchain it just sits up there until you want to do something with that contract whatever it might be this could be your insurance contract and then one day you say I want to make a claim on that insurance and then I'm going to interact with the contract all that gets done in an automated way in the ethereum network I interact

with it and then that gets done in a distributed way and it's not just one entity you're relying on as a central point of failure you have this whole network of potential validators for your action so you have that kind of redundancy that Improvement yeah it's also the security the fact that there's multiple nodes hosting it so it's unlikely that the smart contracts ever going to go down which obviously if we have a paper based document it's on one of us to store and hold that forever like another benefit is obviously well this is a theorized benefit is be the lower costs but obviously we know smart contracts right now and a lot of implementations probably aren't more cost effective than it would be to go to a lawyer and start paying things that's another potential benefit of automation always we have the accuracy and transparency that's particularly important when you know you're interacting with more than one party effectively to say okay this is a defined way to provably say we both have the

exact same terms because there's only one version of the smart contract and that's hosted in this distributed Network so that's another big benefit because you have loads of legal disputes around okay the terms that I signed off on weren't the terms that we agreed originally and this is a very nice way of proving that okay the terms had to be the same at this point and obviously we have all the benefits around efficiency as well so lots and lots of theorized benefits around smart contracts yeah that's an interesting one the accuracy one right because that's that's probably more specific to digital contracts in general and we just also get it in the web 3 smart Contracting world one benefit that is I would say probably exclusive to web 3 and blockchain based or blockchain hosted smart contracts is as you said earlier they are intrinsically linked to money in a sense right because you already have these tokens and a tokenized world on ethereum or on whatever smart contract blockchain you're using so you can

just link the payment directly to the execution it's not like in the existing world where you have the contract as one document and that might Define a payment and then you have to go on a payment provider to do the payment you can actually put them into one which is again where those some of those theorized efficiency gains come from I think yeah so I think when we're kind of moving towards um the idea of smart contracts versus normal digital contracts there's kind of three new elements that I think we have to discuss one is the blockchain technology so you know the platform the execution how things are hosted reliably the other one is a programming language and that's quite dependent on the blockchain technology that you're actually using so how the terms are actually written and codified how the contract is actually converted into programming language effectively and then there's things around execution and triggers what actually causes this contract to execute talked about terms but how does that data get in to define

the terms like a blockchain in itself isn't always useful not everything's around payment to payment right you also want data saying okay in that instance I want to unlock a car or and some time has elapsed since that car was unlocked based on the funds and then we started to get into the realm of like oracles transfers funds all this kind of stuff like Jack mentioned 2008 that was probably the popularized example of distributed Ledger or blockchain technology sorry and this was ideal for executing and recording the smart contra contracts in a secure and transparent way and one of the Beautiful Things was they had native tokens as Jack just highlighted to actually exchange value within the smart contracts and I think there's a bit of a misunderstanding here around Bitcoin right I think most people think okay well you actually can't do smart contracts in Bitcoin there's no programmability but that's not necessarily true is it Jack no this is a really interesting topic I was gonna ask you know what what is your

opinion right because in my world Bitcoin very much does have Smart contracts in the way we've defined them okay you can create conditional payments you can set up all these kind of complex multi-party payments and conditional things there's so much you can do with the expressiveness of Bitcoin script and script is that programming language that comes in Bitcoin natively there's lots you can do with it just as is okay the problem that people had with considering this like smart contracts is that it's not as expressive as it could be so the language in and of itself isn't what we call cheering complete okay I'm not going to geek out too much it just means you can't do all the most complex things without in a very easy way okay there are ways to get around this and one of the reasons I think people don't consider Bitcoin as a smart contract platform is that there were changes made a little while ago a number of years ago to kind of limit some of the functionalities

you could do in script that actually made it even less expressive than it was when it was uh you know published coob was published in 2009 so it was kind of limited in that way but we've seen other chains actually reenable a lot of these capabilities and you can do extremely expressive things with just Bitcoin as it is so it's it's interesting in my opinion they do what do you think I think like the way that I described it before is um that bitcoin's smart contract language or programming language is similar to like assembly code really it's like fairly basic you can do almost anything on it but it takes a lot of effort but the beauty is it's very robust and very well understood and once you've got something dialed it works very effectively and you know exactly how it will work right but not many people want to C program in assembly code whereas ethereum and solidity is much more like python easy to pick up easy to do very fast to deployment

right right but the problem is you don't know exactly how things are going to work in the background and this is why you have all the potential hacks because there's so many people building on solidity that don't exactly know how the functions are being deployed properly and it's a bit more complicated because it's so easy to pick up so that's how I would describe the two and I think yeah the misunderstanding is probably around how easy it is to take and Implement with and there been not many there's not many projects right building smart contracts on bitcoin right now and that's probably the major consideration yeah definitely and that's I'm really glad you mentioned solidity right because that is one of the big why ethereum is considered you smart contract platform is that you had solidity which is a what we call a highlevel programming language that actually allows you to write things as if it was you know a bit more like JavaScript the most popular language in the world I think unless it's

python now but it's it's in the top two at least so you can write things in a very normal way in a way that you're used to and write these conditions for your smart contracts and it's very easy to do and Bitcoin really never had one of these high level languages developed for it because solidity was not bed into ethereum it was built on top as a developer tool essentially but it did it fast and it got a lot of adoption whereas Bitcoin never had that actually at the base layer uh ethereum is also very similar to Bitcoin in the scripting sense right is similarly like an assembly type language the difference is it has this really impressive thing called the evm the ethereum virtual machine and that's one one thing that Bitcoin doesn't have in in in the same way so the evm is essentially that's like the computer on a given node that's the computer that runs the program so once you've written a program in solidity the evm is the thing that's

going to say does this program work right given some inputs will it give you the right outputs and in ethereum the evm allows you to do more effectively and more easily than you can do in Bitcoin so there's kind of two different sides to the coin but um yeah it's very much an ethereum dominated landscape in smart contracts they right yeah and I think we've talked about you know some of the deployments in a previous episode and some of the issues that Dow hacking 20 2016 which is effectively people not necessarily understanding how they were programming smart contracts on ethereum and that led to someone being able to siphon off $50 million on the side without anyone being able to do anything and that caused the fork that we spoke about previously and I think you know there's a whole host of developer tools developer support on ethereum right now I mean just to name a few in fura truffle and I think one of the interesting things is isn't a fur don't like 50%

of all Network transactions on ethereum or something like this come through in fura and there's this whole argument around Decay if ethereum really is decentralized if one operator goes down one service provider which is in fura 50% of the network disappears like is that really decentralized yeah I feel like the number is actually much higher I don't know off top of my head but my gut feeling is is very high right that's what everyone tends to use to write their Spar contracts and another thing that ethereum has is they've done a very good job of standardizing smart contracts right and different templates like boiler plate code so if you want to go and make a fungible token you have erc20 that's a standard you can just go and copy and paste the code change some things and boom you've got a token in 10 minutes if you want it it's unbelievable and all the other services then INF fural like that can help you deploy it but actually you know what the smart contracts are

themselves is very intuitive you can go and do a non-f funable token very easy erc721 you've even got things like soulbound tokens recently or things like nontransferable tokens um that can be used to represent digital identity and you can go from that kind of the simpler token systems to much much more expressive things like automated market makers as we talked about in the defi episode all of Unis swap is being run from a smart contract or a collection of smart contracts right all everything that happens is based on Smart contract code which is mindboggling right given how much it's used the the money deposited the daily volume of the Unis swap it's unbelievable I think an like that point is really important around the token standardization like when you have a thousand different companies all building a thousand different types of token Jack has his cryp crypto Kitty or whatever it is I have my digital identity like you want interoperability we don't want the two tokens that we have from two separate companies and

then no ability to exchange and do you know similar overlapping Services between them so these standards are really important so that users can move between companies tokens can move between companies you can start to amalgamate different tokens together and it's something that ethereum has done very well with these emerging standards and it makes it so much more usable intuitive for the users as well yeah exactly and we've talked about a lot of the pros there right of why these things are good why smart contracts are good there are some downsides is probably worth mentioning as well so because they're so expressive because they be can be used to do such incredible things now there's a there's an ethos of kind of you'll hear the term code is law right so that just using smart contracts on their own to Define legal agreements and really that that that doesn't really seem to square with the real world in practice we've heard that time and time again from people on the show from elsewhere smart contracts on

the on their own are good at the automation step they're good at helping you enforce or operate a contract but they're not necessarily fit for purpose in and of their own for all types of contract a lot of the time you still will want some legal system or you'll have to draft the contract in the old world as a digital legal contract and then convert it into a smart contract yeah I think there's a really nice quote from Nick zambo that actually got written down here and it goes along the similar lines where he says there's a strong distinction to be made between dry code smart contracts and wet codes physical law so law is based on our minds our wetwear it's based on analogy the law is more flexible software is more rigid various laws tend to be batched in jurisdictional silos and software tends to be independent and there kind of like you talks about the pros and cons there right one is lur is flexible for a reason it's like if I

Jack has to pay me at the end of the month or otherwise I repossess his house now if Jack gets hit by a bus on at the end of the month and he can't physically go to the bank then there should be some flexibility in the law to say okay this isn't actually Jack's fault and code isn't always like that right A lot of these smart contracts are binary they're trying to take quite and well I guess varied degrees and Spectrum based law and turn it into something that's black and white and it shouldn't always work like that on the other hand he's also saying there's some pros to this right there some things are black and white and if you don't pay on this day then it should be independent of any bias and there's so much bias in law that actually is really bad right you've seen some of the studies and some of the stats about when judges are actually penalizing or judging over people in the morning or just before lunch

they actually have like 5% longer sentence on average bias is typically very bad but there should be some flexibility in the law depending on circumstances smart contracts don't always capture that yeah exactly and and when you have the gray world that we live in then trying to put that in a black and white setting in on the blockchain is very difficult and the more different eventualities in the real world you trying to account for the more complexity you add to the smart contract the more risk you add to something going wrong not being able to fully predict the behavior of it right there's this principle in cyber security keep it simple stupid right so the simpler it is the less likely it is to go wrong because there's fewer variables to think about when testing the security of something so yeah it's one thing to be wary of in in the smart Contracting world so not just the me the mentality towards them and being aware that they're not a replacement for the legal system

they're just a way of helping enforce the legal system effectively in a more efficient way but they they're not also necessarily fit for purpose in all cases as well right because not always can they express all the conditions that you need for a given contract yeah that makes sense I think um one of the other issues that I see bounded about a lot is technical complexity and I kind of have an issue with that right is most people don't code so the idea of like changing human readable language into code actually isn't going to help the readability of a smart contract but have you tried to read like a legal terminology lately it's complete jar I think it's probably me anyway it's definitely less readable to have a lawyer draft up a contract than it is to program some basic conditioning in a smart contract or in some programming language so I think this is just a change from legal jargon to you know programming jargon but I guess that is also a concern and

we've talked about the scalability the cost right now smart contracts on ethereum are not very efficient at all they're extremely costly hopefully they're going to come down but I guess that's one to TBD yeah and that's where you bring in the idea of layer one versus Layer Two again right as we've talked about taking things to a second layer might increase the efficiency but doesn't give you all the same benefits with the automated execution the non-trusted environment that you want for these smart contracts so that's a pretty good overview I think of how spark contracts actually work let's talk about the applications right to not just boring employment contracts and things but let's go into where are they actually being used in the real world and what's actually exciting so what do you think is one of the big application areas for smart contracts yeah let's go from uh you know boring contracts to even more boring Supply chains we've kind of talked about this on the show before obviously Supply chains are huge this

is a trillion dollar industry they use Supply chains are needed for anything that's more complicated than a stick and as like we're increasingly globalized their cross border their cross jurisdiction cross everything right and I think we saw that you know Global Supply chains are actually not very resilient covid really emphasize that the war in Ukraine's really emphasized that the supply chains are very important but they're also quite fragile I think one of the most important things around Supply chains is there's lots of different parties that are interacting sometimes independent parties and lots of different actors that are completely independent you imagine a farmer then you imagine you know the person that collects the farm produce I don't know what that is the person that transports it the person that sells it you know these people don't necessarily communicate very well together and this creates a lot of paperwork and there's a lot of duplication a lot of sense checking it is incredibly slow so I've seen that some of the estimates for smart contracts and

what they could say a to the supply chain industry generally every year is around 500 billion to one trillion so it's huge right and that that's like an immediate impact I think one of the most well-known projects was the Walmart project where they had lots of disputes around delivery and provence of good and the average time it took for I forget it was it was a certain type of product or a certain area was seven days to prove Providence of a product and that's seven days from someone trying to push product to the next stage and the person there being like okay you need to prove that this is actually the product I want and that took seven days in average and just by using distributed Ledger technology and smart contracts in this it went down to 2.2 seconds which is quite an immediate impact for quite a big company so how does this stuff work you know imagine you have a smart contract that's effectively collecting the data if we okay let's take the

farmer for example he has some milk that he takes from the cow as soon as it goes into the bottle he tags an RFID or an iot T chip on that milk bottle to know this was created on my farm I can produce a digital signature to prove that and only I can do that for this good okay so then we have a smart contract that actually monitors that milk and provides realtime tracking and verification of the goods using that Farmer's digital signature at each decision point along the supply chain and as it goes through the various actors they can verify instantly that it came from the previous actor and they can provide their own signature on that as well be automated with a smart contract and automated with iot chips where you just have an iot chip going past a gate but the point is we've programmed every kind of transaction on the blockchain which is effectively this being passed from point to point actor to actor and it allows us to really efficiently

verify the authenticity of the milk for example from origin all the way through and you can start to do you know more intelligent things like prove transparency prove that it was below a certain temperature prove that it took a certain amount of time to get there and I think smart contracts when we think about iot devices and iot devices being used in supply chain is extremely important it's a lot of data that you don't want to handle manually you want to automate the entire process you don't want human error involved in the loop and really excitingly you want the you want funds to be automatically released right if I have a smart contract between say the distributor and the farmer as soon as that iot device says that this milk has gone through that gate the fund should be released by a smart contract from the distributor back to the farmer and this is a really powerful thing I think for Supply chains generally yeah I 100% agree it's for a boring topic is actually

very interesting I think what's yours Jack can you take it even more boring than Supply chains I'm sure I can but I mean just on that as well I think it's worth adding that you know we spoke to David Palmer about the future of iot in a previous episode and he was talking about the economy that you can have with iot and how they can interact with each other interact with other systems and and giving basically giving them money to go and trade with or trade data with right imagine an iot device selling data in the marketplace that's a kind of revolutionary idea and you can have that all mediated through the smart contract the other one of the reasons it's so beneficial to supply chain is this Universal source of Truth idea with blockchain the fact that it's immutable and the fact that blockchains are very good at having unique records actually not just unchangeable records but everything is uniquely identified on a blockchain it's a very it's very special database in that sense

and that it's public the kind of Trifecta of benefits so that everyone can be seeing up the same him sheet as this thing this item this bottle of milk is traversing through the supply chain because everyone knows the smart contract everyone knows the rules which party does it go to next what checks they need to do what data they need to submit and then all the data itself is also going to be mutable and won't be able to change and can be checked you can be error checked by the smart contract if it's in the wrong format for example it could spit that back out and say no that work you need to submit it again the fact that everyone's saying off the same him sheet the same smart contract and it's uniquely identifiable is huge I think yeah you're so Welsh like constantly singing off him sheets it's a bit of you but you're not allowed to pigy back on on my application you got to give me your own him sheets in agriculture

that's all we have I think another one we've talked about it a lot recently and this will be pretty obvious to everyone listening but is the financial sector all the use cases there okay what the application yeah it's exciting for sure it's maybe it's a more boring old world thing but the new version is very exciting and really we did a whole episode on defi defi is smart contracts applied to the financial sector right so all these things we're seeing it happen in defi again automated market makers Unis swap uh borrowing and lending protocols using oracles to pay out things even gambling type use cases are interesting I think so you know and not just because you can do new things but also that this can be used to save money as well and make these things more efficient in theory so again PWC estimate that a business can save up to 2% of their annual costs by using contract management right any business potentially because of the inaccuracies it inv voids right maybe with

payments so 2% doesn't sound like a lot but that will really impact the bottom line for lots of companies in the world especially at the minute and we love talking about the bottom line and I think yeah the boring stuff is the efficiency and the time safy but that's what Enterprises care about the more exciting stuff is the idea of lowering barriers to entry and being able to have anyone contribute to some fund or anyone being able to have a direct peer-to-peer funding service or something like this just via managed via a smart contract yeah and the financial sector is really where smart contracts actually I think combine most obviously with all the other aspects of web 3 like your oracles because they'll feed in prices or other data like time because again time is an interesting one because the blockchain doesn't really know what time it is the even doesn't know what time it is you have to feed that in so you need oracles to do that if you're going to pay out

on a certain date or pay back on a certain date for a loan for example so oracles are hugely important when used in conjunction with smart contracts the same with decentralized exchanges as we've talked about they're all smart contract based or the best ones are the ones that work the best algorithmic stable coins okay they're a bit more experimental but I think they're still exciting as a potential way of doing monetary systems even though we've seen many failures it's still something we couldn't do before and then you also have Dows right dist decentralized autonomous organizations and I keep banging on about the Constitution Dow but I think it's so fascinating that crowdfunding the ability to crowdfund on such a scale and without knowing the people you're crowdfunding with right it's crazy that they nearly managed to buy the Constitution and that was just a simple crowdfunding thing right that's just pulling resources that's not a very complex smart contract you're also seeing people encode Like rules of organizations into smart contracts and I don't think

I don't see many companies being ruled purely by da in the future I think again like with normal contracts you're going to have to have the old the old uh you know organizational structures in place as well but they can make membership more efficient they can make it easier to come and go or buy shares and leave from our company so I think that that's very interesting as well you just compressed an hour of defi episode into about five minutes or maybe two minutes actually a bit less than that but the amount of words you threw at people like d was automatic money makers dexes oracles boom no need to listen to that def the highlights version is the highlights version nice I think a slightly more exciting one that it could be applied to as well is the entertainment industry obviously nfts I think I think the nft craze is still going I don't know I'm not really sure anymore it's hard to keep up with but the idea of like the entertainment industry

or individual content creators artists for example being able to create a digital token or digital art and then create an nft for it and in that nft they can start to imbue smart contract rights around your intellectual property where it came from royalty payments for example if I create an nft that you know gets resold 10 times and I'm the original Creator I can actually embed in that nft the actual functionality to say okay every time this is sold I want 5% of the profit that's made from it things like that and when we start to talk about the idea of okay IP who actually owns this who is the original Creator who's the authenticity well this is a really hot topic right now around Ai and all the things that are generated from Ai and we can start to think about you know smart contracts managing the creations of AI and all this kind of stuff and it's always Fair compensation there's no not necessarily any delays or errors in that it's very defined

and black and white in a lot of ways which has downsides and upsides yeah I agree I think the kind of the media entertainment industry and the nfts use case right using nfts in much more interesting ways and for royalties is definitely going to be part of the future I think we're already seeing people exploring it but it's so easy to encode simple rules that are very powerful for royalty payment in smart contracts right every time the nty gets transferred then you add that person to the list of royalties and maybe reduce it by half or something like that I've even seen Jack Butcher and the checks project right this is really interesting it's kind of algorithmically generating new nfts based on what previous nfts were and this is all smart contract based right it's using the smart contracts as part of the algorithm generating the nfts which is super exciting yeah I think that's going to be part of the shift into utility tokenization in the future right not just dumb JPEG nfts but

things that con convey much more value much more meaning in the future and that's a nice inroad to I guess the final part is what does the future of smart contracts look like I think you've c on it there with that project you just mentioned I think one of the big things for me talk about iot a lot and for you know good reason I think the idea of smart cities and iot driven smart cities were well you know going to have like 30 billion active iot devices by 2025 how are we going to manage the interactions and as these kind of these iot devices start to have more intelligence more agency they start to have to interact with other iot devices like one of the good examples is the idea of a a self-driving car refilling itself at a petrol station well how is that interaction going to be managed you're going to have to have some exchange of value you're going to have to have some terms you might even have to have

some signature to say something actually happened and there's some authenticity around this well that is a contract and obviously when we get to that space we're going to start to need smart contracts actually manage it ensure transparency ensure efficiency because there's no way in that a lawyer is going to be able to keep up with that number of iot devices so I think that's an ex extremely exciting realm the idea of iot devices using smart contracts to interact in The Wider world and interact in an open public World quite importantly oh yeah I definitely think that's going to be huge and we've been talking about smart cities for quite a while but there are some huge projects happening around the world to make this a reality now and I think smart contracts are very much seen as the tool to do that another thing I think is obviously a trend at the minute is everything AI and the convergence of AI on blockchain or AI on Smart contracts as we've also touched on and I

think what will be really interesting is when you start having a AI used to inject new types of insights and new types of data into these smart contracts you know via oracles and things like that so that smart contracts can start doing things that are dare I say it probabilistic okay so we like to think of Everything is Everything is very deterministic in the blockchain world everything is you know this process goes to this it's very well defined but actually we can start injecting some new use cases into the web 3 world by using everything we're getting for the AI Revolution right now so I don't know what it's going to be exactly right it might be how contract decisions are made or how you modify a contract how you update it over time maybe it's randomly Distributing rewards for a given given piece of media or something like that I don't know or trying to predict how often a smart contract is going to be needed to be used and doing some clever things

with you know when you submit your transactions that kind of stuff could be interesting as well but yeah I think broadly how smart contracts leverage AI going forward is going to be a massive thing you heard it here first AI is going to be big I think maybe un sure let's see yeah I think we're coming to the end of the show that it's a lot like smart contracts is extremely exciting topic and there's so many more Avenues we could go into we probably will expand on this in the future I think overall I'm feeling quite hopeful about the space I think one of the things that we've kind of reiterated throughout the show is yeah there's a lot of efficiency improvements but the world isn't binary and we have to make that clear there's always going to be a gray area between contracts and we need to ensure that we don't try and program the entire world because it might not be possible yeah I completely concur with your sentiment the only thing I

would add is how foolish I feel that we've taken well over half a year to get to the topic of smart contracts on a web three podcast when that's one of the only things that people will actually have heard of before so I'm glad we've done it now at least it's daunting right because contracts are so convoluted there's so many many elements to explain why smart contracts are valuable but I hope we did it justice and we almost certainly will have kind of more episodes on this to expand on the topic because it is an interesting one and quite a technically complicated one as well yeah I think what we've done here is an example of crastination oh God and on that bombshell and on that bombshell we'll say thank you to those listening wherever you may be and join us next time to untangle a little more of web thanks for tuning in to another episode of untangling web 3 produced by Emma caleri don't forget to send us your thoughts questions and comments

on social media and be sure to follow us on your favorite podcast provider to catch the next episode see you next time to untangle a little bit more of web the views we express here are our own and do not reflect the views of our

Topics: Blockchain & Crypto

Related episodes

All episodes