XDC Subnets

ETHDubai 2025 · April 2025 · 33:01

A workshop explains XDC subnets, private EVM networks, checkpoint contracts, and relayers. The deployment walkthrough configures Docker services, validators, and an explorer, then uses a recorded Subswap demonstration to show token transfers between a subnet and the parent testnet.

Speakers

Topics

From ETHDubai 2025, hosted by DeFi Dubai.

Transcript

Yeah. Uh, hi everyone and thank you so much for coming. Uh, my name is one visit and I'm a uh core blockchain engineer at the XTC network. Uh, and today I'll be u talking about the XTC subnet and also uh showing uh some uh demo uh afterwards. Um so uh to put simply uh XCC subnet is like um layer two uh layer 2 blockchain uh scaling solution uh from XC network. Uh you can also uh use it as a private blockchain. Um uh yeah and uh and and yeah before we go deeper into

the subnet I also want to talk a little bit about the FCC network. Uh so what is the FCC blockchain? Uh first uh FCC is like a is a layer one uh EVM compatible blockchain. Uh it's been running since uh 2019. Uh we are open source uh carbon neutral and uh enterprise uh grade uh blockchain uh platform. So um how XCC tries to grow its uh token value is by partnering with uh many ecosystem projects. Uh we have uh uh more than 40 partners uh on our chain uh in many areas like the RWA uh

tokenization and trade finance. Uh just to give some example uh like comp tech gold code is the RWA for gold uh tokenization or fatom is like D5 protocol for lending and borrowing on the XC chain. Um and as for the user side we also are compatible with most uh EVM uh wallets uh Metamas OKX wallet uh by frost and so on. Uh and uh for the exchanges we are listed on uh many big exchange like uh bitcget uh bitru uh bitfinex uh and uh maxi uh yeah so that's uh like an overview

for the xC network uh and now uh on back back to on the subnet uh topic uh socc subnets uh is a layer two uh xC layer 2 blockchain uh solution. So uh it's uh suitable for someone who would like to uh have full control over their own uh blockchain infrastructure and their uh uh and the code base and the uh environment surrounding uh their projects. Um uh and and it's is you can also uh it's also up to you whether you want your blockchain to be private or public or however uh the exposure you want to

uh do on the chain. So uh from from that perspective it's like you have uh a lot of control over the security aspects or how you want to um uh build build the product around it. Yeah. So the main things uh so one is privacy, second is more security and third uh sovereignity which is uh your you have the full control. Um yeah so how uh from the tech next is from the technical perspective how does the uh uh how does the subn network uh to as a private blockchain and how is the uh blockchain secured. Uh so the concept that we use is we is

called like a soaring row up. Uh so row up the the main point of this is to keep um to keep the checkpointing data on the XC mainet. Uh check checkpointing data represents like the the block hash of your of your XC subnet. So if you keep checkpointing the your your latest blocks of of the subnet onto the mainet then uh it can be you can be secure and make sure that the subnet uh is irreversible and uh not not being attacked right. Uh so that is the concept and uh and to to achieve this there is a two components that is required. First is um the checkpoint

smart contract uh that is deployed onto the XC main chain. Uh and the second component is the relayer which is like the middleware component that keeps on uh passing the subnet uh block headers onto the uh onto the main chain for checkpointing. Um but uh an important point here is that on the subnet the the block data itself or your own private transaction data or any user information is not released uh into uh into the XC uh mainet only the the hash of the data or the block header will be stored in the mainet. So it it is still completely private blockchain. Uh while we while we utilize the the mainet uh decentralized

security to secure the the subnets uh block contents. Okay. So that is on the uh roll up concept. Um right so uh on on the subnets right. So again why why are we interested in the in this in this private blockchain solution? What is it suitable for? So some of the use cases maybe on one is the payment solutions. Uh for XTC we have a very fast uh block finality. So we have a three block finality and each block is uh two seconds. So in six seconds uh your your data it will be committed forever onto the blockchain. So this is maybe

