The Nifty Erdstall Demo and future use cases of the Erdstall SDK

Perun Network
PolyCrypt
Published in
7 min readOct 29, 2021

We showcase Erdstall applications and introduce our Nifty Erdstall Demo for you to test. By leveraging a TEE-based Plasma system (Erdstall), we bring highly scalable and customizable functionality to the second layer. With arbitrary programmability and execution within a secure enclave (Intel SGX) we can guarantee untampered execution of arbitrary code. We furthermore give a brief tutorial on how to use our Demo and give examples for Erdstall use cases.

Authors: Marcel Kaiser, Sebastian Stammler

What is Erdstall?

Erdstall is a general purpose blockchain scaling technology based on secure hardware. The idea follows a recent research direction that explores the idea of building a Plasma-like system using a Trusted Execution Environment (TEE). Erdstall, which was one of the winning finalists of the ETHGlobal 2020 Hackathon, is an implementation of this technology and is currently being developed by PolyCrypt. It is neither a sidechain nor a separate interoperable blockchain.

As discussed in earlier blog posts, blockchains ― and Ethereum in particular ― do not yet scale very well and suffer from the resulting increase of transaction fees and confirmation delays. Multiple solutions to this issue have been proposed. The most promising directions are so-called 2nd Layer solutions, which lift the transaction load off-chain. In these systems, users only need to send expensive on-chain transactions to join and leave the system and in case of disputes. All other actions, like transferring coins, tokens or even evaluating smart contracts, are processed without touching the blockchain at no or significantly reduced cost. A central building block of these systems is a smart contract, which holds the funds that are processed off-chain. This contract defines all rules on how users can withdraw funds when leaving the system and guarantees that users can exit the system in case of disputes.

Figure 1: A screenshot of the Nifty Erdstall (NERD) demo: an NFT you own shows a history of owners as it was minted on Erdstall (gas-free), sold on OpenSea, brought back to Erdstall and resold. You can do all of this in our Demo.

The Erdstall network is run by a so-called operator. The operator is a server containing a Trusted Execution Environment (TEE), like Intel SGX, which is included in most modern CPUs today. Inside the TEE, the operator runs the Erdstall kernel, i.e., the state progression code. By leveraging the remote attestation feature of TEEs, users of the network can verify that the correct Erdstall kernel is running inside the operator’s TEE. The main tasks of the operator are the

  • Forwarding of new Ethereum blocks into the enclave so that it learns about deposits, new token registrations and, possibly, any user challenges and the
  • Forwarding of transactions and exit requests by Erdstall network users into the enclave.

The operator thus becomes an untrusted message broker between the Ethereum network, Erdstall users and the kernel running inside the secure enclave. TEEs have the following interesting features that allow us to simplify the Plasma protocol.

By employing the secure execution of code (the device is developed against outside influence), the implied private state (All computation and state in the TEE is kept hidden from the operator unless explicitly specified) and the attestation features (users can verify that they are sending their coins to an un-manipulated Plasma system which is running inside a TEE), we can increase the performance of the Plasma system significantly. The operator becomes a simple, untrusted message broker while the TEE processes all transactions in the system. Note that using the TEE, we now have the guarantee that the Plasma state will always be updated correctly. This means we do not need an on-chain state summary, which significantly reduces the costs of the system.

However, the operator is still untrusted. This means he can still control which inputs get to the TEE and which state updates are forwarded to the users. To account for potential attacks of this kind, we still need to punish the operators should they start withholding information from the users. For this purpose, we require an on-chain challenge-response dispute process in case of data withholding.

Erdstall Applications

There is a wide range of possible usage scenarios for Erdstall as it offers a highly functional environment with arbitrary code executability. In the following section, we compiled a set of examples where we think Erdstall can provide major advantages compared to other systems.

In-Game NFTs

