MUD
MUD - Engine for Autonomous Worlds
MUD is a framework for complex Ethereum applications.
It adds some conventions for organizing data and logic and abstracts away low-level complexities so you can focus on the features of your app.
It standardizes the way data is stored on-chain. With this standard data model, MUD can provide all network code to synchronize contract and client state. This includes synchronizing state directly from an RPC node or a general-purpose MUD indexer.
MUD is MIT-licensed, open source and free to use.
Features
Today
- State synchronization between contracts and clients without custom networking code
- General purpose indexers (without custom indexing code)
- Seamless contract upgrades (+ automatic contract upgrades during development)
- Shared contract state
- Optimistic updates
- Automatic type generation for contracts and systems
- Query language to interact with contract state
- Data explorer to inspect and modify contract and local state
- Bitpacking utilities
Soon
- Local simulation of transactions (including optimistic state)
- Built-in support for account abstraction
- Contract package manager
Quickstart
pnpm create mud my-project
Packages
MUD consists of several libraries. They can be used independently, but are best used together.
Package | Version |
---|---|
@latticexyz/solecs Solidity Entity Component System library | (opens in a new tab) |
@latticexyz/network TypeScript networking library for automatic contract/client state sync | (opens in a new tab) |
@latticexyz/recs TypeScript Reactive Entity Component System library | (opens in a new tab) |
@latticexyz/services Go services for indexer, faucet, message relay | (opens in a new tab) |
@latticexyz/cli Command line interface for types, testing, faucet, deployment and more | (opens in a new tab) |
@latticexyz/std-contracts Solidity standard library | (opens in a new tab) |
@latticexyz/std-client Typescript standard library | (opens in a new tab) |
@latticexyz/noise Solidity and AssemblyScript implementations of Perlin noise | (opens in a new tab) |
Contribute
We'd love your support in improving MUD! This monorepo includes all of MUD's source code, and pull requests are always welcome. To discuss new features or changes join our Discord (opens in a new tab).
Local development setup
!!! The following steps are only necessary if you want to contribute to MUD. To use MUD in your project, install the packages from npm or set up a new project with the MUD cli. !!!
-
Install go (required to build packages/services): https://go.dev/doc/install (opens in a new tab)
-
Install the foundry toolkit (required to build and test MUD solidity packages): https://getfoundry.sh/ (opens in a new tab)
-
Install pnpm
npm install pnpm --global
- Clone the MUD monorepo
git clone https://github.com/latticexyz/mud
- Install MUD dependencies and setup local environment
cd mud && pnpm install
Pull requests
MUD follows the conventional commit specification (opens in a new tab) for commit messages and PR titles. Please keep the scope of your PR small (rather open multiple small PRs than one huge PR) and follow the conventional commit spec.
Library
Community support
Join our Discord (opens in a new tab) to get support and connect with the community!
License
MUD is open-source software licensed as MIT.