Skip to content

API of Alfred Wallet, Alfred Wallet is a Bitcoin Lightning Network wallet focused on Mozambique (MZ), enabling fast and low-cost payments while promoting financial inclusion.

License

Notifications You must be signed in to change notification settings

MatimbaBTC/afred-wallet-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

⚡ Alfred Wallet API

API for the Bitcoin Lightning Wallet, P2P & Marketplace Platform

A complete platform built on the Bitcoin Lightning Network, integrated with the Blink API, enabling fast payments, P2P transaction, digital marketplaces, and real-world BTC usage in physical stores to.


Overview

This project creates a Bitcoin-first ecosystem, where users can:

  • BTC transactions and payments using the Lightning Network
  • Make user → user internal transactions with zero fees
  • Perform P2P BTC ↔ fiat swaps using a logical escrow system
  • Discover nearby stores that accept Bitcoin through an interactive map (BTC Map)
  • Create marketplaces with Lightning payments via QR Code

General Architecture

Frontend Repository

Frontend ( Mobile Android/ iOS "React Native" )
   ↓
Spring Boot (Java)
   ├── Auth & Users
   ├── Marketplace
   ├── Admin & APIs públicas
   └── Integrações Fiat (M-Pesa)
        ↓
Axum (Rust)
   ├── Wallet Core
   ├── Lightning Payments
   ├── P2P Escrow Engine
   └── WASM Runtime
        ↓
Blink API (BTC / Lightning)


Technologies Used

Backend — Java (Spring Boot)

  • Java 17+
  • Spring Boot
  • Spring Security (JWT Authentication)
  • Spring Data JPA
  • PostgreSQL / MySQL
  • Redis (cache and locks)

Responsibilities:

  • User registration and authentication
  • Marketplace and product management
  • Admin dashboard
  • Fiat integrations (e.g. M-Pesa)
  • API orchestration

Core Services — Rust (Axum)

  • Rust
  • Axum
  • Tokio
  • Tower
  • Reqwest

Responsibilities:

  • Lightning wallet core
  • BTC payments
  • User → user internal transfers
  • P2P escrow engine
  • Direct integration with the Blink API

WebAssembly (WASM)

  • Rust + wasm-bindgen
  • Wasmtime (server-side runtime)

Used for:

  • Critical escrow logic
  • Deterministic validations
  • Fee and conversion calculations
  • Secure and isolated execution

Key Features

Lightning Wallet

  • Send and receive BTC
  • Balance displayed in sats Bitcoin and mozabican fiat
  • Instant internal transfers (user → user)

P2P Swap (Logical Escrow)

  • Users can create buy/sell offers
  • Other users can accept offers
  • Atomic execution:
    • Fiat payment confirmed
    • BTC released
  • No on-chain smart contracts

BTC Map Integration

  • Shows Bitcoin-accepting stores within a 20 km radius
  • Store details and navigation support
  • Encourages real-world BTC usage

Lightning Marketplace

  • Any user can create a marketplace
  • Free plan with up to 500 MB of storage
  • Product catalog and menu pages
  • QR Code generation
  • Lightning payments supported by:
    • Alfred Wallet
    • Blink
    • Other Lightning wallets (e.g. Breez)
  • Users can view all marketplaces in the app on a map interface.

External Integrations

  • Blink API — Bitcoin & Lightning Network
  • BTC Map — Merchant discovery
  • M-Pesa / Fiat APIs — Fiat payments
  • Lightning Network — Fast, low-fee transactions

Project Goal

To build a scalable and secure platform that:

  • Encourages the use of Bitcoin for everyday payments in Mozambique
  • Enables instant, low-fee payments
  • Connects users, merchants, and marketplaces
  • Uses modern, high-performance technologies

License

MIT License

About

API of Alfred Wallet, Alfred Wallet is a Bitcoin Lightning Network wallet focused on Mozambique (MZ), enabling fast and low-cost payments while promoting financial inclusion.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published