• Stars
    star
    899
  • Rank 50,793 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created over 7 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Privacy-Preserving Bitcoin Light Client

Neutrino: Privacy-Preserving Bitcoin Light Client

Build Status Godoc Coverage Status

Neutrino is a Bitcoin light client written in Go and designed with mobile Lightning Network clients in mind. It uses a new proposal for compact block filters to minimize bandwidth and storage use on the client side, while attempting to preserve privacy and minimize processor load on full nodes serving light clients.

Mechanism of operation

The light client synchronizes only block headers and a chain of compact block filter headers specifying the correct filters for each block. Filters are loaded lazily and stored in the database upon request; blocks are loaded lazily and not saved.

Usage

The client is instantiated as an object using NewChainService and then started. Upon start, the client sets up its database and other relevant files and connects to the p2p network. At this point, it becomes possible to query the client.

Queries

There are various types of queries supported by the client. There are many ways to access the database, for example, to get block headers by height and hash; in addition, it's possible to get a full block from the network using GetBlockFromNetwork by hash. However, the most useful methods are specifically tailored to scan the blockchain for data relevant to a wallet or a smart contract platform such as a Lightning Network node like lnd. These are described below.

Rescan

Rescan allows a wallet to scan a chain for specific TXIDs, outputs, and addresses. A start and end block may be specified along with other options. If no end block is specified, the rescan continues until stopped. If no start block is specified, the rescan begins with the latest known block. While a rescan runs, it notifies the client of each connected and disconnected block; the notifications follow the btcjson format with the option to use any of the relevant notifications. It's important to note that "recvtx" and "redeemingtx" notifications are only sent when a transaction is confirmed, not when it enters the mempool; the client does not currently support accepting 0-confirmation transactions.

GetUtxo

GetUtxo allows a wallet or smart contract platform to check that a UTXO exists on the blockchain and has not been spent. It is highly recommended to specify a start block; otherwise, in the event that the UTXO doesn't exist on the blockchain, the client will download all the filters back to block 1 searching for it. The client scans from the tip of the chain backwards, stopping when it finds the UTXO having been either spent or created; if it finds neither, it keeps scanning backwards until it hits the specified start block or, if a start block isn't specified, the first block in the blockchain. It returns a SpendReport containing either a TxOut including the PkScript required to spend the output, or containing information about the spending transaction, spending input, and block height in which the spending transaction was seen.

Stopping the client

Calling Stop on the ChainService client allows the user to stop the client; the method doesn't return until the ChainService is cleanly shut down.

More Repositories

1

lightning-app

An easy-to-use cross-platform Lightning wallet
JavaScript
901
star
2

loop

Lightning Loop: A Non-Custodial Off/On Chain Bridge
Go
558
star
3

lightning-terminal

Lightning Terminal: Your Home for Lightning Liquidity
Go
499
star
4

taproot-assets

A layer 1 daemon, for the Taproot Assets Protocol specification, written in Go (golang)
Go
458
star
5

pool

Lightning Pool: a non-custodial batched uniform clearing-price auction for Lightning Channel Leases (LCL). An LCL packages up inbound channel liquidity (ability to receive funds) as a fixed income asset with a maturity date expressed in blocks.
Go
253
star
6

aperture

โšก๏ธL402 (Lightning HTTP 402) Reverse Proxy โšก๏ธ
Go
233
star
7

chantools

A loose collection of tools all somehow related to lnd and Lightning Network channels.
Go
219
star
8

lndmon

๐Ÿ”Žlndmon: A drop-in monitoring solution for your lnd node using Prometheus+Grafana
Go
151
star
9

faraday

Lightning Channel Management & Optimization Tool
Go
130
star
10

LangChainBitcoin

AI tools for giving LangChain agents access to Bitcoin and the ability to traverse L402 APIs
Python
128
star
11

lightning-node-connect

Go
78
star
12

L402

lsat protocol specification
71
star
13

lightning-faucet

A faucet for the Lightning Network!
Go
71
star
14

lightning-coindesk

A tutorial news app exemplifying Lightning Network micropayments integration
Python
54
star
15

docs.lightning.engineering

Building lapps, running lnd, and more
Markdown
50
star
16

lndclient

Golang client library for lnd
Go
48
star
17

lnc-web

Lightning Node Connect npm module for web
TypeScript
48
star
18

lightning-api

JavaScript
35
star
19

falafel

Go tool to generate go APIs for gRPC services for use on mobile/WASM platforms.
Go
34
star
20

lndinit

cloud infra tooling for lnd provisioning/unlocking
Go
26
star
21

lightning-dev-site

Lightning Network Daemon Developer Site
CSS
25
star
22

builders-guide-sample-app

TypeScript
14
star
23

lightninglabs.github.io

CSS
13
star
24

pool-paper

Lightning Pool: A Non-Custodial Channel Lease Marketplace
TeX
11
star
25

chanleakcheck

A tool to check if your lnd node was targeted by CVE-2019-12999
Go
10
star
26

lnc-rn

Lightning Node Connect npm module for React Native
TypeScript
8
star
27

lnc-core

Type definitions and utilities for Lightning Node Connect, leveraged by lnc-web and lnc-rn
TypeScript
7
star
28

dust-tool

dust exposure tool
Go
6
star
29

lightning-api-ng

Automated API-documentation generation source code for Lightning Lab's FOSS software suite
Go
5
star
30

lnd-fuzz

Shell
3
star
31

gh-actions

Vendored GitHub Action scripts
TypeScript
3
star
32

aezeedcheck

A offline CLI that allows one to verify their aezeed mnemonic
Go
2
star