suitable for like a payment solutions kind of project. Uh second is on trade finance or the supply chain projects. uh and also maybe some sort of like uh any any kind of like a tracking um uh tracking data where the data has to be uh privatized such as like healthcare data or like identity uh ID data uh and also we have some example projects that that we are partnering with uh in the development phase. So first is uh on the sensibar national blockchain they are uh looking to use the subnet for like for private blockchain database uh for the

citizenship identification. Uh second also we have the de telecom uh we are partnering with them and they exploring the blockchain use cases uh that might be suitable for their company. Uh okay. So uh advantages right more more advantages for the subnet. Why would you be interested here? So again it is private, it is secure and it is uh customizable. Uh also the XC blockchain is EVM compatible and so is the subnet.

So I think EVM is the most uh standard uh that is um also very um easy to migrate uh the projects uh and also yeah again fast penality is all six seconds on the SEC chain. Uh the subnets can also save the cost on on transaction fees because the transactions are happening on your private chain instead of on the on the mainet where you have to pay real tokens. Um yeah and project is open source and free to use and uh explore. Um we also provide uh many ecosystem ecosystem tools like the explorer and uh also the deployment is um is very user friendly. You can uh

start your own subnet in in 10 minutes using your own infrastructure not based on any specific cloud. Um yes and also we pro we also have this uh crosschain module provided by default uh it's called the sub swap. So sub swap allows you to uh send over tokens from the subnet onto the mainet and also send token back from mainet uh to the subnet. Uh okay. So yeah, this is just a um picture of the of the example for the deployment UI that I will show you a demo uh after this presentation. Uh yeah, so it's like uh

yeah, you you'll see how it works. Uh and this is our uh subnet explorer. Uh you can see that we have the the blocks uh on the subnet and also the checkpointed blocks. So you can see how how much of the subnet is secured on the main chain. Uh and this is the uh this is the the crosschain framework that I was talking about. Uh we also have the UI provide for uh token transfer.

Um okay. Yeah. So uh if you want to check out more on the subnet uh we have the documentation link uh at the docs.xcc.net network and the deployment guide is also on the same uh documentation page just uh you can find it out on the clicks and uh this QR will also lead you there. Uh and yeah if if you guys have like a Mac machine or a Linux machine you can also follow along uh with me for this demo to showcase uh the sub subnet deployment. you can start it in in your local machine very easily. Okay, let's see. All right, so uh that's for the presentation and now I'll I'll move on

for the demo. Um okay so here uh in this page uh on the on our web documentation site XC subnet and the deployment guide first uh launching a subnet in 10 minutes. So uh this one will work on the on your Linux server or on the Mac machine as well. Uh we have some hardware requirements and the video walk through.

This video walk through will be the same as what I'm try I will show you right now. So yeah, you can also watch the video uh later on. Um okay. So how do we uh start this defy bin UI? So first uh uh we uh pull this script and run it. Sorry. Okay. So, what's happening in

this script is that it will start a Docker container. Uh, oh, sorry. And one of the requirements is that you have need to have the docker installed in your machine. Uh so it will start a docker container uh for your local web server uh behind the scenes and this local web server will manage all your um all your all your subnet deployment. Uh okay. So you can see this uh subnet deployment wizard uh and there are the steps to follow and also on the right side uh we have the monitoring status to see see what is happening on all your other containers. Um right so on the first one we can select the subnet configuration.

Uh there are pre predefined configurations or if you want to customize your own subnet um uh there is this this more like detailed page where you can do more inputs. Uh but for the demo uh let's try the uh one node subnet uh with sub swap uh on test net. Okay. So after the step one the configuration will be generated and uh and there are uh if you see your deployment folder there is this um many files are created that is necessary to run the subnet.

Um okay so after that uh just start the start the subnet and the and the container uh will be running uh on the background and we also have this uh deployment log uh not the command the command log uh that shows the result under here. So uh yeah after after we start the subnet and we want to make sure that the subnet is mining uh meaning the block is increasing and the nodes appearing and uh talking properly. So um yeah this is the monitor status if it is mining and on the right side you can also see the blocks are going going up. So yeah, so

