DappCon 2023: How to build a confidential EVM dApp with smart privacy - Harry Roberts
DappCon 2023 · September 2023 · 46:54
Building confidential applications on the EVM is the focus of this DappCon 2023 talk, walking through techniques for adding privacy to smart contract execution without abandoning Ethereum's existing tooling and compatibility. It covers what "smart privacy" means in practice, considering how selective confidentiality can protect sensitive data and business logic while keeping a dApp verifiable on-chain.
Speakers
Topics
From DappCon 2023, hosted by Dappcon Berlin.
Transcript
so hello everybody uh I'm running a workshop today about how to build confidential evm uh dap with smart privacy so I'm Harry I'm a technical product manager at the Oasis protocol uh I'm handling uh the sapphire evm chain and the Oasis privacy layer uh so the workshop slides are available if you want to get your laptops out or scan or whatever you can run through them with me there's going to be lots of code examples uh and lots of really really useful stuff if you do want to try and build some stuff so roughly we're going to go through smart privacy confidential evm how is it different getting started with building apps uh then some examples and some cool stuff I hope so what is
Smart privacy I I think this is a good place to start which um how many of you are like privacy maximalists so you're all privacy no transparency right uh but what about transparency cuz everything on everything on evm is transparent right uh but realistically like the rest of the world exists in between where we need privacy and we need transparency so think of like uh if you're sending an envelope to somebody you want the inside of the envelope to be private and the outside to be transparent and at the moment on on evm that's just not possible so there's there's a lot of sort of different use cases for this so like uh if you look at the use case of ZK
providing proofs that you know a secret uh or you're having transparency but only within select groups or uh you know conditional access control so you want to be able to gain access to something but only if you know the secret or you know uh someone's giving you uh someone's giv you access so fundamentally smart privacy is conditionally controlled by the smart contract so rather than the protocol being all private the contract gets to decide what is and what isn't and so really like confidential evm enables all of this so if we look at ZK which this isn't ZK uh so with ZK evm you can do rollups of uh lots of transactions you can provide proofs that
something uh like with zcash you can provide proof that you own a coin um but the contracts can't have their own secrets so if you can see you can keep your stuff secret but it's not sort of autonomous and with NPC if you look at a of the bridges so if they're doing cross-chain stuff the NPC protocol will keep the secrets itself uh so that they don't get leaked but you've got lots of network back and forth between uh the NPC members which means that it's really it's slow in practice right so realistically we're using a compromise which is inside the trusted execution environment powered by sgx allows us to run contracts at almost full speed compared to the regular the
regular evm but the contracts can have their own Secrets which is what's what this all about um so what is the different components well fundamentally we have uh the private computation that means the node operator uh can't see anything that's happening inside the contract as they're being executed uh we've got private storage so the contract can uh store stuff retrieve stuff again the node executor can't see what's being retrieved or what's being stored we have a built in a vrf so rather than using an external service you can from a contract say hey give me some entropy I need 32 bytes 100 bytes whatever and that happens instantly and then end to end
encryption so the contracts can communicate with users in their browsers without the the relay nodes seeing what the content is uh and you can securely submit uh secrets to the contract without anybody seeing so we''ve got a Sapphire evm which is our our private blockchain uh it's a parad time which is secured by The Oasis Network consensus and everything inside uh the evm is is uh private but uh we're going to cover some examples that show the different use cases of confidential evm uh and that's really like what to be aware of in terms of edge cases because there are a few
edge cases where it doesn't act as you'd expect it to if you're used to normally M so it's 99% compatible but you're doing privacy so you need to be aware that evm expects everything to be transparent and if you want to get started there's a bunch of links here so the documentation the test net foret the Explorer uh and a couple of demo projects on GitHub if you want to check these out but uh yeah with a test net you can add this to your menam mask and it's in the documentation there so because it's uh a different evm and there are differences between
transparent evm and uh and Sapphire uh if you're developing with hard hat for example or or Foundry uh you won't be able to run the full set of functionality that you'd expect to so the um if you want to use the vrf for example if you run it in hard hat you won't get random data so in order to develop on Sapphire you're going to need to use the sapphire Dev Docker container which will spin up a local node of uh of the sapphire local net on your machine uh alternatively you can develop against test net uh and you can use the foret to get tokens for that so what are the differences between
confidential evm and transparent evm so we've got call data encryption so that mean means when you submit a transaction on chain you can encrypt the cool data uh and it will still be included in in the transactions that are visible on the Block Explorer so you'll see how many transactions have been made uh the size of the cool data you know who it was from the contract that it was to the amount of gas that it cost uh but you won't see the cool data itself and we got encrypted storage so again the node operators will be able to see that you're storing things see that you're retrieving things but they won't know what the content is and there's also a question about you know can you trust
the message sender parameter uh so a very quick overview of this we've got the key manager that controls access to the storage so the confidential contract that's executing inside the trusted Enclave uh requests a key from the key manager to be able to retrieve a single piece of storage so unlike other networks uh if there was a breach of the compute node we uh the attacker wouldn't be able to get the secrets for all of the storage they'd only only be able to see uh the specific pieces of information that were accessed while it was happening so we've uh set set up in
this way as a bit more uh sort of uh reliable than others uh right so let's let's do some examples so uh I'm going to start off with a private token which is the the most straightforward use case of I want private money on my private chain it should be straightforward so you say I've got my transfer command and I subtract the Bal the amount from the balance add it to the other balance of of course we're not uh verifying uh you know what the transfer is it's just doing the the transfer itself and you'd think there aren't any problems with this should be private
right because it's running in a confidential evm it's got confidential storage but the problem is that yeah the compute nodes will see the io patterns so as I said before you've got encrypted storage but you still see the access pattern so if you subtract from my balance and add to somebody else's balance that's going to reveal the people that were involved in a transaction so for some cases that that's not a problem but if you want real privacy that you have to consider this as well uh because a lot of the attacks you get against privacy systems uh is essentially like tracing through a graph so if they can see uh this person
transferred to that person to that person to that person even though the balances are hidden uh you'll be able to infer from that graph of transfers uh you know who transferred to who and infer what amount as well uh so there's a really cool utility called heart out Tracer which lets you see the SL load and s store commands so if you're worried about this aspect of uh the privacy of your contract of will this reveal information uh you can use this to take out specifically the the SL loads and the S stores and see what's going on and then that lets you develop some patterns to OBC that so for example if I wanted to switch these around I say randomly
select uh subtract first then add afterwards or add first then subtract afterwards then just looking at the io patterns you won't be able to see well was it a transfer from this person to that person or that person to that person and vice versa or you could uh put in dummy accounts so if you wanted to obfuscate in a similar way to Monero does with the the ring signature mix sence you can say of all of these accounts uh I'm going to load all of their their balances I'm going to modify one with my you know with the the payment that I'm making uh and then just write the same value back uh to all of the others so if someone's doing analysis they'll see oh
there were 10 different storage uh stores and I don't know which one of these are real but in most cases it doesn't really matter so if you're not looking at uh sort of really strong privacy guarantees then it's you know there's lots of other things you can do that that aren't so serious uh but the the second part is side channels so because I with every transaction you can see the from the two the size of the co data the amount of gas it takes uh this can lead to sort of unexpected things where uh you know the amount of gas that's used will reveal which path within the code was taken so uh this can have unexpected consequences
so in this example I I'm checking you know hey hey does this person have uh an allowance big enough for the transfer to happen before it's verifying that whoever's creating the the whoever is performing the transaction has that amount allowed so yeah I've mentioned this already uh with a gas Channel being public you can start to sort of uh perform tests so if the balance check is before any of the authentication I can say uh is this balance 10 eth and it will give one gas rating I say is it 0.1 eth and it'll give me a different gas usage
so with this I can perform a binary search and go through and find what the specific balance is so in terms of like authentication uh and not revealing information about uh or the balance you need to move authentication up to the top and make sure that uh no extra information is uh revealed through the gas side channel uh so the second problem is view calls so on ethereum we've got the eth call uh RPC which simulates the transaction and again this is a problem because on confidential evm you don't
want people to impersonate you but on regular evm you can simulate a call to any contract from any person uh with any gas amount whatever and it'll let you do this so if I wanted to check someone's balance uh in confidential evm this would be uh bad because you can get everyone's balance and of course you want the balance to be private so we can check my balance so if I want to view uh my own balance and not be able to see anybody other others balance then you can use the message.
sender parameter but the the problem there is how do you know that the message sender is if it's a view call uh how do you know that uh they are who they say they are so this is a problem that we've had to overcome by signing view calls so you can have Anonymous view calls where the the message. sender parameter will be overridden to zero so if you don't specifically sign your view calls then the chain doesn't know who you are when you're performing a query uh and this is all automatically uh wrapped with our our wrapper with the sapphire par time package so if you're writing a client uh or a Dap whatever
and you want to be able to use the message. sender parameter you're going to have to sign your view calls and essentially you just wrap the provider that's provided by metamask or or hard hat if you're using hard hat uh if you add the sapphire hard hat package in and put it in your hard hat. config then it'll automatically do that for you but there's uh so one problem which is with signed view queries um if you're a user and you're using metamask then every time you perform a view query it's going to pop up and go oh hey please sign this this transaction right it's not a transaction it's just uh you need to authenticate your query so that the contract knows who you are
otherwise you know it doesn't know who you are cuz you're anonymous so with this um yeah so with this you can then verify you can then use this to say okay uh am I allowed to see someone's balance if I have an allowance with them so uh in terms of rethinking how you deal with tokens token transfers uh and the standard sort of erc20 stuff it's you can Port it over but it's not like directly applicable because of all the these sort of side channels being able to see everyone's
balances you know if you're doing PR privacy uh you're going to have to modify it in a way that means that uh even with allowances uh you're only revealing information that they know so if I give you an allowance of uh one ether for example but I've got a balance of two ether you don't want to reveal that I've got two ether when they can only spend one uh so there's a couple of other approaches in in terms of like alternatives to verifying the identity of the people people that are using your application so one of those is sign queries that we've gone over uh where you're signing the view call and sending it over uh you could also use uh like viewing key so I know secret Network for example uh make you set up a viewing key
so when you create a token or when you interact with a contract say like a token you set a special key that allows you to view your balance so you can uh send that over along with your request to see your balance and the contract goes yep that exists but there's a problem there which is like a the chicken and egg of in order to see your balance you have to interact with the the contract but if somebody sends you like a 100 bucks you need gas money to set up the viewing key to see your balance so it's is really not user friendly um I it leads to situations where someone sent you balance but you're not sure how to see it and every time you change wallets you have to set up new viewing keys and it's it's really
awkward so like the alternative here is you might have seen this with uh uh a couple of different nft markets which is like logging in to verify your account so if you imagine on a day-to-day basis uh you make the or every time the user goes to the the website they say uh please just verify your wallet is this you uh once you verified your sign from your your your wallet uh just say I'm logging in for the day it's valid for a week uh then you pass that along with all of your vehicle so it it does require you to sort of re architect your your application or rethink it in terms of uh how you're querying the data uh if you're performing lots of calls in batch that's usually easier uh because that
won't have like popups going please sign the query right uh and then the other option is like permits and delegation so if you want to give control to somebody else to be able to spend on your behalf uh you have to think of well I've got allowances but how do they know how if I have the balance are they do you want like more fine grained Access Control where you can give somebody access to a specific subset of features and and uh uh yeah it's it's it's an outstanding problem that you're going to have to think about uh uh but anyway if we move on so that's that's like an introduction to the the
problems you're going to encounter if you went through the example of how do I create a private token but next is the precompile so promiles are sort of the the special features that the sapphire blockchain has that are uh unique to it so ethereum has a lot of pre-compiled and they're they're simply there because it's too complicated and expensive to do this all in in solidity so for example uh the EC ad and pairing operations are very expensive but when they're written natively they're super cheap sh 256 and easy recover also examples and uh the pre- compiles are all documented on our website if you want to access them from your uh your dap you're going to want to add the
Oasis protocol Sapphire - contracts package uh which gives you access to sapphire. Sal which is a wrapper for the pre-compiled and of course to test the pre- compiles you're going to need need to use the the docker image to run the sappire node locally uh but the precompilers we have are uh like encryption and decryption so if you're running a confidential contract and the contracts can have their own Secrets then you know being able to generate Keys is something that would you'd like to have being able to encrypt and decrypt information is absolutely necessary uh you can do signing and verification so the contracts can generate a key and then sign for something by itself and of course the the random number
generator so with a random number generator it's super simple just request a number of bys and there's a personaliz string as well so you can I don't know add extra entropy uh whatever you want to do uh we also got encryption and decryption uh so you can use the x25519 uh key negotiation to derrive a shared secret between uh the user and the contract or uh two contracts together if they want to uh encrypt things for each other and pass it through the user uh and there's a lot of other interesting use cas cases so with EC just a quick overview of uh because we've got the full set of
uh curve operations inside you can uh not only do ecdh but uh sort of general purpose cryptography so anything that you see that uh uses elliptic curves you can do in confidence with uh the EC and EC mole operations uh so for decryption um again the the the sapphire wrapper provides uh some really simple straightforward tools so you can generate your key pair uh and then get the public key and then to to decrypt of course you derive a symmetric key so the client
passes in their public key you after previously getting your public key you drive the symmetric key uh and then you call the sapphire doc decrypt function uh it's really straightforward in typescript so these are all code examples if you want to copy and paste they do work and uh it should get you started so signing verification we support a number of different algorithms so uh the ed25519 curve which is used by uh Monero for example um I think Cosmos us it as well I think Polka Dot may use a variant of it um 25519 as well which is slightly accelerated version of the
Edwards curve then we also support the Bitcoin and the nist curve so this is the uh the nist curve is coming up in the next version of sapphire which supports web or n it supports uh like TLS so if you use SSL on a daily basis you're probably interacting with the nist Curve uh and the Bitcoin curve as well so that supports uh generating Bitcoin wallets verifying Bitcoin signat uh signatures uh generating ethereum w wallets for example and signing from them so both signing verification and key generation are supported and of course uh yeah like touch ID is is something that's is really I mean it's slow because you have to write it in uh without support for
the the nist curve you have to write in solidity which is cost a lot of gas but with the built-ins uh I think it's like 2,000 gas or something to generate a signature from a a nist curve which is uh really cheap so again if you want to sign uh we've got the algorithm selection so we support a variety of different algorithms and when you're using the the sapphire wrapper you have to specify specifically uh which algorithm and variant and curve you want to use so we support again a variety of different algorithms and they're documented in the documentation and uh so in order to generate a key pair we need to provide uh the entropy for this
so this is Essen enally uh the secret key so if you're generating a secret key get some random bites give it to the generate key pair and it'll give you the public in the secret key which you can then use to sign from um and to verify it's again really quite simple you use the sapphire Sapphire wrapper uh to perform the verification and pass in public key the digest and the signature and there are different VAR the different variants of uh the signing verification Al Ms either take like the preash message or they take the the raw message itself and it depends on the protocol on the the algorithm you're using but uh so this is all like the the
necessary stuff that we need to to understand uh and in order to be able to do the more interesting stuff so like uh integrating with web 2 is uh like a difficult topic with uh like the web 3 Industry as as a whole because you've got like the web 3 way then you've got the the web 2way and uh like really like web 2 is like there's no plugins uh it's super easy to use your grandmother uses it every day uh it's on every device so you don't have to uh you know if your uh your TV for example has a browser most likely if it's a smart TV um like refrigerators but they're all using usernames and passwords so you've got like the web two which is all usernames
and passwords the web 3 which is all uh you know key Pairs and signing and they don't sort of mesh well together uh but with confidential contracts you can have uh endtoend encryption so web2 assumes that with SSL you can securely submit stuff to the server you trust the server uh and if it's a contract running in a container in a trusted Enclave then you can take the trust out of web 2 uh so for other use cases like uh you know o S3 JWT uh you can generate signed cook cies for example but you also have to be aware of like Brute Force attacks and then you know because uh on web 2 you don't
assume that everything is private uh it's a problem so hopefully if we look at web 2 integration with sapphire because it's got confidential contracts uh this should help the Two Worlds sort of mesh together a bit better so I I mean the first example that came to mind was top so this is one thing that you can't do on ethereum because in order to generate like the two Factor codes that you use in your authenticator app uh the contract needs to know the same secret as you so this is something that's it's really annoying that it's on uh every device or every Apple and Android device you can download the authenticator it's used by loads of services but you can't use it on
ethereum which is annoying right so if I wanted to give my manager uh a top code and if I want to perform a transaction and I need his authentication so his authorization it's easier to phone up and say hey uh can you give me the top code I need to make a transaction and uh this sort of model that we used to to working with uh is more complicated with uh the web 3 stuff because again your managers might not be web 3 natives you might have to uh they might be on holiday they might not have internet uh but with top codes this is really straightforward so another example I said was
the Amazon S3 so loads of people use ipfs and now we've got like the ipfs pinning Services where you can make sure that your files don't disappear over time but the rest of the world uh they use Amazon S3 Google uh Cloud platform and their Storage Solutions where you know you might want to be able to provide an S3 bucket and let people upload big files to it uh and generates a a secure link that you can give to the person that allows them to up Lo one specific file or if you wanted to do a confidential nfts for example uh if it's stored on S3 you can set up access controls so upon purchasing the nft I can say hey give me
the the link for the full file and it will give you a download link that's limited for 24 hours for example uh because the contracts have the confidential uh data they can keep the the S3 Secrets they can generate links uh and it's it opens up some some interesting options the other example is JWT so if you've ever dealt with like rest Frameworks apis integration loads of people use JWT and it's another sort of pervasive web 2 standard where this is just how how it works because they assume that the server has secrets you know they assume that somebody is there going to be generating Keys signing stuff for you uh so imagine like a smart contract that can generate uh access
control so if you want to sign up for uh online you on chain you want to sign up for some API and you want to get an access token to perform API calls uh the token it can do this now so you don't need to have your web to infrastructure be like aware of web 3 you can just have the contracts that work with your existing infrastructure uh but can control access uh and can do stuff in return for money or uh whatever kind of integration you want to do so this brings up the topic of like uh sort of gasless meta transactions which I I know relatively popular at the moment uh and that's essentially like towards the like
cont contract autonomy if you got the signing you've got the key generation you got the confidentiality and you can generate ethereum compatible wallets uh yeah this means that you can sort of sign for transactions which is interesting uh so for example you got a a user interacts with the signing contract and we say hey can you create a transaction for me so the contract using its key pair uh will sign a transactions where maybe the user can control some parameters or uh you're doing a swap or you it's acting on your behalf um it gives you the sign transaction which you then submit uh back to the
contract well in this example for uh I just created a small function where it generates a transaction uh that calls its own function so like think of like anonymity if you got the contract that's signing for you you don't know who invoked the contract to get the signature because all of the the signatures come from the same signer and of course this this works on other chain so you could have the the contract on Sapphire generate signatures push them over to ethereum and everything looks like it's coming from the same the contract uh which abstracts it away from the individual users performing the actions uh so yeah this is again this is included in the sappi contracts package
so you can generate an ethereum key pair and then use the e155 signer to construct the transaction and to sign it with your address in your secret and this is just a super simple example of how do I generate my key pair I import the etherum ms. s file and then I perform the signing of so this is a signing just a general message so you could Implement EIP 712 or you could sign arbitary stuff uh and it can do that or you can sign an e155 transaction so that's compatible with most ethereum compatible networks so ethereum BSC uh
polygon Etc uh and the problem here is that uh the contract doesn't know like the the gas price so if you're signing a transaction on a remote train chain uh you need some way of knowing okay so what's the account Nots what's the sequence because if the contracts like autonomous and it's in its own sort of little isolated Enclave uh and it doesn't have oracles so how does it know that you know the gas price you give it is not going to just you know take all of its gas paying balance away or how do you know that someone's not going to do something malicious or uh deliberately submit transactions with low enough gas price they're going to pause stop the contract from submitting any more
transactions right so this is something you have to look look out for if it's your own contract it's your own funds and you're using it to like delegate signing to some kind of multiactor authentication then you can provide whatever gas price whatever nons you want and uh it's up to you to decide uh so there's we actually got a demo of this where uh we figured that one of the problems was uh you can't uh expect people with so many different chains to if you want to use private voting on Sapphire you've then got the problem of everybody needs to get some gas to pay for the transaction on Sapphire to
submit their votes um so if you want I give you an example super quickly of essentially the the secret ballots I'm logged in I votes it pops up a notification says uh this is proposal the vote the choices McDonald's using your IP 712 and then this is one thing you'll run into which is view call so it's it's signing a view call which is s of like a bad ux problem of uh because you've got the signer attached uh to the the provider uh whenever it performs a view call it will ask you to authenticate it but so we're signing something but we're not submitting a transaction we're not
using any gas and I actually have zero balance balance here so I sign this and behind the scenes the contracts generating the transaction to submit your vote on chain um so it's like a sort of gasless meta transactions uh this brings us into like account abstraction so with the contracts they can have their own Secrets they can manage keys for you I I've another demo I've got set up which is uh web orn so we've got like a full like account abstraction example where uh using like a UB key or using
like pass keys on your phone uh you can get the contract to sign messages for you so this is where like a Hardware security module you don't actually have the uh the secret key on your on your device uh or any other thing so uh only if you log in through using web orn or pass ask is can you get the contract to sign on your behalf so in terms of like customizable logic and both top web orn these can make some really interesting uh situations where you can give the contract control so if you want to have spend limits of say $1,000 a month you can have the contract only sign transactions for up to $1,000 per month before it it stops completely and so
because the uh because it's signing Real transactions this means you don't necessarily have to have the contracts deployed on every single Network that you want to to operate on you could have a single contract on Sapphire that signs transactions on loads of different networks so I could have a contract on Sapphire that authenticates me to sign on ethereum and it'll do that for you and I missed an example there so the next problem we have is is will cross chain so like Sapphire exists in isolation uh so we need a bridge basically uh and this this lets you keep some of the like the the stuff that you need to be private on Sapphire so you don't have to migrate your whole
application off to onto safire and because it's a message passing Bridge you could send a uh send a message from ethereum to Sapphire and say uh this user wants to do something please uh handle this for me and they want to do it in private uh the user will go and do something in private uh and then submit the result back over to ethereum with whatever the result is which means you again with smart privacy you get to do the private stuff in private and the transparent stuff in in public so you don't have to rely I if you want your assets to be on ethereum or on binance where you know it's secure that's where they live and you can do that and move say a part of your decks over to
Sapphire or uh I don't know it's interesting so this is like fairly straightforward again the sapphire contracts package includes everything you need and under the hood we're using the seller IM IM bridge to pass messages to uh all the all the chains they support and you just need to use opl Doo so we've got the user which submits the uh request to the the DAP or the DAP plugin which uh sends it to the message bus Which FS emits an event which is picked up with the state Guardian Network so this is sellers uh sort of multi-chain uh verification system uh the executor sees that the
state Guardian network has authenticated this message which submits it to the message bus along with the state Guardian secrets on the destination chain which will then invoke the the D plugin but who runs the executor is it's not a gasless solution so you have to run an Executor yourself or get in touch with solar to to run an Executor for you uh it's fairly straightforward so you post a message which can be anything and using messages uh and the methods so the methods like uh you know the message uh destination title but the two contracts are linked to each other so I'm going a bit fast now uh so the two contracts are linked to each other so you got one
contract on the enclave and one contract on the home network uh so you have to provide the addresses of each other to each other when you construct them uh and you can predict what the addresses are can be ahead of time so it's not too much of a problem and uh essentially uh you register your functions that you want to be callable in the Constructor so you want to register endpoint say the example uh sa Sapphire example endpoint which then on on binance Smart chain you can say invoke this it will post the message along with the arguments uh which will then be called and you can return success or or failure depending on the status uh but really I want to get on to some of the more interesting cases which
is uh like rollups and scalability which is uh yeah loads of people are doing ZK rollups and that allows you to compress the computation of of lots of different things and then bundle it up into only the information that you need to be transmitted so the account differences so the differences the balance uh balances um all you know you don't have to include all the signatures because you know that the uh the transactions are valid but on Sapphire this is uh there's some interesting things you can do here so because the eth call is free and the contracts have access to private State um that means that you can get the
contract to sign stuff for you uh so one example is uh you could provide the contract's previously signed output to the contract again uh and get it to sign that along with the next piece of work so uh the example here is um it will allow you to condense all of that information into a single signature provided by the contract so if we look at a like a Bitcoin like client for example um if you want to run a Bitcoin like client uh in view calls alone without modifying any state then you can pass all of the blocks one by one to the verifier contract which verifies you
know the the proof work is cumulative it verifies like uh the consensus algorithm and it provides you provide it the the previous proof of the the verifier client to it and then any signature that it outputs you can verify that oh this has been running for like uh 2,000 blocks the proof of work is this rather than having to submit all of the the blocks to uh back again so an example is if you want to synchron the Bitcoin like client on uh ethereum you have to set up the verifier then you have to shuffle in all of the blocks and you have to keep providing the blocks uh for it to uh verify that the the you know the
the block hashes you're providing are correct uh but with if you run this on Sapphire you could have uh the light client on Sapphire running and then if you trust the signature of the Sai contract then you can have a Bitcoin like client on any other network as long as it trusts the signature without having to relay all the blocks again so this there are lots of other examples you if you want to talk to me about this of where rollups on Sapphire with confidentiality uh can let you do things that are just not really possible in a gas efficient way uh on other chains um so I mean some of these examples are like shortcutting messages so if you
think of a a protocol where uh the contract's going back and forth and back and forth um you could use view calls on Sapphire to say verify the state uh and because you can pass information back and forth and back and forth you can have an entire round trip going on between you maybe three or four other parties um with a contract encrypting data to pass back to it that can be securely passed through other people's hands without having to worry about it being tampered so if you can do this without having to modify the state then it's basically or free and it's only costing you gas when you need to start making modifications to to the global state so if you think of like the typical two or
three-phase commit process uh you can condense this down into like one step with sapphire where because it can mediate it can generate Keys it can encrypt information you don't need all of these round trips so that's in terms of like scalability uh instead of waiting for your transaction to be mined and the limit being uh the number of transactions that can make State modifications at the same time instead you can spread your queries across all of the different view nodes and you get scalability to the uh relative to the number of nodes in the system versus relative to the number of State modifications it can make uh so I should also add that we're running a hackathon at the moment so uh
it's started already and it's going to be running up until October the 4th and there's $30,000 in in prizes across four different categories with 25 Grand in F on uh support and grants and there's going to be free audits for successful projects so the four different categories are you got the best app on Sapphire so there anything that's native to Sapphire that uses the private storage the RNG encryption signing Etc there's also the best app that uses opl so if you have an application already that you need to make some bits private uh you can use opl for that and submit it to the hackathon there's also like the best use of Sai for scalable privacy so what I've just said about rollups
it's also confidential right so you can do lots of things in private very quickly and then submit the results to say ethereum or or binance and that would be a a huge speed up versus doing them all on those chains individually uh and then tutorials and standards so I've learned that if uh if I'm doing a hackathorn and I my project doesn't quite work I can turn that into into a tutorial but there's also the opportunity for standards where there's lots of stuff that needs reimagining because of the Privacy aspect because of the confidentiality where like the token standards you can use them but they won't be private uh the nft standards like are there any options for confidential
metadata uh this is just a lot of uh some examples there but yeah there's 25 Grand in follow follow and support for runners up and winners and yeah that's the link for that and thank you that's that's me done for today so I think we've got 15 minutes left so if anybody has questions or if we can sit down or or whatever you want to do uh I'm happy to answer any questions you have yeah thank you it was oh can you
get the microphone sorry thanks it was a heavy Workshop in terms of information yeah I'm sorry about that no no it was it was super helpful and you you touch on a lot of things that at least our team is uh thinking about and struggling with uh at least on alternative uh uh chains y um my question is super General I just was wondering have you seen people build um non-financial applications uh yeah so uh in terms of the applications out there uh like Finance obviously is one of the main use cases simply because it's so integral to Everyday Use uh but outside of that it's
all I mean uh I'm honestly struggling to think of use cases that don't involve defile don't involve Finance in one way or another um simply because you know the without any money involved the stakes you have no Stakes so there's less need for trust less need for confidentiality but uh you can look at voting so if you want to keep the votes private while the vote is active so in most elections uh your vote is private forever you know and you can't see people's votes uh but with web 3 that often ties back down to how do we spend money and how are we voting on that right uh so yeah yeah yeah I was thinking of uh voting examples or uh personal data management
um yeah uh we were looking at like um password managers so being able to say delegate uh access to your passwords or a specific password for an amount of time uh that's something that's come up thanks so I think we should wrap this up questions thank you for coming today and
I uh please come and talk to me and and we can talk about uh the hackathon and if you have any interesting ideas and uh point you in the right direction thanks [Applause] guys