Intro to on-chain verifiability with vlayer - ETHGlobal Bangkok 2024
ETHGlobal·Thu, Oct 9, 2025, 12:00 AM
Join us for a workshop with Artur Chmaro titled, "Learn about Vlayer" This workshops anticipates ETHGlobal Bangkok, a 3-day hackathon happening from November 15 to 17 2024, bringing together the most skilled web3 developers, designers and product builders from all around the globe for a weekend-long adventure to advance the Ethereum ecosystem! ----------------- Follow us: https://x.com/ethglobal Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com
Transcript
hi everyone here is Arthur from vayer in this video I would like to present you four superpowers that we are giving to solidity smart contract developers these extra features that are possible thanks to vayer data infrastructure will give you extra features like time traveling teleport web proofs and email proofs first I will show you how these features are working what you can do with them and then we will jump into the code so you can see how you can use this in your project so the first superpower that I would like to show you today is time travel time travel allows us to travel back into the history of blockchain state so for example we can set a block to some Block in the past and then our smart contract is set to that context of this block number and then we are able to fetch for example erc20 or nft balances or some other smart contract uh storage just by setting the block to the given block number that interests us here you can for example query the usdc balance of some account and then we can back move back to some other block number or just go forward and then again read the usdc balance and just store it in the variable and do all kind of interesting stuff so time travel we believe in vayer is a really useful Fe feature for Di applications and real world assets applications if you would like to fetch something that happened in the past and then calculate it to for example compute the credit score or some other use cases then you can use time travel the second feature that I would like to show you is teleport teleport is very similar to time travel but this time we are able not only to set the block number but also chain ID and chain ID in this situation means that we are not only traveling back to the certain block number but we are also changing the context of our smart contract to the given chain for example we can read balances cross chain so for example here we are jumping to the optimism and we are reading the usdc balance of certain account and then we are traveling to some block number but this time on the base Network so for example we can calculate a total usdc balance across multiple chains another great superpower that we have in vayer prepared for you are web proofs web proofs allow you to attest that certain HTTP request was done with your machine it's very useful if you would like to prove some web to private data like owning a Twitter handle or having some certain balance in the applications like revolute venmo ppal maybe even your bank account but here we have an example in which we are able to generate proof of owning certain Twitter handle and then for example you can meet nft to somebody who is owning certain Twitter handle and also followed your company profile we truly believe that this feature will enable solidity smart contract developers to tap into existing Web Two Worlds and use them in the context in web 3 last but not least we have email proofs email proofs allow you to take your email content generate proof of certain phrases or certain subjects that are included in the email and then use it in the context of solidity smart contract deployed onchain this can be a really useful feature if you would like for example to build account abstraction wallet and enable recovery by sending email from your email address this can also work great for other use cases in which for example you would like to prove that you receive some email like confirmation of merging your pull request into some iub repository or some confirmation that is relevant for building applications about real world Assets Now I think it's a perfect moment to explain how this all works because you may notice that here we have functions like set Block Set chain verify Json get string that are not supported by regular solity smart contracts but in vayer we introduced two type of smart contracts the first one is prover and prover allow you to do the offchain computation with your private data and there you are using this functions like set Block Set chain verify and so on and then the outcome of this smart contract execution inside ZK evm is a cryptographic proof and that proof works on regular solidity smart contracts that are deployed to any evm compatible blockchain for example your verifier smart contract May take the proof verify it and every if everything is fine with the proof then the rest of your custom logic can be executed I think the best way to show it to you how this works is take a look into the code so here are our docks I highly recommend you to check them out here on the screen right now you can see the URL to these dogs and also QR code so feel free to jump in and then we have all you covered um you can see how to install V layer what are the first step what are the requirements and then you can navigate to how it works section in which we are explaining in details how prover and verifier smart contracts are working together now I will show you how you can download fayer into your system and start coding all the details about that are in our documentation I will start with installing our CLI and now I will initialize a new project using template called Simple teleport the reason I'm doing it is that I'm not want to start from scratch but just have some example of how to use teleport you can do it yourself or you can just check the docs for more examples okay looks like the project is ready so now I will open my editor okay so now I'm into newly created project the main uh interesting directory is vayer where we have the script that is responsible for deploying Rover and verifier smart contracts and then running an example proving so we will try to prove something and then send that proof to the verifier and see if that works another directory Worth to check is here because here inside this directory you can see prover and verifier contracts so let's uh try it out before I will just make sure that all the contracts are built so I will use for build then I will navigate into the V layer directory in which we have our testing script and I will just make sure that we have all dependencies installed by running B install I'm I'm using ban here but of course if you prefer use regular node.js then there is no problem with that in the separate terminal session I will also run local blockchain called anvil and now I will run the proving script and now you can see that the verification result is success but let's take a look into the code and let's see what actually happened there what happens in this script is pretty straightforward we are just importing test helpers and create vayer client from vayer SDK the test help are a bunch of functions that allow me to deploy the prover and verifier to my local blockchain and then once we have a prover and verifier deployer deployed to the local Anvil we can finally ask vayer to generate proof for it so here you can see that we have logic that we are actually sending the prover address and the API of the smart contract and we are running function called cross chain balance and this function is just iterating over the three tokens on separate uh blockchains here we have mainnet base optimism and this just gathers the total balance across these three chains for the owner that we are passing here and then we are just sending the wallet address and the chain ID in that specific situation it's just the Anvil that Lo runs locally on my machine and then we have to wait for the proving uh result and then once we have the result of the proving which is the proof we can finally deploy our verifier and run the claim function by sending the aove into it and in the last step we have the status of our verification that's all what we prepared for you today if you find it interesting I highly recommend you to join our Discord server and check our docs thank you for watching and happy coding
Automatic transcript — names and jargon may be misspelled.