Introducing TokenSPICE

EVM Agent-based Token Simulator for Token Engineering

Trent McConaghy
TokenSPICE

--

About

This article provides a brief introduction to TokenSPICE.

TokenSPICE is a tool that simulates tokenized ecosystems via an agent-based approach. It can use EVM in-the-loop or just pure Python-based agents. It can help in Token Engineering flows, to design, tune, and verify tokenized ecosystems. It’s young, but promising.

Basic idea

TokenSPICE simulates by simply running a loop. At each iteration, each agent in the netlist takes a step. That’s it! Simple is good.

A netlist wires up a collection of agents to interact in a given way. Each agent is a class. It has an Ethereum wallet, and does work to earn money. Agents may be written in pure Python, or with an EVM-based backend.

Code

The TokenSPICE repo is github.com/tokenspice/tokenspice. It’s Apache 2.0 — a permissive open-source license. It’s written in Python, using web3.py for interfaces to EVM code running in a local EVM network (Ganache).

Getting Started

The README at the TokenSPICE repo describes how to get started: setting up your environment, trying out simulations from sample netlists, and how to make changes.

You can model a system with a netlist and metrics (KPIs). You can write your own netlists and agents to simulate whatever you like. The assets/netlists directory has examples.

TokenSPICE History & Community

TokenSPICE was initially built to model the Web3 Sustainability Loop, a system-level token design, and applied to Ocean Protocol.

It’s now been generalized to support EVM, on arbitary netlists. At Ocean, we’re using it for high-fidelity modeling of data markets.

Trent McConaghy (that’s me) built the initial version. Now there are several contributors: Shawn Anderson, Nico Rodriguez, Richard Blythman, Bharghav Kakadiya, Johann Suarez, and Trang Nguyen. The list is growing: ) We try to turn around PRs quickly. To prioritize efforts, we use this Kanban board.

The beating heart of the TokenSPICE community is the weekly Monday hack session, hosted by Angela Kreitenweis of the Token Engineering community. Anyone is welcome to drop in!

Community chat is at Discord (first timers can go here). It has Twitter handle @TokenSPICE.

TokenSPICE Future

TokenSPICE unlocks the possibility for many powerful higher-level tools that use SPICE-in-the-loop, from advanced verification to optimization and even synthesis (e.g. evolving Solidity).

Conclusion

This article gave a brief introduction to TokenSPICE, along with key links.

The next article reviews the history of the SPICE simulator, which has been used ubiquitously in electrical engineering for decades. It then describes EE design & verifcation flows with SPICE. The article draws a parallel to how TokenSPICE could play a similar role for token engineering.

--

--