Best DeFi dApp on Rootstocks - ETHOnline 2024
ETHGlobal·Wed, Oct 9, 2024, 12:00 AM
Join us for a workshop with Olia titled, "Best DeFi dApp on Rootstocks" This workshop is part of ETHOnline 2024, an async hackathon that takes place from Aug 23 – Sept 13, 2024. ----------------- Follow us: https://x.com/ethglobal Check us out: https://ethglobal.com/ Email us at: hello@ethglobal.com
Transcript
Okay, thank you for coming and joining us. I apologize for the delay. There are always some technical issues, but in the next session we will talk about building EVM- building EVM- decentralized applications on Bitcoin using Rootstock. My name is Oya. I lead the development team at Rootstock Labs.
You can find me pretty easily on most social media platforms, except for Discord, where I go by the nickname biddfw. So feel free to contact me if you have any questions or need technical or other support regarding your projects. I have attended several global hacking events, and this is the first time we have brought Rootstock to this event. So I'm very happy. Well, okay.
So, in these 20 minutes, we're going to cover a few things, mainly: I'm going to briefly talk about the Rootstock architecture. We'll cover the ecosystem, smart contract and application development, and development tools and resources to help you build on Rootstock. And then I'll talk a little bit about a recent project we've been working on within our development team . Okay, let's begin. What is Rootstock let's begin.
What is Rootstock ? Rootstock is a Bitcoin sidechain. This is the first and oldest, true " true " old-school" Bitcoin sidechain. We have been operating in the main network since 2018. That is, for about six years now with 100% six years now with 100% trouble-free operation trouble-free operation , which we are very proud of.
What makes Rootstock special is its full compatibility with EVM. So, developers can write smart can write smart contracts on Solidity, and all developer tools will work just like on on any other EVM- any other EVM- compatible chain. I'll delve into that a little later. Finally, Rootstock is secured using merge mining. It is mined alongside Bitcoin, and I will explain how it works in the following slides.
Let's delve a little deeper into the architecture. RSKJ, which stands for Rootstock Java, is a node, the main component of the chain. It was originally forked from EthereumJ; you can find the implementation on GitHub, it is open source software with a license. We welcome community contributions via pull requests on GitHub, so if you're interested, you can check it out. The RSK White Paper is also available on the rootstock.
io website. Uh-huh. RSKIP rootstock.io website. Uh-huh.
RSKIP are proposals for improving the Rootstock network, very similar to EIP Rootstock network, very similar to EIP , they are open source on GitHub; it is essentially a source on GitHub; it is essentially a set of files in markdown format that anyone can view under the CCA license. There is also a forum for discussions; it's a bit more user-friendly and structured by category, if anyone is interested. Okay anyone is interested. Okay . Let's see how Rootstock is related to Bitcoin.
At the beginning of my speech, I mentioned pooled mining. Pooled mining was not invented by the Rootstock Labs team or anyone like it. This is an existing method. There are many other networks that use it. But, as I said before, Rootstock is the most successful Bitcoin-mining project that has ever existed.
So, here's how it works: Bitcoin miners include changes to the Rootstock network state in the Bitcoin block header. And the complexity of the cryptographic problem required for the Rootstock network is lower than that required for the Bitcoin network. Therefore, some of the headers that don't solve the problem for Bitcoin are still valuable and valid solutions for the Rootstock network. You can learn more about how pooled mining works. There is a lot of interesting stuff on the site , you can read about architecture, but I think that's all you need to know for now.
Another way to describe Rootstock's connection to the Bitcoin network is through cryptocurrency. So, Rootstock has no subsidies. We don't have a separate token. Therefore, gas fees on the Rootstock network are paid in RBTC, which stands for Smart BTC; In essence stands for Smart BTC; In essence , it can be considered a wrapped version of BTC wrapped version of BTC . The bridge used for this is called PowPeg.
This is a Proof-of-Work PEG, and it is actually a federated bridge protected by Proof-of-Work and HSM mechanisms. So, it works in a way that provides two-way conversion between BTC and RBTC at a one-to- one rate. Again, there's more information about this in the documentation if you're interested in such things. Now let's look at Rootstock's connection to Ethereum. That's why we're here.
So, RVM, which stands for Rootstock Virtual Machine, essentially uses the same opcodes as EVM, making it fully compatible with EVM. So all Solidity code and all smart contracts can be executed using RVM. And not only can you write your code in Solidity and smart contracts, you can also use all the tools you're already used to. If you've developed in this area, frameworks like Hardhat, Foundry, Wagmi—all of these will work, and from a user perspective, a Rootstock node provides the same JSON-RPC interface as an Ethereum node. So you can easily port DApps from Ethereum- port DApps from Ethereum- compatible networks with just a little configuration change.
Great, RIFF. RIFF stands for Rootstock Infrastructure Framework. This is a set of applications and services that you can find in our documentation. Oh, thank you. This will essentially make your development process on Rootstock easier.
These include things like wallet and RNS. I advise you to read this. There is also an RPC API. You can find it at rpc.rif.
io. And a browser to monitor processes on the test network during application development. This is all in the documentation. Here are a few facts. I won't go into them in depth because I don't have much time.
But I have already mentioned most of the points to you. Something I didn't say about pooled mining is that it's almost 60%. Approximately 60% of Bitcoin's hashrate is also used to secure the Rootstock network. That's a lot. Perfectly.
This is a slide about the system. Again, I won't go into detail. I don't have much time. This seems like a must-have slide for any crypto any crypto presentation. Therefore.
These are the tools I mentioned earlier. You see them on different levels. Smart Smart contract development tools and client libraries, as well as compatibility with EVM and JSON RPC opcodes. I've added some logos here for you. You probably recognize them, these are some integrations that will help you build: we have Thirdweb build: we have Thirdweb , Gelato for contract automation, Biconomy for account abstraction , CryptoDo as a no-code or minimal-code solution, Covalent, Tenderly, Blockscout Covalent, Tenderly, Blockscout , etc.
I have a little demonstration of how to build on Rootstock in three easy steps; this is very basic level, just wanted to quickly show how easy it is. They are also very ugly, I apologize for these slides. They are also terrible. I hope our designer never sees them. In general, we need Node.
js, MetaMask configured on Rootstock configured on Rootstock , and test RBTC that can be obtained from the faucet. If you have any problems, find our team and we will give you test RBTCs as well as Hardhat, Solidity, React, and JS. I'm sure you're all familiar with this. I wo n't go into details. To create a smart contract, we initialize the project on Hardhat.
We install the dependencies and create an .env file where we store the private key. Everything is quite simple, then there is a smart simple, then there is a smart contract on Solidity. It is very basic. It simply accepts your vote for your favorite smart contract programming language.
Next, we update the Hardhat configuration file with the Hardhat configuration file with the Rootstock URL, create a deployment script—and that's pretty much it. We compile and deploy, and everything should work. The most difficult part The most difficult part is the frontend. It is written in React. I'm a lousy React lousy React developer, but it all works.
I'll quickly walk you through it. We are creating an application. We install ethers.js to interact with the chain. We create a voting component.
This is the longest file in the entire repository. Ahem. I won't go into it . It's also quite simple. Next, we update the application component application component .
We update the index. This step is important. We add the contract ABI from the Hardhat project and run the application via npm start. This is what we should get. I'll try to quickly show you if it works.
Not sure. Ahem. Here we go. Let's vote, say, for Solidity. We confirm.
The request is pending, it will take 28 seconds, maybe we'll come back to this later. I guess we'll be able to look at the result in the end result in the end . If I have time. Okay . If I have time.
Okay . What else do we have? I would like to point out something. We have a separate reward for reward for runes on Rootstock. Our DevX team recently created a proof of concept created a proof of concept for the Rune Bridge.
It has basic mint functionality, bitcoin transfer to Rootstock, mint to Rootstock, and reverse bridge. Here is the QR reverse bridge. Here is the QR code if you are interested in the repository on GitHub. Study it, I also added some ideas of what you can build. So, essentially, integrating runes into dexes, creating a marketplace, airdrops, or again dexes for borrowing and lending with runes.
We have a grant program, we just opened a new set, so your development doesn't have to end here at the hackathon. This, this is a pretty great program, aside from the financial funding. We actually have $3 million that we can provide, but we also offer technical support, go-to- market, and generally we take care of our ecosystem. So yeah, if you want to know more about it , find us at the booth and we'll give you more detailed information. I would also like to invite you to join our ambassador program and become part of our community.
All information is on the website information is on the website . We have three directions here. So, directions here. So, any DeFi on Rootstock, the best runes as I mentioned earlier, and the best use of the Rootstock blockchain can be anything from AI to tokenization of real assets, delve into whatever you like. We also have a reward for this.
Here is a hacker's guide that might come in handy. There will be all the documentation and all the resources you might need. But you can also find us at the stand. We will be there to help you. That's all, actually.
Come say hello. We have a stand. Thank you very much for coming, and I hope to see you.
Automatic transcript — names and jargon may be misspelled.