now this is working uh to step three. Then we also we we need to add uh some test net tokens to our relayer wallet. So again the relayer is the component that pushes the subnet block headers onto the parent chain uh which is test net in this case. So in test net you can request for the free token for testing. So, I'll just get some tokens onto this account and also on this account. Okay. Yeah. So next we're going

to deploy the the parent chain uh smart contract the sharepoint smart contract the since we request the uh the token just now we have we are funded to deploy this contract. Um and yeah actually before before uh I came up here I did some testing and I think the default URL is maybe having uh some connection issue.

So when I was testing I tried some another URL which works which is uh this one PC. URL. Uh so uh I think we might have to do some uh switching RPC for the default URL. Sorry about that. Let's try this. Oh, okay. Now, now you can see we

deployed uh the checkpoint smart contract. Uh and yeah at this step the the deployment wizard will will also auto auto to configure your your configuration files. So there is no no action required. So the all the configs are uh input uh by default. Uh yeah. So next we deploy this other contract uh reverse checkpoint smart contract. Uh okay looks like this is successful too. Uh and finally uh we

deploy sub swap uh again sub swap the crosschain module that will uh make you able to transfer uh tokens between the uh subnet and the mainet. Um yeah and and this deploy will there are multiple contracts and steps here. So it might take like uh two or three minutes to complete. So yeah we just wait here. Test this.

Oh. Right. Right. Yeah. So how how much you can expose your data, right? Yeah. I think I think yeah it's pretty much it's up to you. So there are many things you can do here. the like the first thing is maybe you can build like a middleware uh middleware for your like um for your subnet uh query right so let's say you want to query uh the block data but then you you build some API middleware that will only filter out like the contents and only share what you want uh the second thing is maybe you can utilize this crosschain uh

crosschain concept where you only push out the data that you want to expose onto the main chain and then you and carry the main chain contract or something like that. Mhm. Yeah. Yeah. It's still going. Uh you mean the parent net RPC, right? Yeah. Yeah. No, definitely it is very it is uh in the production environment you would want to have your own uh parent RPC.

Yeah. Uh okay. Yeah. Looks like the sub swap module finished the deployment. So now we completed all the contracts uh all the required contracts. Now we just it's only the containers that is required uh the only left is the to run the containers that is required for subnet. Um okay so uh next we start the services. Uh so what are the subnet services right? Uh number one is the relayer. This the most important because this one secures our subnet data onto the main chain.

Um yeah uh the re layer and the the second we have is the stat server which is like the backend web server and then we have the UI which is uh kind of explorer mean like a mini explorer for the subnet. Um okay so yeah for the for the UI it needs some startup time. So yeah let's wait for the startup. Uh and for the relayer uh you can see uh there are like uh job cues for each of the smart contracts. Uh and you can see the status uh can see the log for example. Okay. So I'm just waiting for

the UI to show and okay it's here. Um yeah so uh on the on the top chain uh is the is on the subnet chain itself like the blocks that are running how many blocks have been mined so far. So you can see it's about 230 since we launched. Uh and on the second line is on the on the checkpoint. So which blocks are which blocks are already recorded onto the parent chain uh which is the test net. So now it's 190 blocks.

So it's about like 40 blocks behind uh the the subnet subnet blocks but it will catch up uh like uh like it's supposed to be catching up like not not behind more than like you know 30 blocks. Yeah. But uh since we just launched the relayer so yeah it will take some time. Um, all right. On network info, the block time is supposed to be 2 seconds. Uh, and then you can see the the RPC that you are checkpointing to. Uh, next is the relayer info. I'm not sure why this is not loading. Maybe because the URL we change, but it it it is supposed to show the contract address and then the uh the amount of the w the uh parent net tokens that are remaining in the

