
Hello everyone It's great to see you all again in the wonderful city of Dubai after almost two years and today I'm going to talk about the power of Bitcoin smart contracts because as Jimmy just mentioned briefly I think that due to a misunderstanding in Ethereum or intentional It's misleading that many people don't usually associate Bitcoin with smart contracts. Today I'm going to show that not only can you write all types of smart contracts, but our smart contracts are more powerful and scalable than other computing blockchains. So in our Before I start, I would like to remind everyone what is the origin of smart contracts in Bitcoin? This function was not added by some later developers.
If you look at Satoshi Nakamoto himself in the past, he clearly stated that when he originally designed Bitcoin, he had already set up this function called "Bitcoin Script". This function can support various types of transactions, not only ordinary payments, but also various contracts such as escrow, multi-signature, etc. So this function has existed from the very beginning. Today I just want to introduce a few examples, one of which is the strongest. The big or at least competing blockchains are hyping up the features and what I'm going to show you is that you can not only write smart contracts but you can write smart contracts more efficiently and cost-effectively so let's start with the obvious from those people Things to turn a blind eye to start: BTC We list some of the features of BTC here some of them… If you have enough technical knowledge or you have been following the BTC chain you may see a lot of things in it that you are familiar with such as the so-called Schnorr Signature This is…
So when we send a normal bitcoin payment the sender has to sign it and then the miner checks that the sender has ownership of the bitcoin he sent here usually so called ECDSA signatures and Schnorr signatures are made by BTC Another similar signature type that the devs have so they've spent a lot of time on it and they'd have to make breaking changes to the whole protocol to enable this feature but what I'm showing you on the screen is that you don't have to To change the whole protocol and break everything that has ever been there you can actually build on top of the protocol and that 's the crux of the matter once your underlying protocol is rock solid it doesn't actually hinder innovation instead you can build on top of it Various innovative things. This is similar to today's Internet.
We will not change the TCP/IP protocol every six months or every 18 months, but build various applications based on this protocol. This is a paragraph written in our sCrypt language. The code sCrypt is our flagship programming language as you can see you don't have to change everything you can build this functionality in less than 30 lines of code so you don't have to break everything The next and most important upgrade the BTC community has made A man called Taproot This upgrade was proposed about four years ago in 2018. The initiator is our favorite and the world's strongest developer Greg Maxwell. This is basically to allow BTC to implement more advanced smart contract functions and then this function It finally went live at the end of last year so it took almost four years to implement this feature and more than 150 of the top developers in the world were involved in the project and this is how they delivered it again with breaking changes you can see to the timeline but you can also do it in a better way on raw bitcoin you can think of every box on the left as a transaction if you can construct such a transaction chains you can actually do the whole thing if you're very familiar with the sCrypt language and if you're a developer you can actually do it all singlehandedly in about 20 minutes and that's what I did and it cost me over coffee Wrote this code in 20 minutes so you now have a choice you can spend almost four years and get hundreds of developers or you can learn to use sCrypt if you want you can write code on your lunch break if you It's a millionth of the labor time but they're some of the smartest developers I know what next is a fork of Taproot called "Graftroot" Also this was started by Greg Maxwell so the good news about this project is It's not live yet and it's not delivered on BTC yet but if you can build a transaction based on this graph you can actually do it today instead of waiting another 18 months or a while longer but you can do it today Done so I think this is a bit too technical In Taproot you can set multiple spending conditions You can set "Alice and Bob both sign to spend" or "Require Alice's signature after tomorrow to spend" You can also set a multi-signature So the only difference between Taproot and Graftroot is the "spending conditions" You don't have to set up a tree structure in Taproot you can actually use what is called "delegation" basically all participants can sign the individual spending conditions you don't Putting it on a tree structure is sort of like unfolding a tree and adding leaves to it and you can go live with this feature today which is an advantage right? So if you want to tinker and you want to innovate you can always build on top of the protocol you just spend a few hours programming instead of changing the protocol every 18 months that's another change they're going to name for "OP_CHECKSIGFROMSTACK" so for us who know a bit of technology we already have "OP_CHECKSIG" in original bitcoin for checking public key signatures but the message can only be the transaction itself so with this modification the message can be anything you want data so you can…
Say you want to sign some weather data or if you want to sign… let's say data from the BTC price oracle this feature is also called "OP_DATASIGVERIFY" in BCH which is actually what they are doing One opcode we were arguing about when trying to split and they spent a lot of time because this breaking change would cause a lot of drama but it's avoidable and I'll say again you can write it in sCrypt if you really want to Want to do it in less than 20 lines of code and it's more scalable because not only can you choose which elliptic curve you want to use choose whatever you want you can even upgrade without having to make breaking changes assumptions Say 256-bit encryption is not secure enough You can also use 512-bit encryption but you don't need to break a single thing You can write a smart contract based on this protocol There is another example where they try to change it called " SIGHASH_NOINPUT" or "SIGHASH_ANYPREOUT" This is basically when you sign your signature covers some part of the transaction so you don't have to decide which output or which UTXO to spend it's like giving the receiver a blank The check recipient can choose any UTXO you own and let you sign it, so you don't have to make destructive changes, you only need less than 20 lines of code to complete the whole set of functions.
The advantage is that you can not only write the "SIGHASH_NOINPUT" function due to smart The flexibility of the contract You can use signatures to cover part of the transaction So let's look at the next coin: Monero Some people may not understand that this is a privacy-focused altcoin It uses a It's called a "ring signature" so the difference between a ring signature and a normal signature is that you can hide your signature inside a group of people's signatures and that group of signatures is usually called a "ring" So suppose I Signed but I don't want to expose myself I can co-sign with a group of people say I can hide among 11 people It's a bit harder to identify who is the actual signer You can see here again You can use or not Write this whole set of blockchain functions in 30 lines of code There's another privacy coin called Zcash and they're using this so-called "zero-knowledge proof" technology which is kind of like advanced cryptography meaning you can prove to me you know something without revealing the actual information Bitcoin signatures Just an example, right? This is a type of zero-knowledge proof where you prove to me that you hold the private key that corresponds to a public key, but you don't show me the private key itself, right? Otherwise I can steal your coins so Zcash uses this technology called "zk-SNARK" which is the first feature to implement Zcash we actually implement the original "zk-SNARK" which is the "bilinear parent" On the right we have the full set again in 30 lines of code and you can actually run Zcash on top of Bitcoin if you really want to without having to re-open a whole blockchain and you don't need another A group of miners to do the verification You can actually build the whole chain again and just run Monero or Zcash on top of Bitcoin I think we've covered some of the functionality of Bitcoin smart contracts so no Constant changes and upgrades like BTC or some people launch another independent chain for privacy or other functions In this single contract, you can actually port the entire computing blockchain to Bitcoin You can write code on it and if that's not enough I'm going to do my next presentation hopefully this will blow someone's mind I'm going to show how to run ethereum on top of bitcoin we're technically capable but we're a bit behind for historical reasons We are trying to catch up with Ethereum, the so-called leading smart contract blockchain, so how do we run Ethereum, a general-purpose smart contract platform? It's not just a few smart contracts You need to be able to support any kind of smart contract So how do we do that? How can we run Ethereum on top of Bitcoin? At first glance we can't do this so the biggest difficulty for someone who is a bit technical is that our two competing blockchains use different models.
One uses what's called an account model. Think of it as A bank account Each contract has its own account address, and Bitcoin uses the UTXO model. Therefore, in order to simulate Ethereum on top of Bitcoin, we actually need to map these two models. Here is a method such as You write contract A on Ethereum and we can deploy that contract in one of the UTXOs on the Bitcoin blockchain so how do we do that? I'll cover that on the next slide but once you've done deploying the contract on top of bitcoin every time you change the state of the contract you use another transaction you spend the old UTXO and you deploy the contract to the new UTXO round after round every time you update the state you send another transaction you make the same changes and you move on top of the new state so you can emulate ethereum on bitcoin this way I just talked about the general way of working, and then the question arises that smart contracts on Ethereum have different expressions, so how do you help everyone to migrate? The answer is the "Solidity to sCrypt Translator" that we are going to introduce Thank you guys You can see here that most if not all Ethereum smart contracts are written in Solidity so you don't have to rewrite them by hand from scratch All the codes, although this way is feasible, but the cost is too high.
We now have this tool called "Translator", which is very simple. You paste the code on the left panel and you click this magic button. "Transpile" and you get the equivalent sCrypt code Once you have the sCrypt code you can do the same thing (on BSV) at 1/10,000th the cost and more scalable easily One click so… Thank you thank you all this is a project done in partnership with Vaionex Robin helped us a lot I would like to thank him Cain for helping us with the integration and helping us bring this very user friendly front end A lot of the research type work we do like zero knowledge proofs would not be possible without the help of nChain I would like to say thank you to Enrique and Owen and not to mention Dr Craig Wright but also to the BSV Blockchain Association for sponsoring the Translator project We eat them all with pacman Let's eat them with pacman Thanks everyone