Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

532 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

BIM logo — Bitcoin Is Money

A self-custodial Bitcoin wallet, unlocked by your fingerprint.

BIM (Bitcoin is money) lets anyone send and receive Bitcoin — on-chain, on the Lightning Network, or as WBTC on Starknet — using nothing but a passkey. No seed phrase to write down. No browser extension. No gas to pre-fund.

🚀 Try it live: app.bitcoinismoney.app — register a passkey in 30 seconds. 🌐 Website: bitcoinismoney.app

Live App Website CI Security License: GPL v3

Why BIM?

Using Bitcoin as a money for day to day payment is historically difficult because of networks contraints and complexity.

  • Bitcoin doesn't allow for instant transfers required for day to day payments,
  • Lightning does, but non custodial Lightning wallets means managing liquidity in channels, which often creates poor UX and/or occurring L1 fees;
  • Both Bitcoin and Lightning doesn't support passkeys signature scheme.

BIM takes a new path: a smart-contract wallet on Starknet, unlocked by WebAuthn / passkeys (the same biometric auth your phone and browser already speak). The cryptographic heavy lifting happens inside the Starknet account contract; the user only has to touch a fingerprint sensor.

And because smart-contract accounts normally need gas to be deployed, BIM leans on the AVNU paymaster (SNIP-29) to auto-deploy accounts at no cost to the user — transparently, right after registration. BIM covers the deployment fee so onboarding stays frictionless.

Features

  • Passkey authentication — register and log in with WebAuthn (Touch ID, Face ID, Windows Hello, hardware keys).
  • Self-custodial — private keys are bound to the device's secure enclave; BIM never sees them.
  • Receive Bitcoin — on-chain (BTC), Lightning (BOLT11 invoices), or as WBTC on Starknet. Pick the rail, get a QR code.
  • Pay anything — scan a Lightning invoice, a Bitcoin address, or a Starknet contract call. BIM parses it, quotes the swap, and signs the transaction after a biometric confirmation.
  • Gasless deployment — first payment auto-deploys the Starknet account via the AVNU paymaster. No preloaded gas required.
  • Transaction history — an Apibara indexer streams Starknet Transfer events and surfaces them in the wallet.
  • Lightning ↔ Bitcoin ↔ Starknet swaps — powered by the Atomiq SDK.
  • Operational tooling@bim/cli for health checks, E2E flows, and AVNU credit monitoring with Slack alerts.

Tech Stack


Typescript   NodeJS   Angular   Hono web server   Starknet SDK   Atomiq SDK   AVNU Paymaster   Apibara indexer   Drizzle ORM   WebAuthn / passkeys   Testcontainers   Vitest


Layer Tech
Backend Hono on Node.js 24, ESM, built with esbuild
Domain Pure TypeScript — hexagonal (ports & adapters), no framework dependencies
Frontend Angular 21 PWA with signals and standalone components
Indexer Apibara streaming Starknet DNA events
Database PostgreSQL + Drizzle ORM
Blockchain Starknet, Atomiq SDK for swaps, AVNU paymaster for gasless deployment
Auth SimpleWebAuthn for WebAuthn server verification
Testing Vitest + Testcontainers
Infra Docker, Terraform, Scaleway Serverless Containers
CI/CD GitHub Actions

Screenshots


BIM wallet screenshots


Architecture at a Glance

BIM's codebase uses a pragmatic blend of Hexagonal architecture (ports & adapters), Clean Architecture (use cases distinct from enterprise domain rules), and a handful of core DDD practices (rich entities, ubiquitous language, domain services only when justified). At the current project size, both domain rules and use cases live in a single @bim/domain package — a documented compromise detailed in ARCHITECTURE.md.

apps/api  ────┬────  apps/front    (Angular PWA, served by the API)
              │
              ├────  @bim/domain   (pure TS: entities, use cases, services, ports)
              │
              ├────  @bim/db       (PostgreSQL + Drizzle)
              │
              ├────  @bim/atomiq   (swap SDK adapter)
              │
              ├────  @bim/starknet (RPC + contract utils)
              │
              └────  @bim/slack    (alerting)

apps/indexer ──── PostgreSQL   (streams Starknet events, shared DB)
apps/cli     ──── apps/api     (ops + E2E)

The backend (apps/api) is the only process that talks to external services (Atomiq, AVNU, Starknet RPC). The frontend displays data and performs WebAuthn ceremonies; all business logic lives server-side.

→ For a deeper dive, read ARCHITECTURE.md.

