Incubed Client - The Smallest Minimal Verification Client

EDCON 2019 · 12 Apr 2019 · 15:15

Steffen Kux of Slock.it presents Incubed, a minimal verification client for Ethereum and other blockchains, aimed at IoT devices and apps that cannot run a full node. Clients request data from registered nodes that stake a deposit, and check Merkle proofs and signed block hashes, with misbehaving nodes penalized. He describes nano, micro and full editions, a TypeScript version and a C version of about 200 kilobytes or less for the nano edition, and a roadmap with an incentive layer still to come.

Speakers

Topics

From EDCON 2019, hosted by EDCON.

Transcript

Next up we have Stefan Cux and he's the head of consulting at Slocket and he's going to be talking through the Incubed client and how that works so please give me a hand welcoming Stefan. Yeah good evening it's late but I hope you are open for some very interesting information so who Slocket knows so we are working with IOT devices and we try to connect IOT devices to blockchain and what we have done with Incubed is to build a solution that we can build or bring a client into a smart IOT device and today I want to explain how the protocol is working.

Several months ago there was an interesting tweet on Twitter from Afri Schoeten from Parody it says if we don't stop relying on Infura the vision of Ethereum failed so and when you think about it so when Ethereum started this was the vision so we have a decentralized network we have decentralized apps which access the nodes of the network and in this way we have a good decentralized system but this situation how it looks like today we have a decentralized system yes but we accesses via a centralized access so at this time of course we have gratitude for the work which was done from Infura on other services that we had a solution to access the blockchain but now we the system gets

much much much much more mature and we have to go the next steps so that we have really a decentralized system to access the blockchain information so when we talk about IOT there we have a lot of different IOT devices so of course we always have our computers have smartphones these are IOT devices of course but then we have industrial controls or ECU from cars these are much smaller IOT devices they are made for rough conditions of course but the power they have is not that much so then we have the high high-performance IOT like Raspberry Pi platform platform and other platforms but these platforms but these platforms are also very expensive and have a lot of capacity

but most of the IOT devices are running on microcontrollers so when you think about a smart meter a door log or something like this then we have very small computers in it so and we are not able to run a full client on these devices so what what do we need so we need to read information from the blockchain in a secure way so we need to interact with the blockchain and and then we think about having a client then we need all the information from the blockchain in the secure way and when we look how it works now then a lot of the devices or a lot of software using remote clients that means we have a server somewhere and interact with the server but the device by itself cannot validate the information so then we think also in the IoT world we have a lot of cloud so centralized services which control these devices

and also when you look at our smartphones so there are almost not not one single application which uses a client running on the smartphone what would happen if I run a light client order or a bigger client on my phone so the battery would be empty half of the day so when we cannot use such clients to have a secure connection to the blockchain and we also discussed it today so when we have web applications then also these web applications are not able to run a client directly and so for this we had the missed browser so you know missed browser is cancelled so there is no missed browser anymore available so and most of the web applications all which need information from the blockchain also use remote services to access this information

so but this is how it should look like so we should have a client we call it a minimal verification client which connects decentralized completely decentralized and secure to the blockchain network so what we mean with a minimal verification client so first I start what is this not so a minimal verification client is not part of the peer-to-peer network it is stateless this means it doesn't synchronize the information of the blockchain directly so it's made to have a minimal resource usage and communicates only with RPC requests so a little bit similar like a remote client so but it should be completely decentralized and interesting characteristic of such a client is also that it is blockchain agnostic

that means it can communicate with different blockchains at the same time so but the important thing is that this client is that this client needs to be able by itself to verify and to validate that the information from the blockchain is correct so let me short explain how it works so the main center of this system is a registry it's a smart contract on the blockchain for instance if you go to the public Ethereum blockchain it's a smart contract on Ethereum and every node which is a full node can register in this smart contract by giving a deposit a security deposit I explain why we need this later and then every client can access this list of possible nodes which he can interact with so what is done when the client needs the information