wallet. Um, yeah. Uh and then the master nodes, right? Then this one is like how many how many nodes are running your decentralized subnet. So uh in this demo, I already use one, but uh in this real scenario, you probably want like three, five or even more. Um okay, so these are like just like the the block information. We have the block hashes and the who who is the validator that mines the block. Um yeah. Uh and we have more things confirmation checker. This is like when you search for the addresses and the order blocks on the on on the blockchain. Uh and on the management uh you can also do more things like um uh

adding more validator nodes onto the onto your subnet or removing it. Uh something like that. Um uh yeah. So uh also a little bit more on the subnet um authorization right so who who who owns and who controls the subnet right usually we have like a set of validators and there is no single owner but for the subnet uh it is it is a product that is meant to be owned by by a company or a project. So there is uh there is a master a master owner and we call that the grandmaster in the subnet.

There is like a grandmaster that that has the ability to um uh to add more validators or remove validator. So all the power relies on that one uh on on that address and uh that address is generated uh during during when we create the configuration and you can check the address by going to this file uh keys.json. JSON. So this will be your uh your super owner of the subnet this grandmaster key this account.

Um okay so uh so we show the UI. Uh next uh I will we next next I will start up the the sub swap uh front end service. Um but I think uh I think I might not be able to showcase the the actual swap today because we the we switch the RPC URL and and uh that RPC there is some red limiting uh to it. Uh I I saw in the log before there is some red limiting to that RPC. So I think uh I cannot fully show the the token swap uh but uh I I I will show show the

video um of the token swap on that part and Okay. So, UI looks something like this.

Okay. Yeah. Um, sorry. Let me just uh play the video for this part. Uh yeah. So in this video uh tutorial is the same as what what I'm showing just now. Uh and on and when we are here at the at the subs part. So we what we have what what happens is that we take the uh grandmaster wallet and then use that wallet to add it to the metamas. Uh and there is the there is one sample token

that was deployed during the sub swap deployment. It is deployed with the grandmaster wallet just as a demo for so so that you can play around if you if you want to test out this this uh feature. Okay. Yeah. So here I'm just taking the wallet and adding it to Metam mask. Yeah. And here I'm connecting with the

wrong wallet. So yeah, I'm just trying to uh switch it up to the Grandmaster wallet. Um and then the next thing you also have

to add the add the subnet uh local URL. Uh and because uh in if if you try the deployment many times you also need to remove the old older deployment and add a new one. Uh yeah. Yeah. So here I'm add let you need to add a new network uh on on the new deployment. So the the default uh RPC will be the port the 8545 uh as like as the EV Ethereum ecosystem is using Okay. Then go to the select token. Then

you can see the sample token uh that that we deployed for testing and it will have the uh 1 million uh token by default. So here I'm sending about half of the supply uh to the to the test net. uh and also one more thing you can

select the receiver uh on on this option that is showing here and but and by default you're sending it to your own address uh to to the same wallet address but on a different chain. So here subnet to the test net. Um and also it it can take some time for the for the transaction to arrive uh on the another chain. Uh because the the relayer the relayer needs to be pushing the transaction and there are like um the contracts need to verify proof and wait for the block to arrive and so on.

Okay. So now I'm checking the the uh uh the token supply on on the parent chain. Yeah. Also in the locks you can see the sync the sync complete. Okay. So on test net uh I receive around 500,000 sample tokens.

Um, and then next I'm just going to transfer back some of this token. Uh, around half of it again, 250,000. Uh, and another thing is that uh when when we transfer back, this is on the test net. So, we will need some test net test net gas uh onto the transferring account. So yeah, here I'm just requesting more gas and then uh making the transfer again. Okay, so I'm just skipping forward to make it quicker. Okay, here you can see in test net my tokens are already uh gone half of them. And then on the subnet uh here the log is showing sync

complete. Uh and then when we just check the balance uh you can see around 750,000. So yeah uh this is showing uh crosschain transfer uh birectionally from subnet to test net then test net back to subnet. Um uh yeah and that's pretty much uh the subnet showcase uh subnet showcase and yeah presentation that I want to show.

Yeah. So thank you so much and uh I'll be around uh right here for a while and also uh you can catch me at the FTC booth. It's