An intent-centric, privacy-preserving protocol for decentralized counterparty discovery, solving, and multi-chain atomic settlement.

Overview

Anoma Blockchain prototye

This prototype aims to reproduce the following topology:

 ┌────────┐                     ┌───────────┐   │   ┌───────┐
 │Solver 1├────────┐  ┌─────────┤Validator 1│   │   │       │
 └────────┘        │  │         └───────────┘   │   │Block 0│
                   │  │                         │   │       │
 ┌────────┐        │  │         ┌───────────┐   │   └───┬───┘
 │Solver 2│        ▼  ▼   ┌─────┤Validator 2│   │       │
 └────────┴──►P2P Gossip◄─┘     └───────────┘   │   ┌───▼───┐
              ▲   ▲ ▲  ▲                        │   │       │
              │   │ │  │        ┌───────────┐   │   │Block 1│
              │   │ │  └────────┤Validator 3│   │   │       │
              │   │ │           └───────────┘   │   └───┬───┘
              │   │ │                           │       │
              │   │ │           ┌───────────┐   │   ┌───▼───┐
              │   │ └───────────┤Validator 4│   │   │       │
              │   │             └───────────┘   │   │Block 2│
              │   │                             │   │       │
  ┌──────────┬┘ ┌─┴────────┐                    │   └───────┘
  │  RPC 1   │  │  RPC 2   │                    │      ...
  └────▲─────┘  └──▲───▲───┘                    │       │
       │           │   │                        │       │
       │           │   │        ┌──────────┐    │   ┌───▼───┐
       │           │   └───────►│Blockchain│    │   │       │
       │           │            │          │    │   │Block N│
       ▼           ▼            │ Explorer │    │   │       │
    Client 1     Client 2       └──────────┘    │   └───────┘

Build instructions

In the root directory execute the following command:

$ make

To run unit tests run the following command in the root directory:

$ make test

To run this topology with 30 validators and 4 solvers make sure that you have Docker and docker-compose installed on your system and run:

$ docker-compose up --build --remove-orphans --scale validator_n=30 --scale solver_n=4

This command will configure and run the topology described in the above diagram and expose two a HTTP interfaces on port 8081 and a blockchain explorer on port 8083.

To monitor various metrics recorded by telemetry navigate your browser to http://localhost:10000.

Nodes

Solver

Solvers listen on intents (partial transactions) received through gossip and try to find a state mutation that satisfies all intents and validity predicates of the app and accounts targeted by intents.

RPC

RPC nodes expose HTTP api for external clients that allows:

  • Receiving partial transactions (intents) from external clients and gossiping them to solvers through p2p.
  • Listen on the p2p network for newly propagaged blocks and store locally the latest state of the chain.
  • Inspecting current blockchain state, used mostly by explorers and apps for checking status of the chain (e.g confirming a transaction, querying a block, etc.)

Validator

Validators package complete transactions into blocks and try to achieve consensus on the canonical block in the blockchain. The also propagate blocks across nodes using gossip.

Validators may optionally expose an RPC interface for clients to interact with the chain and that makes them also RPC nodes (they will have two roles).

Explorer

Explorers use RPC nodes to inspect the contents of the blockchain:

  • Blocks
  • Transactions
  • State
  • Stats

Libraries

Primitives

This crate defines basic types used across all types of nodes in the network, such as keypairs, addresses, etc. More details about this crate are here.

Network

This crate implements the P2P gossip mechanism used by all nodes that participate in the gossip. More details about this crate are here.

Programming model

For an overview of Anoma intent-centric model consult the whitepaper.

You might also like...
Abstreet - Transportation planning and traffic simulation software for creating cities friendlier to walking, biking, and public transit
Abstreet - Transportation planning and traffic simulation software for creating cities friendlier to walking, biking, and public transit

A/B Street Ever been stuck in traffic on a bus, wondering why is there legal street parking instead of a dedicated bus lane? A/B Street is a project t

"putzen" is German and means cleaning. It helps keeping your disk clean of build and dependency artifacts safely.

Putzen "putzen" is German and means cleaning. It helps keeping your disk clean of build and dependency artifacts safely. About In short, putzen solves

Plugins and helpful methods for using sepax2d with Bevy for 2d overlap detection and collision resolution.

bevy_sepax2d Plugins and helpful methods for using sepax2d with Bevy for 2d overlap detection and collision resolution. Compatible Versions bevy bevy_

A Rust wrapper and bindings of Allegro 5 game programming library

RustAllegro A thin Rust wrapper of Allegro 5. Game loop example extern crate allegro; extern crate allegro_font; use allegro::*; use allegro_font::*;

RTS game/engine in Rust and WebGPU
RTS game/engine in Rust and WebGPU