Getting Started

Prerequisites

  • Node.js — exact version pinned in .nvmrc / .tool-versions. Use nvm install or asdf install.
  • pnpm — the package manager (>=11, pinned via the packageManager field in package.json). Enable it with corepack enable or install it from pnpm.io.
  • Docker & Docker Compose — for local PostgreSQL and integration tests

Quick start

Just want to use BIM? Head to app.bitcoinismoney.app — no install needed. The instructions below are for running the stack locally as a developer.

# 1. Clone
git clone https://github.com/bitcoin-is-money/bim-app.git
cd bim

# 2. Install the pinned Node version
nvm install           # nvm
# or
asdf install          # asdf

# 3. Install workspace dependencies (pnpm applies patches automatically)
pnpm install --frozen-lockfile && pnpm exec husky

# 4. Start PostgreSQL (docker-compose) and push the schema
pnpm db:up

# 5. Create the secret env files (they can start empty)
touch apps/api/.env.testnet.secret
touch apps/api/.env.mainnet.secret
touch apps/indexer/.env.testnet.secret
touch apps/indexer/.env.mainnet.secret

# 6. Start the backend (testnet, port 8080)
pnpm dev

# 7. In another terminal, start the Angular dev server (port 4200)
pnpm dev:front

Open http://localhost:4200, register a passkey, and you're in. See apps/api/.env.local.example for the optional secrets (AVNU API key, Slack tokens, etc.).

Running against mainnet

NETWORK=mainnet pnpm dev

You will need a real AVNU_API_KEY (with credits) in apps/api/.env.mainnet.secret.

Project Structure

bim/
├── packages/                       # Libraries (pure TypeScript)
│   ├── lib/                        # @bim/lib      — shared utilities
│   ├── domain/                     # @bim/domain   — entities, use cases, domain services, ports
│   ├── db/                         # @bim/db       — Drizzle schema & client
│   ├── test-toolkit/               # @bim/test-toolkit — test helpers
│   ├── atomiq/                     # @bim/atomiq   — Atomiq SDK adapter
│   ├── atomiq-storage-postgres/    # @bim/atomiq-storage-postgres
│   ├── slack/                      # @bim/slack    — Slack notifications
│   └── starknet/                   # @bim/starknet — Starknet RPC utils
├── apps/                           # Runnable applications
│   ├── api/                        # @bim/api     — Hono backend
│   ├── front/                      # @bim/front   — Angular frontend
│   ├── indexer/                    # @bim/indexer — Apibara indexer
│   └── cli/                        # @bim/cli     — ops CLI
├── infra/                          # Terraform (Scaleway)
├── doc/flow/                       # Payment flow diagrams
├── ARCHITECTURE.md                 # Technical architecture
├── CONTRIBUTING.md                 # How to contribute
├── CODE_OF_CONDUCT.md
├── SECURITY.md
├── CHANGELOG.md
└── LICENSE                         # GPL v3

Testing

pnpm test                              # All unit tests across workspaces
pnpm test:integration                  # API integration tests (requires Docker)
pnpm --filter @bim/domain test         # Just the domain package
pnpm --filter @bim/api test:testnet    # Testnet suite (requires AVNU_API_KEY)