One of the most promising use cases of NFTs and blockchain will be gaming. With Erdstall, it will be possible to connect gaming events with blockchain events and in-game items with NFTs. To make an example: the player you just defeated in a duel will drop parts of their inventory for you to loot. The rare item you just found might not suit your class but is definitely valuable to someone else. With the synchronization of your game progress and the Erdstall system, you can either trade the item NFT via Erdstall (gas-free) or, if you are a power user, you can move it to the public blockchain and trade it on public marketplaces. The buyer can then move the item to their inventory and use it. This becomes even more interesting once items carry their own unique history. Who owned the weapon before me? How much damage was dealt with it and how it was upgraded over time. Stats like these can be bound to an NFT which gets updated over time and serves a clear actual purpose — to make the gaming experience richer. Another major benefit is losing the dependency on the game studio. Multiplayer games often will shut down after being in service for years. Thus, items the players owned and worked hard for would disappear and leave the players with nothing. With a connection to a blockchain these items will not be lost and can be continued to be traded as legacy items (which can not be obtained anymore and thus rise in price) or if private servers are being established continue to be used normally. This results in a major longevity increase of games (and let them transcend through time). Depending on the game and the mechanics connected to Erdstall, this vision can vary according to the needs and wishes of the communities.

Energy and Certificate Trading

In the wake of the energy transition, the flow of energy and electricity will take more complex paths than just from utility to consumer. Energy marketplaces’ functionality spans from final consumption of units, dealing with certificates (for example in the form of NFTs) and connecting real-world events with adaptations to the marketplace. All of these events need to be performed with finality, security and on a high frequency. Therefore, the construct of energy markets is highly complex and can benefit from Erdstall’s properties. The need for local energy trading and its connection to regional and superregional markets is growing with the need for optimal allocation of money and energy on a local level. This is due to the growing need for renewable energy, the availability of local energy storage (electric vehicles) and the consequences for markets and regulators. Topics like demand-side management (the process of forgoing electricity consumption depending on the current local energy prices) and increasing energy prices will attract regular households to participate in energy markets. A complex set of interactions can emerge when tackling the energy sector since grid operation and regulation play a major role. To make sure that energy consumption and grids can be well-managed in a price-efficient and trustless manner, a highly scalable and programmable energy marketplace management system is required. Erdstall-based infrastructure can provide that from the local to the global scale.

NFT Marketplace

A more basic use case is an NFT marketplace for art and basic NFTs. This subsection will be used to explain to the reader how they can test the Erdstall framework in a live demo on the Goerli testnet. This demo makes it possible to trade, mint, burn and onboard (as well as offboard) NFTs to Erdstall. In the current version, you can get a glimpse of how Erdstall can operate closely aligned with applications like NFT trading on OpenSea. Due to this demo being on the Goerli testnet, you can perform your very own tests with the Erdstall framework.

In our demo, you can onboard via the Goerli network. Please note that for doing so, you will need to own some Görli testnet Ether (for potential on- and offboarding of NFTs and the wallet signature; you can get some from a faucet like this or this) and a MetaMask wallet. After you onboard, you obtain 1000 PRN tokens which are the currency of this particular marketplace demo. With these, you can take part in the marketplace. You can buy NFTs on sale or mint them yourself for free. You also have the option to mint confidential NFTs (see this article for further explanation). Their attached confidential data, like a secret image, will only be accessible to the owner, even when on sale. You are free to move your NFT back to the Goerli network and utilize it on OpenSea or other places.

🍵 Go and check it out now! 🍵

Want to use Erdstall for your infrastructure?

We developed an SDK of Erdstall to enable tech-savvy projects to customize Erdstall according to their vision. The Erdstall SDK is a TypeScript SDK to easily use any Erdstall network in your frontend or backend application. It is easily deployable and arbitrarily configurable. If we got you hyped for Erdstall, reach out to us via mail!

Contact

If you are interested in learning more about Erdstall and how it can be used to scale your blockchain application or to build your marketplace, visit our website (https://erdstall.dev/) and our GitHub repo or contact us directly by writing us an email at hi@erdstall.dev.

--

--