Skip to content

GaloyMoney/bria

Repository files navigation

Bria

The bridge from your applications to the bitcoin network.

Bria enables transaction batching and UTXO management providing the liquidity of on-chain UTXOs to multiple consumers.

Table of Contents

Key features

  • multi account / multi wallet / multi queue

    • you can configure multiple wallets scoped to an account
    • signing via multiple supported remote signers including feeding PSBTs manually
    • transaction batching via configurable payout queues (check the demo for details)
  • cloud ready - intended for use as part of a distributed system

    • designed to be horizontally scalable
    • support for idempotent operations via external IDs
    • embed and update external metadata on addresses and payouts to reference external data
    • globally ordered event sequence can be streamed to achieve guaranteed eventual consistency
  • advanced accounting via an embedded ledger

    • internal use of double sided bookkeeping
    • database dump of ledger conforms with accounting best practices
    • great for accountants / auditors to know exactly what is going on
  • secure by design

    • extensive automated testing (unit + integration in rust, end-to-end using BATS)
    • all sensitive credentials (like remote signer config) encrypted at rest to prevent db leaks comprimising funds

Developing

Dependencies

Nix package manager

direnv >= 2.30.0

Docker

Demo walkthrough

For a step-by-step guide on how to get started with the demo, see the demo walkthrough.

Testing

To run commands in the Nix environment, there are two primary methods:

  1. Using direnv: If direnv is installed and hooked into your shell, simply cd into the repository. Nix will automatically bootstrap the environment for you using the flake. On the first run, you'll need to execute direnv allow to load the environment configuration.

  2. Manual entry: Alternatively, you can manually enter the environment by executing nix develop. You can also run a specific command directly with nix develop --command <command>, or use the environment as you prefer.

Running tests

  • to run the tests, use the following command:
    make reset-deps next-watch

End-to-end tests

  • for bash-based end-to-end tests, we use bats as a test runner. To execute these tests, run:
    make e2e

Local daemon for E2E tests and exploration

  • if your end-to-end tests stall, or if you simply wish to inspect the state or experiment locally, you can start the local daemon with:
    make local-daemon
  • once the daemon is up, you can run CLI commands against it. For example:
    cargo run --bin bria help

License

Mozilla Public License 2.0