What is this? A real time strategy game/engine written with Rust and WebGPU. Eventually it will be able to run in a web browser thanks to WebGPU. This

A curated list of wgpu code and resources.

Awesome wgpu A curated list of wgpu code and resources. PRs welcome. About wgpu https://github.com/gfx-rs/wgpu-rs matrix chat https://matrix.to/#/#wgp

grr and rust-gpu pbr rendering
grr and rust-gpu pbr rendering

grr-gltf Barebone gltf viewer using grr and rust-gpu. Currently only supports a single gltf model! Assets These files need to be downloaded and placed

A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music.
A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music.

rustris A no-frills Tetris implementation written in Rust with the Piston game engine, and Rodio for music. (C) 2020 Ben Cantrick. This code is distri

Pixel-Perfect, 2D Renderer for Bevy that Seamlessly Targets Desktop and Web
Pixel-Perfect, 2D Renderer for Bevy that Seamlessly Targets Desktop and Web

bevy_retro ( Screenshot of Bounty Bros. game made with Bevy Retro and Skip'n Go ) Bevy Retro is a 2D, pixel-perfect renderer for Bevy that can target

Comments
  • Decide on execution limits

    Decide on execution limits

    We need to decide on

    1. memory and compute limits for WASM predicates,
    2. maximum WASM bytecode limit
    3. maximum transaction size
    4. maximum block size
    5. gas price schedule for metered execution.
    6. storage costs model (rent vs one-time fee, etc)
    7. maximum predicate tree size
    8. maximum intent size
    research vm 
    opened by karim-agha 0
  • P2P network size estimation

    P2P network size estimation

    For configuring various parameters of the p2p network like random walk length or active view size we need to know the estimated size of the entire p2p network. See network/src/config.rs and how the network_size parameter is used.

    We need to devise an algorithm for estimating the total size of the p2p network that is cheap, tolerates churn and doesn't need to be fully executed by every single node.

    Hint: https://git.gnunet.org/bibliography.git/plain/docs/IWSOS'08_-_Network_Size_Estimation_for_Structured_Overlays.pdf

    p2p research 
    opened by karim-agha 0
Owner
anoma
An intent-centric, privacy-preserving protocol for decentralized counterparty discovery, solving, and multi-chain atomic settlement.
anoma
A Wordle solving assistant

Wordler A Wordle solving assistant. What and Why? Affected by the virally memetic game wordle, but linguistically incapable of solving it, I set forth

alberto 4 Feb 18, 2022
Atomic Physics Library

Iridium Atomic Physics Library Attempt at making a atomic database. Uses Nubase2020, ENSDF for decay chains, atomic masses, and half-lives. Nubase2020

J.A Sory 14 Jun 19, 2022
An atomic save/load system for Bevy Game Engine.

☢️ Bevy Atomic Save An atomic save/load system for Bevy. Features Save and load a World into a RON file on disk Control which entities should particip

null 11 Jan 28, 2023
Dark Forest, the world's first decentralized real-time strategy game.

darkforest-rs Dark Forest, the world's first decentralized real-time strategy game.

null 44 Oct 9, 2022
Solana Game Server is a decentralized game server running on Solana, designed for game developers

Solana Game Server* is the first decentralized Game Server (aka web3 game server) designed for game devs. (Think web3 SDK for game developers as a ser

Tardigrade Life Sciences, Inc 16 Dec 1, 2022
Multi-channel signed distance field (MSDF) generator for fonts implemented in pure Rust.

msdfont WIP - school started so less updates from now on :(( Multi-channel signed distance field (MSDF) generator for fonts implemented in pure Rust.

Leon 3 Aug 29, 2022
This is the core library with the full abstraction and implementation of the Minecraft protocol and logic. (Currently WIP)

MineRust (WIP) This is the core library with the full abstraction and implementation of the Minecraft protocol and logic. This project is currently WI

MineRust Project Suite 2 Nov 20, 2022
Minecraft Protocol Library

Protocol Minecraft Protocol Library This branch is dedicated to the Minecraft Bedrock Edition Protocol. If you have any concerns or questions you can

Netrex 5 Mar 19, 2022
General purpose client/server networking library written in Rust, built on top of the QUIC protocol which is implemented by quinn

Overview "This library stinks!" ... "Unless you like durian" durian is a client-server networking library built on top of the QUIC protocol which is i

Michael 92 Dec 31, 2022
Victorem - easy UDP game server and client framework for creating simple 2D and 3D online game prototype in Rust.

Victorem Easy UDP game server and client framework for creating simple 2D and 3D online game prototype in Rust. Example Cargo.toml [dependencies] vict

Victor Winbringer 27 Jan 7, 2023