GithubHelp home page GithubHelp logo

ozitv / bitcoin-lightning Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juancarlospaco/bitcoin-lightning

1.0 1.0 0.0 379 KB

Open-source zero-fee no-download offline-capable anonymous instant micropayments platform with plugins Bitcoin Lightning ⚡️

License: MIT License

Nim 100.00%

bitcoin-lightning's Introduction

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.

lightning-atm.mp4

Shop

  • Rural or mobile shops just need 1 QR, works even without internet (invoice via SMS) or electricity (QR or URL).
lnurl-shop-rural-south-africa.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

💰➡️🍕

Bitcoin BTC

BEP20 Binance Smart Chain Network BSC

0xb78c4cf63274bb22f83481986157d234105ac17e

BTC Bitcoin Network

1Pnf45MgGgY32X4KDNJbutnpx96E4FxqVi

Lightning Network

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

Stars

@luisacosta828@juancarlospaco@overtube@adam-acosta@kirbylife@22388o@Miqueas@codehangen

bitcoin-lightning's People

Contributors

22388o avatar adam-acosta avatar juancarlospaco avatar kirbylife avatar luisacosta828 avatar miqueas avatar overtube avatar

Stargazers

 avatar

Watchers

 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.