Incubed: The Stateless Crypto Economic Client for Ethereum
EDCON 2020 · 11 Aug 2020 · 12:37
Steffen Kux of Blockchains LLC gives an EDCON 2020 talk on Incubed, a stateless, fully verifying Ethereum client. Nodes register with a security deposit; a client verifies answers with Merkle proofs and block hashes signed by other nodes, and wrong answers cost the node its deposit. He shows bindings for JavaScript, Python, Rust, Java, C# and C, a footprint of about 300 KB, and a roadmap with the incentive layer planned for Q4 and Bitcoin verification nearly finished.
Speakers
Topics
From EDCON 2020, hosted by EDCON.
Transcript
My name is Stefan Cooks. I'm the Director of Software Development at Blockchains.LC. Last year in Sydney, I already had the opportunity to speak at Edcon and present the working status of the Incube protocol and the Incube client. Today, I want to focus on the importance of stateless but fully verifying clients for the Ethereum ecosystem and present the productive Incube protocol and existing tools and APIs which enable developers of web-mobile IoT applications to interact with blockchain in a secure, decentralized but resource-saving way. For those of you who may know me or Slugit, most likely you have heard that Slugit was acquired by blockchain's LSE last year.
Now that the integration of the two companies is complete, Slugit is working as the root man-lab for the company, now under blockchain's name. Our vision and mission, and some of you may remember the presentation of Jeffrey Burns, our CEO at Prague in 2018, is to reimagine and to build the infrastructure and tools needed to empower individuals to manage their digital assets and identity. A decentralized and secure way to interact with blockchain without intermediaries who must be trusted or who could be the single point of failure is an essential part of our solution. With Incube, we provide a stateless client which can verify all information from blockchain by itself with a crypto-economic security but without the need to synchronize all data.
This client is with about 300 KB and very low connectivity needs the smallest Ethereum client available. It can be used effectively in web or mobile applications, but especially it is also meant to be used in IoT devices, which usually have very strict limitations in terms of storage, computing capacity and transmission benefits. When Ethereum was concepted, the vision was to have a distributed peer-to-peer network of independent nodes with synchronized state of the blockchain, and having accessed the apps using DS nodes completely without any centralized services.
In fact, the need to access this information from any kind of application, like web pages, smartphone apps, or IoT devices, in the past it seemed to be necessary to use centralized remote servers because in most cases this is hard or even not possible to run a synchronizing node or even a light client in this application or device. But it is a kind of paradox: we connect to a decentralized world using centralized service. Another problem is that such a remote client needs to trust this service because it is not able to validate and verify their received information. However, centralized remote services are and must be a bridge technology only, and now it is time to go to the next steps.
The solution is to use stateless, verifying clients. Such clients do not synchronize block information, but use proofs and validation signatures to verify and validate all information autonomously. Blockchain LLC introduced and released such a protocol stable on mainnet as Incubed in January 2020. Usage of such clients combines the security of a light client with the advantages of a remote client, at least for the most common IoT solutions and mobile and web applications. With Incubed it is possible to connect devices and applications completely decentralized without any centralized instance and with crypto economical security.
Any active full node can potentially participate by registering in the Incubed registry and logging a security deposit. In addition to the blockchain node like Geth, Obiterium, LetterMind or others, the EM3 APA layer is needed, which passes the Incubed request to the node and returns to results, proofs and validations to the requesting Incubed client. The Incubed clients can access this list of potential nodes to communicate with them. Out of this list, they select the nodes they need to communicate. If an information is needed, the Incubed client selects one of the nodes and sends an RPC request similar to a remote client to that node.
This node is selected randomly with some additional rules. The same node is never used for subsequent queries. The Incubed client now receives the response from the node. In addition, it receives the block header and the necessary mobile proofs to be able to verify independently that the received information belongs to this block. At this point, the client knows that the information belongs to the block but cannot independently check whether this is actually a correct block of the blockchain or not. To do this, the Incubed client selects additional nodes from which it would like to have a validation.
The only information we can check on-chain in the past and we need to do this on-chain to convict misbehavior and directly contact directly is the block hash. Therefore, the client asks one node for the information and requires the validators to sign the block hash of the corresponding block. With this information, the Incubed client can now independently validate that this is a correct block of the blockchain and the received information is part of this block. If a node signs a wrong block hash or delivers wrong information, it will be convicted in the registry, will lose its deposit and will be thrown out of the network.
With this, we have a cryptoeconomic security that the transfer of incorrect information for the node means the loss of its deposit. On the other side, the client can decide which and how many nodes it asks for validation. Every signed information is checked always and if misbehavior is detected, the convict process is started automatically. Additionally, it is possible to run watchdog nodes to actively scan the network for misbehavior nodes. The second part of the cryptoeconomic model is an incentive system for nodes to receive a micro payment or better, a nano payment for signed information. With this, the client pays the request or bundle of requests for verifiable and validatable information.
As we are on a developer conference, let's have a look into some code snippets in various languages to see the easiness of using Incubed in the daily programming work. Our initial focus was on the use in small IT devices based on microcontrollers. To be integrated into their firmware, embedded C is the only real option. Therefore, the complete client code including the EVM is implemented in C. The Incubed core libraries, which are available as open source, contain interfaces for connectivity and data transmission, verifiles for Ethereum, IPFS, and Bitcoin, which is not yet released, APIs to access RPC functions in the firmware way,
and bindings to different common programming languages to make Incubed available for any kind of applications. Today, I will focus on these bindings by going over some code snippets to show how to integrate it into software projects. As mentioned before, the footprint of Incubed is very small, starting with about 300 kilobytes and no additional external dependencies. As said, everything is based on our C code, which is interfaced into languages like Python, Rust, C#, and Java, or translated into WASN to be available in JavaScript too. By the way, as stated on the previous page, there are zero dependencies also for the JavaScript WASN version, which makes it easy and secure to be integrated in web pages or mobile applications.
As JavaScript is commonly used in the crypto community, I will start with this. After installing the NPM package EM3- WASN, the client can be instantiated and used coin the API functions. All the protocol features like which nodes to select, checking the proofs and validations, blacklisting nodes with bad performance, convicting misbuilding nodes, and so on, doesn't require developer interaction. Although, it can be tuned and configured manually if needed. Users of the Web3JS library can switch to Incubed by simply changing their HTTP provider using the Incubed client instead of the local client, or connection to a remote node.
This is shown in the second box. IoT devices for C and C++ applications can use the C libraries directly. After instantiating the Incubed client and defining the data transport protocol, an example is configured, the APIs can be used. The memory usage, of course, depends on the functions which are executed. For instance, a complete smart contract call may take much more resources than simply a check of a confidence. Nevertheless, a fully verifying client runs with less than 128 kilobytes run usage.
For Python, the pip package, IM3 is also available. The Python client also gives access to the full API. The usage is as simple as in C or JavaScript. Also, Rust developers can integrate blockchain connectivity with Incubed directly by using the Rust binding, which interfaces the C library into Rust. As well as Java developers and C#.NET developers. Other platforms and languages will be added soon.
I would like to emphasize one more thing. Besides the binding of the different programming languages, there is also the EN3 command line tool available, which allows you to interact with Ethereum directly from the console. Integrate blockchain interactions into scripts and so on. Additional help functions like signing with private keys, including interaction with hardware wallets, are also available. Remember, no synchronization is needed, just running the command. As summary, let's have a look at the roadmap and how to access Incubed resources.
During the last two years, we developed the Incubed protocol, the client and the node software. After the security audit end of last year, the stable version of the Ethereum mainnet was launched in January this year. Since then, we focused on making Incubed available for as many as possible platforms, including the presented Python, Java, Rust and .NET bindings. Those were and are published in implementing releases. The verification of Bitcoin transactions on Ethereum is almost finished and the incentive layer is in work also and is planned to be released in Q4 of this year. After this, the integration of ETHTOUR and other blockchains and verified protocols are scheduled for 2021.
Last but not least, here is a list of some important resources. The full Incubed documentation, including APIs, examples and so on, you can find at 3.2.docs. Source codes for the node, the client and the bindings to the presented platforms you can find at GitHub. The code is available as open source or dual licensed with a commercial license if needed. Also, we invite everyone to register his or her note to the Incubed network.
To make it easy, a visit at im3-setup.blockchains.com is available. Please don't hesitate to contact us via Twitter, email or other media if you have questions or need support. Thank you very much for listening and watching.
Related talks
- slock.it and stakefish Keynotes (Combined Recording)
- Verkle integration in reth
- Incubed Client - The Smallest Minimal Verification Client
- A Yellow Paper you can run: an independent executable EVM spec in Lean 4
- #274 Alexey Akhunov: Ethereum 1.x – BUIDLing Things One Step at a Time
- Off-Chain Execution Environment for Testing & Profiling of Smart Contracts
- Parallelizing EVM Transaction Processing | Gary Schulte - Besu
- EVM-C: Portable API for Ethereum Virtual Machines
- Killing ETH - Finding Consensus Issues on Layer 1
