Git Product home page Git Product logo

breez-sdk's Introduction

Breez SDK

Overview

The Breez SDK enables mobile developers to integrate Lightning and bitcoin payments into their apps with a very shallow learning curve. The use cases are endless – from social apps that want to integrate tipping between users to content-creation apps interested in adding bitcoin monetization. Crucially, this SDK is an end-to-end, non-custodial, drop-in solution powered by Greenlight, a built-in LSP, on-chain interoperability, third-party fiat on-ramps, and other services users and operators need.

The Breez SDK provides the following services:

  • Sending payments (via various protocols such as: bolt11, keysend, lnurl-pay, lightning address, etc.)
  • Receiving payments (via various protocols such as: bolt11, lnurl-withdraw, etc.)
  • Fetching node status (e.g. balance, max allow to pay, max allow to receive, on-chain balance, etc.)
  • Connecting to a new or existing node.

Demo

demo.mp4

For a higher resolution video, click here.

Architechture

This diagram is a high-level description of the Breez SDK:

SDK Architecture

Signer

This module handles everything related to the signing of lightning messages. It is initialized with the user’s seed.

InputParser

This module parses user input that is related to sending and receiving of payments. It identifies the protocol (lightning, lnurl-pay, lightning address, lnurl-withdraw, btc address, etc.) and the related data. Apps should use this parser to interpret users input, display the details to users and then execute the specific action (pay or receive).

LightningNode

This is an interface that defines how the SDK interacts with the user’s Lightning node. The interface defines methods to create a new node, connect to an existing node, pay or create invoices. It also provides access to the node’s low-level functionality such as: listing peers, graph information etc. Currently we only have one provider (Greenlight) but we can add more providers in the future.

BTCSwapper

This module provides the ability to send or receive on-chain payments via submarine swaps. Send to a BTC address is done by a reverse submarine swap and receive by a regular submarine swap. It includes refund functionality as well.

FiatCurrencies

This module provides fiat currencies conversion services and fiat on-ramp service (via MoonPay).

LSP

This module provides the interface of interacting with one or more LSPs.

Build & Test

The libs folder contains three sub folders and is a structured as a cargo workspace:

  • sdk-core: the core SDK rust library.
  • sdk-bindings: ffi bindings for Kotlin & Swift.
  • sdk-flutter: a flutter plugin (includes ffi bindings for dart).

The tools folder contains a simple command line interface (sdk-cli) to the SDK See instruction in each sub project readme on how to build, test and run.

API

To get started with the Breez SDK API, please follow the documentation here.

Features

  • ‘On-the-fly’ channel creation
  • Send/receive bolt11
  • LNURL-Pay
  • LNURL-Withdraw
  • Backup/restore using mnemonics
  • Send zero-amount invoices
  • Fiat currencies
  • Send spontaneous payments
  • Send to a Lightning address
  • Send to BIP 21
  • cli inteface
  • Swift bindings
  • Kotlin bindings
  • API key
  • Receive via on-chain address
  • Send to an on-chain address
  • React Native bindings
  • LNURL-Auth
  • MoonPay fiat on-ramp
  • Spend all funds
  • Mobile Notifications
  • Offline receive via notifications
  • Performance optimizations
  • Close channels to a predefined address
  • Make mempool.space dependency optional
  • Receive 0 amount invoice via LSP (unified QR)
  • Send/receive bolt12
  • Async payments
  • LDK support
  • Splicing
  • WebAssembly support

breez-sdk's People

Contributors

ademar111190 avatar erdemyerebasmaz avatar kingonly avatar ok300 avatar roeierez avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.