• Stars
    star
    422
  • Rank 99,624 (Top 3 %)
  • Language
    Rust
  • License
    GNU General Publi...
  • Created over 3 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reference implementation of the Anoma protocols in Rust.

NOTE: This repository is currently being reworked. Instead, please visit the following locations, depending on your interest:


License: GPL v3 Drone CI build status

Overview

Anoma is an intent-centric, privacy-preserving protocol for decentralized counterparty discovery, solving, and multi-chain atomic settlement. To learn more about Anoma's vision, take a look at the Anoma Vision Paper.

This is an implementation of the Anoma protocol in Rust.

Warning

Here lay dragons: this codebase is still experimental, try at your own risk!

๐Ÿ’พ Installing

There is a single command to build and install Anoma executables from source (the node, the client and the wallet). This command will also verify that a compatible version of Tendermint is available and if not, attempt to install it. Note that currently at least 16GB RAM is needed to build from source.

make install

After installation, the main anoma executable will be available on path.

To find how to use it, check out the User Guide section of the docs.

If you have Nix, you may opt to build and install Anoma using Nix. The Nix integration also takes care of making a compatible version of Tendermint available.

# Nix 2.4 and later
nix profile install

# All versions of Nix
nix-env -f . -iA anoma

For more detailed instructions and more install options, see the Install section of the User Guide.

โš™๏ธ Development

# Build the provided validity predicate, transaction and matchmaker wasm modules
make build-wasm-scripts-docker

# Development (debug) build Anoma, which includes a validator and some default 
# accounts, whose keys and addresses are available in the wallet
ANOMA_DEV=true make

Using Nix

You may opt to get all of the dependencies to develop Anoma by entering the development shell:

# Nix 2.4 and above
nix develop

# All versions of Nix
nix-shell

Inside the shell, all of the make targets work as usual:

# Build the WASM modules without docker
make build-wasm-scripts

# Development build (uses cargo)
ANOMA_DEV=true make

It is also possible to use the Nix Rust infrastructure instead of Cargo to build the project crates. This method uses crate2nix to derive Nix expressions from Cargo.toml and Cargo.lock files. The workspace members are exposed as packages in flake.nix with a rust_ prefix. Variants where the ABCI-plus-plus feature flag is enabled are exposed with a :ABCI-plus-plus suffix.

# List all packages
nix flake show

# Build the `anoma_apps` crate with `ABCI-plus-plus` feature
nix build .#rust_anoma_apps:ABCI-plus-plus

# Build the (default) anoma package. It consists of wrappers for the Anoma
# binaries (`rust_anoma_apps`) that ensure `tendermint` is in `PATH`.
nix build .#anoma

Advantages:

  • Excellent build reproducibility (all dependencies pinned).
  • Individual crates are stored as Nix derivations and therefore cached in the Nix store.
  • Makes it possible to build Nix derivations of the binaries. Cargo build doesn't work in the Nix build environment because network access is not allowed, meaning that Cargo can't fetch dependencies; cargo vendor could be used to prefetch everything for Cargo, but cargo vendor does not work on our project at the moment.

Disadvantages:

  • Only works for Linux and Darwin targets. WASM builds in particular are not possible with this method. Although, while crate2nix doesn't support targeting WASM, we should be able to build the WASM modules via Cargo - if only cargo vendor worked.

Note: If you have modified the Cargo dependencies (changed Cargo.lock), it is necessary to recreate the Cargo.nix expressions with crate2nix. Helpers are provided as flake apps (Nix 2.4 and later):

nix run .#generateCargoNix
nix run .#generateCargoNixABCI-plus-plus

Before submitting a PR, pls make sure to run the following

# Format the code
make fmt

# Lint the code
make clippy

๐Ÿงพ Logging

To change the log level, set ANOMA_LOG environment variable to one of:

  • error
  • warn
  • info
  • debug
  • trace

The default is set to info for all the modules, expect for Tendermint ABCI, which has a lot of debug logging.

For more fine-grained logging levels settings, please refer to the tracing subscriber docs for more information.

To switch on logging in tests that use #[test] macro from test_log::test, use RUST_LOG with e.g. RUST_LOG=info cargo test -- --nocapture.

How to contribute

Please see the contributing page.

Dependencies