the client selects one of these nodes in this example node B from the list and sends an RPC request to this node this is similar like I would use a remote client and as response from the node I receive of course the result but additionally some other information which I can use to prove that the information is correct this is for instance the Merkle proof in the block header and with this information the client can by itself verify that the information it receives belongs to this block so at this moment of course the client doesn't know if this is a real block or if this is a fake block and that's why in the request he also sends a validation request to other nodes

and that means for instance in this example he asks that node A and node C should sign the blockage of the current block so with this information the client by itself can validate that the information belongs to a block and that this block belongs to the blockchain and so the client can by itself verify that the result is really correct so in this system also there are virtual or real watchdogs so a virtual watchdog is for instance this node B when he receives the answer from one of these nodes which is not correct then he can go to the registry and convict this node for misbehavior and then this node is drawn out of the registry and loses his deposit

and with this information I know when such a node has a deposit in a in a specific size maybe 100 euro or something like this then I know within this interval he is not able to lie because then if he would lie he can be convicted and loses his deposit Of course if the only thing which can happen to a node is to lose something nobody would be incentivized to build such a node and that's why we also are going to implement the incentive system that means if a client receives such a signed information then he sends a very small payment a micro payment to these nodes so that they have incentive to give this information

So we have already three editions of this client the smallest one is the nano client this client only is able to validate that a transaction is really part of the blockchain for a lot of applications this is enough but if he needs information from the storage or from balances or accounts then the micro client is the good solution and when the client needs to interact with the blockchain that means that it interacts with smart contracts then the full in cube client is available and this in the client has also the evm inside so that he can validate also all in all transactions which interact with smart contracts

so we are the global conference that's why i want to show some pieces of source code how such an in cube client is used so the first implementation we have done in typescript javascript so that it can be used of course this is not for iot devices because typescript is way too heavy to use it in in iot devices but for web applications or smartphone applications this is a good solution and as you can see when you import the in cube package then you can create a in cube object and interact with this object to set calls or send transactions and so on and most of us are using the web3gs library and with this library is way more easier the only thing we need to do is to

change the http provider to the incubate client and then all the code can stay the same and we can use the encrypt system instead of a centralized system or a local client which can be addressed so and to be able to bring it into a small system like a microcontroller then we have also this year c plus plus implementation and as you can see here with this implementation is very easy to access the blockchain so we have a wrapper for ethereum comments so that we can construct an incubed object and then access these functions to interact very easily with the with the blockchain

so what can you do to participate in this of course everyone can run such an incubed node that means if you have running a guest client or parity client or any other client which implements the eip 1186 then this can be used and additionally there is a piece of software which runs on this computer to have this interface this api to the incubed protocol and if you want to have it easy there's also a docker image available to install and run such an incubed node and of course you can include incubed within your application so as i showed in the source code it's very easy to change from an existing version when you use web3 for instance you only have to swap to the

en3 implementation so then you can use incubed instead of any other http provider and if you want to go into iot devices then the c edition is the right choice because this is very small implementation and we have implemented this that it can run on a small microcontroller so let me give some conclusions some outlook so only one page for statistics so this is the size of a client so of course gas and parity of big implementations they take about 16 megabytes and then you look at the incubed c implementations so we

talk about 200 kilobytes or a little bit less if you have only the nano edition that means with this small amount of memory less than 200 kilobytes we can run such a minimal verification client which can interact securely with ethereum let's look or let's have a look on the road map so at the moment we have launched the test implementation so it's available on the main net also on a lot of ethereum-based test nets so that it can be tested how to interact with the system so we plan for the next or for this quarter for the could two of this year that we release the the running or the productive system one

and then during the next month we will implement also this incentivation layer this is not yet completely available and then looking to the end of the year then the productive launch two will come where also the incentivation layer is available okay a short conclusion with the incubed client we have the smallest client which can securely interact with ethereum so no other client is that small than the incubed client and the incubed client is completely decentralized and stateless can verify all the information by itself yeah it can interact with more blockchains than only ethereum so you especially when you think about

generation three blockchain systems then with this one client we can interact with multiple chains at the same time yeah and it's available now in c in the typescript javascript but it's planned also to have a release in other languages okay thank you very much if there if you have any questions find me we can discuss it thank you

Related talks