bitcoinlightning

Bitcoin Lightning client

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:25

Tags

Installation

nimble install bitcoinlightning
choosenim install bitcoinlightning
git clone https://github.com/juancarlospaco/bitcoin-lightning

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
bitcoinlightning - - - - - - -

README

Bitcoin Lightning client

  • Open-source zero-fee no-download offline-capable anonymous instant micropayments platform with plugins.

Offline

  • DIY cardboard offline Bitcoin ATMs, Arduino/RaspberryPi.

https://user-images.githubusercontent.com/1653275/136722218-10bc7a5a-7194-4a38-8a54-86825bab704e.mp4

Shop

  • Rural or mobile shops just need 1 QR, works even without internet (invoice via SMS) or electricity (QR or URL).

https://user-images.githubusercontent.com/1653275/166477530-63653087-dd5e-4843-ab64-79cfcb339fcf.mp4

Example

import bitcoinlightning
let client: BitcoinLightning = newBitcoinLightning(apiKey = "YOUR_API_KEY_HERE")
echo client.getWallet()                        # Get your wallet.
echo client.getInvoice(amount = 666.Positive)  # Receive (Sell).
echo client.payInvoice("YOUR_INVOICE_HERE")    # Send (Pay).

ELI5

  • Receive money with 1 new Bitcoin Lightning incoming invoice, thats just 1 string (or Link, or QR).
  • Send money with 1 new Bitcoin Lightning outgoing invoice, thats just 1 string (or Link, or QR).

Design

  • It does not use anything from Nim standard library, very future-proof.
  • HTTPS JSON REST API, KISS. 1 file, <100 lines, zero dependencies, any target.
  • Simple minimal API, all functions with 2 arguments max.
Disclaimer Bitcoin Lightning is decentralized, so theres multiple services, but this way was the simplest and recommended approach as of 2022, if you just want to build something that can be monetized quickly. I investigated to use lntxbot but it has no HTTP API. I investigated to use Bitrefill but it has no HTTP API. I investigated to use Binance but it has no Lightning API. Anyway the idea of the Lightning network is that the API server does not really matter, because you can just send to any other Lightning wallet anywhere. In the future, if better services appear, then the library can be changed.

FAQ

  • I try to send a million USD/EUR and it fails?

It is a lightweight API for MICROpayments, use Bitcoin onchain for big amounts.

  • I need to generate QR?

https://github.com/ThomasTJdev/nim_qr#examples

  • I need more features, like other coins and more?

https://github.com/juancarlospaco/binance#binance

  • Is this a web app?

HTTPS JSON REST API client.

See also

  • https://github.com/juancarlospaco/binance#binance
  • https://github.com/juancarlospaco/tradingview#tradingview
  • https://github.com/juancarlospaco/cloudbet#cloudbet

💰➡️🍕

Bitcoin BTC **BEP20 Binance Smart Chain Network BSC**
0xb78c4cf63274bb22f83481986157d234105ac17e
**BTC Bitcoin Network**
1Pnf45MgGgY32X4KDNJbutnpx96E4FxqVi
**Lightning Network**
juancarlospaco@bitrefill.me
Ethereum ETH Dai DAI Uniswap UNI Axie Infinity AXS Smooth Love Potion SLP Uniswap UNI USDC **BEP20 Binance Smart Chain Network BSC**
0xb78c4cf63274bb22f83481986157d234105ac17e
**ERC20 Ethereum Network**
0xb78c4cf63274bb22f83481986157d234105ac17e
Tether USDT **BEP20 Binance Smart Chain Network BSC**
0xb78c4cf63274bb22f83481986157d234105ac17e
**ERC20 Ethereum Network**
0xb78c4cf63274bb22f83481986157d234105ac17e
**TRC20 Tron Network**
TWGft53WgWvH2mnqR8ZUXq1GD8M4gZ4Yfu
Solana SOL **BEP20 Binance Smart Chain Network BSC**
0xb78c4cf63274bb22f83481986157d234105ac17e
**SOL Solana Network**
FKaPSd8kTUpH7Q76d77toy1jjPGpZSxR4xbhQHyCMSGq
Cardano ADA **BEP20 Binance Smart Chain Network BSC**
0xb78c4cf63274bb22f83481986157d234105ac17e
**ADA Cardano Network**
DdzFFzCqrht9Y1r4Yx7ouqG9yJNWeXFt69xavLdaeXdu4cQi2yXgNWagzh52o9k9YRh3ussHnBnDrg7v7W2hSXWXfBhbo2ooUKRFMieM
Sandbox SAND Decentraland MANA **ERC20 Ethereum Network**
0xb78c4cf63274bb22f83481986157d234105ac17e
Algorand ALGO **ALGO Algorand Network**
WM54DHVZQIQDVTHMPOH6FEZ4U2AU3OBPGAFTHSCYWMFE7ETKCUUOYAW24Q
Polkadot DOT **DOT Network**
13GdxHQbQA1K6i7Ctf781nQkhQhoVhGgUnrjn9EvcJnYWCEd
**BEP20 Binance Smart Chain Network BSC**
0xb78c4cf63274bb22f83481986157d234105ac17e
Binance [https://pay.binance.com/en/checkout/e92e536210fd4f62b426ea7ee65b49c3](https://pay.binance.com/en/checkout/e92e536210fd4f62b426ea7ee65b49c3 "Send via Binance Pay")

Stars

:star: @luisacosta828 :star: @juancarlospaco :star: @overtube :star: @adam-acosta
:star: @kirbylife
:star: @22388o
:star: @Miqueas
:star: @codehangen
:star: @frankmoshe
:star: @hugosenari
:star: @lf-araujo
:star: @eantho
:star: @Bulli77
:star: @degaur
:star: @catsuns
:star: @Shamulwa
:star: @xioren
:star: @osascruz
:star: @nichdemos
:star: @lucasnuic
:star: @ranjian0