Robonomics Network’s Liability Contract is Successfully Executed on Neon EVM

Neon Labs
Neon Labs
Published in
5 min readOct 4, 2022

Neon Labs recently partnered with Robonomics Network to validate the readiness of the Neon platform for production using a complex workflow. The exercise involved deploying and testing Robonomics’ smart contracts to Neon EVM. The deployed contracts allow cyber-physical systems (robots) to perform certain actions based on technical-economic transactions.

In the Robonomics network, engagement is formed between two parties: the Promisee, who orders the service, provides a technical task description and funds for its execution, and the Promisor, who actually executes the service. The interaction is coordinated by a special node called the Provider. The Provider is constantly observing the network for signals from Promisee and Promisor.

The exercise examined a common use case flow:

  1. A contract between a Promisee and a Promisor was established.
  2. The resulting “work/action” was executed by the Promisor and validated by a third party.
  3. The node that facilitated the contract between the two parties (Promisee and Promisor) was paid a commission.

For the commissioned work/action, a simulation of a robotic arm performed a sequence of actions based on the contract between the Promisee and Promisor. Telemetry data representing the robot’s actions was recorded by the robot and saved in order to verify the completion of work.

Who is Robonomics?

Robonomics Network is an open-source IoT application platform that aims to leverage decentralized architecture by atomically transferring technical and financial data between user applications, IoT services, and sophisticated robotics. Launching secure, serverless dApps that put user data privacy and device security first at every level of communication is made easy by Robonomics.

Our Objective

The objective of deploying and testing the Robonomics smart contracts via Neon EVM was to verify the efficacy of the Neon network with complex workflows. That workflow involves:

  1. A successful commitment between a Promisee and a Promisor as defined by a Liability contract. The Liability contract is a smart contract that replicates the regular connection between a service’s Promisee (the consumer) and Promisor (the services provider). It also includes the technical and financial terms of their exchange. The Promisee and Promisor can be autonomous agents or humans.
  2. A payment to the Promisor (service provider) by the Promisee after the successful execution of an agreed upon “work/action”.
  3. A verification of the Promisor’s agreed upon “work/action” by a third party observing the Neon network.

Testing Methodology

To simulate a use case involving fully automated businesses and services delivered by cyber-physical systems (CPS), we chose a scenario with two autonomous agents acting as Promisee and Promisor. The use case illustrates how future “smart cities” or enterprises might make use of blockchain networks. Neon EVM’s success with this use case will demonstrate its viability as a cutting-edge product.

The testing will assess the Liability contract life cycle in the Robonomics network as depicted below:

The illustration shows the actions that are taken to construct a Liability contract. First, the Robonomics network provider calls the Lighthouse contract, a special smart contract that executes a transaction when a Provider node establishes a market match between a Promisee and a Promisor pair. The Lighthouse contract in turn calls the Factory contract. Information regarding the transaction, including the terms of reference, payment for the service, the address of the validator, and the deadline, is contained in the Liability contract.

The team implemented a robot launch scenario through a Liability contract similar to this example in order to replicate the Robonomics infrastructure on the Neon network. If you’re interested in more potential use cases for Robonomics, check out the Robonomics R&D page.

Testing Scope

The scope of the testing focused on the deployed contracts:

Testing Execution

The Robonomics team began the simulation by creating an offer message and a demand message from the Promisee. During this stage, the team expected the open offer message and demand message to trigger the creation of a Liability contract via the Lighthouse contract’s createLiability function.

Following the creation of the Liability contract, the XRT contract was observed to verify that tokens were transferred correctly from the Promisee’s address to the address of the Liability contract.

Once the new Liability contract was detected on the Neon devnet, the Promisor agent (simulated robot) began working according to the instructions in the Liability contract. The telemetry data representing the simulated robot’s work output was written to a file and sent to IPFS. The hash of the telemetry data file was saved as a result.

The Liability contract was then finalized using the Lighthouse contract’s finalizeLiability() function. In the final phase, the Robonomics team confirmed that tokens were transferred from the Liability contract’s address to the addresses of the Promisor and Validator.

You can watch a recording of the process here. Below is a diagram outlining the test scenario on Neon EVM.

The project deliverables include source code for the Robonomics contracts and the source code for implementing the test scenario. All the contracts are written for Solidity 0.5.0. As such, no changes were required when deploying and using the contracts on Neon EVM. Step-by-step instructions for launching the test exercise can also be found in README.md

Findings

All contracts functioned as expected. The simulated robot fulfilled its obligation to the Promisee party and delivered a file with telemetry data documenting its actions. The Provider node also correctly facilitated the engagement between the Promisor (simulated robot) and Promisee, and was compensated accurately for its involvement. The work output was also verified by a third party.

In regards to Neon platform drawbacks, the Robonomics team noted an interesting network trait to be investigated by Neon Labs:

Neon EVM does not have a WS/WSS endpoint. Unlike Ethereum, Neon EVM doesn’t have a WS/WSS endpoint, which makes it impossible to subscribe to events from the network. As a result, the Robonomics Team monitored the events manually during testing.

Conclusion

Now it’s your turn to deploy your smart contracts to Neon EVM. Make sure to let us know what you think. If you have any issues or need additional guidance, check out our Neon Docs or reach out to a team member on Discord. We know that you’ll create something great!

--

--