The ledger currently requires that Tendermint version 0.34.x is installed and available on path. The pre-built binaries and the source for 0.34.8 are here, also directly available in some package managers.

This can be installed by make install command (which runs scripts/install/get_tendermint.sh script).

More Repositories

1

namada

Rust implementation of Namada, a Proof-of-Stake L1 for interchain asset-agnostic privacy
Rust
2,366
star
2

juvix

A language for intent-centric and declarative decentralised applications
Haskell
436
star
3

namada-testnets

Testnet configurations and coordination for the Namada network.
329
star
4

namada-trusted-setup-claimer

Sign arbitrary messages with keys obtained from Namada's trusted setup
Rust
322
star
5

vamp-ir

Vamp-IR is a proof-system-agnostic language for writing arithmetic circuits
Rust
151
star
6

taiga

A framework for generalized shielded state transitions
Rust
120
star
7

zkp-compiler-shootout

Evaluating & benchmarking ZKP compilation strategies.
Rust
118
star
8

masp

The multi-asset shielded pool (MASP) provides a unified privacy set for all assets on Namada.
Rust
83
star
9

ferveo

An implementation of a DKG protocol for front-running protection on Anoma.
Rust
77
star
10

namada-interface

TypeScript
73
star
11

whitepaper

TeX
57
star
12

namada-docs

MDX
47
star
13

namada-shielded-expedition

Python
41
star
14

geb

A Categorical View of Computation
Idris
28
star
15

typhon

Formalization of Typhon protocol
TLA
25
star
16

research

Early-stage research related to the Anoma protocols.
Idris
23
star
17

specs

Specifications for the Anoma protocols.
TeX
23
star
18

alucard

A common lisp DSL for writing zero knowledge circuits
Common Lisp
18
star
19

ethereum-bridge

A generalized fully trustless Ethereum bridge for sovereign chains.
Solidity
12
star
20

minijuvix

Haskell
11
star
21

juvix-stdlib

The Juvix standard library
Makefile
9
star
22

VampIR-Book

A book which can act as an introduction and documentation for VampIR
CSS
9
star
23

masp-mpc

MASP MPC code
Rust
8
star
24

namada-sdk-starter

Rust
6
star
25

juvix-nightly-builds

6
star
26

abstract-resource-machine-simulator

Makefile
6
star
27

anoma-alpha

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

juvix-e2e-demo

Juvix compiler stack - Integration demo
Dockerfile
6
star
29

exhibit_plonkup

Rust
5
star
30

devtool

Rust
4
star
31

anoma-blog

JavaScript
4
star
32

verify-beacon

Rust
3
star
33

namada-whitepaper

Namada whitepaper
3
star
34

dev-utils

Shell
3
star
35

juvix-docs

Juvix Official Documentation
Makefile
3
star
36

devchain-container

Shell
2
star
37

intents-snippets

A repo to put code snippets related to intent research
Agda
2
star
38

typhon-sml

Typhon reference implementation in Standard ML
Standard ML
2
star
39

vscode-juvix

VSCode extension for Juvix
TypeScript
2
star
40

anoma-wasm-multitoken

Validity predicate and transactions for a variable supply multitoken account
Rust
2
star
41

wasm-workspace

Rust
2
star
42

anoma-blog-writing-guide

Comprehensive guide to writing blogposts for the anoma blog.
2
star
43

juvix-mode

The Juvix Emacs mode
Emacs Lisp
1
star
44

plonkup-hash

A collection of hash gadgets written for Plonkup
Rust
1
star
45

Isabelle-HPaxos

A formalization of HPaxos in Isabelle
Isabelle
1
star
46

vscode-vampir

1
star
47

juvix-containers

Immutable container types for Juvix
Makefile
1
star
48

highlightjs-juvix

Juvix language grammars for highlightjs (low maintenance)
JavaScript
1
star
49

art-template

Anoma Research Topics Template
TeX
1
star
50

ART-2024-Khalniyazova-Goes-Resource-Machine-Specification

TeX
1
star
51

juvix-quickcheck

Property-based testing for Juvix
Makefile
1
star
52

namada-light-sdk-starter

Namada light sdk starter kit
Dockerfile
1
star
53

ART-2023-Gureev-Cubides-Geb-Pipeline

TeX
1
star