⚠️ After editing any packages/* library, rebuild them before running the API tests — API tests import from each library's compiled dist/, not from source, so stale output will cause misleading failures:

pnpm build:libs

More details on the testing pyramid, fixtures, and Testcontainers setup in ARCHITECTURE.md § Testing Pyramid.

Scripts Reference

Expand the full list of pnpm scripts

Development

Command Description
pnpm dev Start API with tsx watch (testnet, port 8080)
pnpm dev:front Start Angular dev server (port 4200)

Build

Command Description
pnpm build Build everything (api + indexer + frontend)
pnpm build:libs Build shared libraries
pnpm build:api Build API bundle (libs + api + frontend)
pnpm build:front Build Angular frontend
pnpm build:indexer Build Apibara indexer

Test

Command Description
pnpm test Run all unit tests (all workspaces)
pnpm test:integration Run API integration tests (requires Docker)
pnpm --filter @bim/api test:testnet Run testnet tests
pnpm --filter @bim/api test:e2e Run E2E tests against a deployed target

Database

Command Description
pnpm db:up Start PostgreSQL container + push schema
pnpm db:push Push Drizzle schema to database
pnpm db:generate Generate Drizzle migration files
pnpm db:migrate Run pending migrations
pnpm db:studio Open Drizzle Studio (visual DB browser)

Docker

Command Description
pnpm docker:up Build images + start full stack
pnpm docker:down Stop all containers
pnpm docker:logs Follow container logs
pnpm docker:build Build Docker images
pnpm docker:push Push images to Scaleway registry
pnpm docker:redeploy Update and redeploy Scaleway containers
pnpm docker:ship Build + push + redeploy (full deploy pipeline)

Use NETWORK=mainnet to target mainnet (default: testnet):

NETWORK=mainnet pnpm docker:up

Infrastructure (Terraform)

Command Description
pnpm infra:init Initialize Terraform
pnpm infra:plan Preview infrastructure changes
pnpm infra:apply Apply infrastructure changes

Lint & Security

Command Description
pnpm lint Lint the entire monorepo
pnpm lint:fix Auto-fix lint errors
pnpm security Run the dependency audit
pnpm security:audit pnpm audit (moderate level)

Utility

Command Description
pnpm clean Clean build outputs in all workspaces
pnpm clean:all Remove all node_modules and build outputs
pnpm deps:check List outdated dependencies
pnpm deps:update Bump dependencies (interactive)

Configuration

Each network has a committed defaults file and a gitignored secrets file:

apps/api/.env.testnet         # Testnet defaults (committed)
apps/api/.env.testnet.secret  # Testnet secrets (gitignored, must exist)
apps/api/.env.mainnet         # Mainnet defaults (committed)
apps/api/.env.mainnet.secret  # Mainnet secrets (gitignored, must exist)

The .secret files must exist (they can be empty). See apps/api/.env.local.example for the full list of variables and their purpose.

Documentation

Contributing

Contributions of all kinds are welcome — bug reports, fixes, features, docs, tests. Start with CONTRIBUTING.md to get the project running locally and see the coding conventions.

For anything larger than a small fix, please open an issue first so we can align on the approach.

Security

Found a vulnerability? Please do not file a public issue. See SECURITY.md for private disclosure instructions.

License

BIM is licensed under the GNU General Public License v3.0 or later. That means you're free to use, modify, and redistribute BIM, but derivative works must also be open-source under a compatible license.

Acknowledgments

BIM stands on the shoulders of some great open-source work:

  • Atomiq — the swap SDK that makes Lightning ↔ Bitcoin ↔ Starknet possible.
  • AVNU — the SNIP-29 paymaster that makes gasless Starknet deployment a reality.
  • Apibara — the Starknet DNA indexer powering BIM's transaction history.
  • Starknet and StarkWare — the L2 that made smart-contract wallets with custom signers viable.
  • SimpleWebAuthn — by far the nicest WebAuthn library in the JS ecosystem.
  • Hono, Angular, Drizzle, Vitest, Testcontainers — the backbone of the stack.

Thanks also to everyone who files issues, sends patches, and helps other users. Open source wouldn't work without you.

Buy Us a Coffee

BIM is free and open-source, but it isn't free to run. Servers, domains, third-party APIs and infrastructure all cost real money, and the project is currently funded out of pocket. If BIM is useful to you and you'd like to help keep the lights on, a tip goes a long way — on-chain Bitcoin or Lightning.

Bitcoin on-chain address QR code
Bitcoin
Lightning BOLT12 offer QR code
Lightning

Bitcoin (on-chain):

bc1pdnjg4rztupfqr2rey36eq0m6x8x52p48fzhmmq4wr8eupchler7skf6j25

Lightning (BOLT12):

lno1pgqppmsrse80qf0aara4slvcjxrvu6j2rp5ftmjy4yntlsmsutpkvkt6878syv7z0purjdjjuf3xr4g532flx49fe9z6n2yt6wf3vlmtu5cc9rh8qgp9nlzyfxunyfgqx5l8jsx8dxr0289s9q5jckvj7la8vxhh4avmj2gqxwhmjuyz0snkaycdxy0j6dtncpft3ytkfc9jj0mcvjv866eawd8hpy2rruls8k8ak064swxvqyzktyet606s8u7gwj8v7z430pks253hwp6uh04y4xvyvkh3zplm8yx2hylt9udeqqeqm8njux88zzrwwarm04jkdwc07xnvcde23eurgnu2zj8dsv3wqs0amhdzvkpcl0yy3z7yqwnzda6dkqls

Thank you for your support — every sat helps. 🙏

About

Bitcoin wallet on Starknet — PWA, seedless, gasless

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages