• Stars
    star
    148
  • Rank 249,169 (Top 5 %)
  • Language
    Go
  • License
    BSD 2-Clause "Sim...
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

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

Repository Details

Bitcoin full node with Ledger Live

Ledger SatStack

satstack logo

Ledger SatStack is a lightweight bridge to connect Ledger Live with your personal Bitcoin full node. It's designed to allow Ledger Live users use Bitcoin without compromising on privacy, or relying on Ledger's infrastructure.

Table of Contents

Background

Running a full node is the only way you can use Bitcoin in a completely trustless way. A full node downloads the entire blockchain, and checks it against Bitcoin's consensus rules, and contributes to the decentralization and economic strength of Bitcoin. However, a far more compelling reason to run your own node is privacy. ...read more.

Running a node can be difficult for some users, and has associated costs in terms of network bandwidth and disk usage. This is why Live connects to Bitcoin nodes running on Ledger's infrastucture, wrapped around by indexer and explorer services to ensure fast queries. While security and privacy is core to Ledger, one can make a theoretical case that Ledger can spy on transaction details, or even censor certain addresses from using Ledger's services.

SatStack aims to render Ledger's infrastructure dispensable, by allowing users to connect Ledger Live with their personal Bitcoin full node.

Architecture

Ledger SatStack is a standalone Go application, that acts as a bridge between the Ledger Live application and a Bitcoin Core full-node. It exposes a REST interface to the open-source JS library embedded by Live, and communicates to the Bitcoin node over RPC. It utilizes the transport layer and data-structures of btcd.

Requirements

  • Bitcoin Nano app 2+
  • Bitcoin Core 0.22.0+
  • Ledger Live (desktop) 2.44.0+ but don't go as far 2.53+ that breaks satstack! https://download.live.ledger.com/ to get the latest supported i.e. 2.52.0
  • txindex=1 in bitcoin.conf is not mandatory, but recommended. Pruned nodes are not currently supported.
  • Wallet should NOT be disabled (attn. Raspiblitz users).

Usage

Setup Ledger Live (recommended way but only works without Tor)

The easiest way of getting started is to use the dedicated setup flow directly on Ledger Live. A detailed guide is available here.

Manual setup (for advanced users)

Retrieve descriptors from device

Simply follow these steps:

  1. Plug in your Ledger device via USB.
  2. Enter your PIN code on the device, and open the Bitcoin app.
  3. Run the scripts/getdescriptor script, as shown below.
$ cd scripts
$ python3 -m venv venv  # ensure Python 3.8+
$ source venv/bin/activate
(venv) $ pip install -r requirements.txt
(venv) $ ./getdescriptor --scheme native_segwit --chain main --account 3
External: wpkh([b91fb6c1/84'/0'/3']xpub6D1gvTP...VeMLtH6/0/*)
Internal: wpkh([b91fb6c1/84'/0'/3']xpub6D1gvTP...VeMLtH6/1/*)

if you get an unsupported hash type ripemd160 error, please see this

Create configuration file

Create a config file lss.json in your home directory. You can use this sample config file as a template.

Add "torproxy": "socks5://127.0.0.1:9050", to connect to a Tor client running locally so that satstack can reach a full node behind Tor. Replace the rpcurl with the .onion address of your node.

Optional account fields
  • depth: override the number of addresses to derive and import in the Bitcoin wallet. Defaults to 1000.

  • birthday: set the earliest known creation date (YYYY/MM/DD format), for faster account import. Defaults to 2013/09/10 (BIP0039 proposal date). Refer to the table below for a list of safe wallet birthdays to choose from.

    Event Date (YYYY/MM/DD)
    BIP0039 proposal created 2013/09/10 (default)
    First ever BIP39 compatible Ledger device (Nano) shipped 2014/11/24
    First ever Ledger Nano S shipped 2016/07/28
Launch Bitcoin full node

Make sure you've read the requirements first, and that your node is configured properly. Here's the recommended configuration for bitcoin.conf:

It is not recommended to use rpcuser/rpcpassword in the bitcoin.conf of your full node use rpcauth instead. If you still want to use it make sure the following settings are in your bitcoin.conf file:

# Enable RPC server
server=1

# Enable indexes
txindex=1
blockfilterindex=1

# Set RPC credentials
rpcuser=<user>
rpcpassword=<password>

If you want to use the newest security standard recommended by the core-devs then read the following paragraph. Get the rpcauth.py script from the bitcoin repo and create a new user for satstack.

wget https://raw.githubusercontent.com/bitcoin/bitcoin/master/share/rpcauth/rpcauth.py

python3 rpcauth.py satstack

Example Output:
rpcauth=satstack:a14191e6892facf70686a397b126423$ddd6f7480817bd6f8083a2e07e24b93c4d74e667f3a001df26c5dd0ef5eafd0d
Your password:
VX3z87LBVc_X7NBLABLABLABLA

Copy the rpcauth= into your bitcoin.conf Note down the password and use them in your lss.json. There you will use the credentials

In your lss.json:

"rpcuser": "satstack",
"rpcpassword": "VX3z87LBVc_X7NBLABLABLABLA"
# Enable RPC server
server=1

# Enable indexes
txindex=1
blockfilterindex=1

# Set RPC credentials
# Example Auth, replace with your own.
# see https://bitcoin.stackexchange.com/questions/46782/rpc-cookie-authentication why we are not using normal rpcuser/password
rpcauth=satstack:a14191e6892facf70686a397b126423$ddd6f7480817bd6f8083a2e07e24b93c4d74e667f3a001df26c5dd0ef5eafd0d

Then launch bitcoind like this:

bitcoind
Launch SatStack

Pre-built binaries are available for download on the releases page (Linux, Windows, MacOS). Extract the tarball, and launch it as:

./lss

There are some cmd handles which can be useful when configuring the setup the first time. List them with

./lss -h or ./lss --help

When setting up a new wallet, the wallet is synced form the birthday date or your custom date set in lss.json When the initial sync sucessfully completes, satstack saves a file called lss_rescan.json at the exact location where the lss.json is stored. This file includes the latest blockheight your wallet was synced to, this allows satstack on every restart to not rescan the whole wallet again but only rescan the difference between the current blockheight. You can also change the latest blockheight manually in the file which helps you to set the rescan delta manually. This file is only created when an initial wallet sync was successful. Removing the file will lead satstack to rescan the complete wallet again when starting up.

If you want to build lss yourself, just do the following:

(make sure you have mage installed first)

mage release  # or "mage build" for a development build

On startup, SatStack will wait for the Bitcoin node to be fully synced, and import your accounts. This can take a while.

Launch Ledger Live Desktop
# environment variables `EXPLORER` and `EXPLORER_SATSTACK` should point at the address
# where `lss` is listening (can be a differnet computer/server)
$ EXPLORER=http://127.0.0.1:20000 <Ledger Live executable>
Turn SatStack into a service

Once descriptors are imported, you might want to automatically start SatStack on your computer as a background task. On Linux, you can do so thanks to systemd, you will have to use the WorkingDirectory settings so that SatStack finds the config file. You will also have to have a tor deamon running in the background.

Misc

If you get error=failed to load wallet: -4: Wallet file verification failed. SQLiteDatabase: Unable to obtain an exclusive lock on the database, is it being used by another bitcoind? maybe this is because you have bitcoind windows opened, if this is the case, please try closing them and restart lss.

In the press

Title Source
🇬🇧 Personal sovereignty with Ledger SatStack blog.ledger.com
🇫🇷 Ledger SatStack: un pont entre Bitcoin Core et votre Ledger Wallet bitcoin.fr
🇫🇷 Votre propre coffre-fort à bitcoins… inviolable – Ledger annonce l’arrivée des full nodes Bitcoin Journal du Coin
🇫🇷 Il est désormais possible d’exécuter un full node Bitcoin sur Ledger Live beincrypto.com
🇪🇸 Ledger Live será compatible con nodos propios de Bitcoin CriptoNoticias
🇬🇧 Bitcoin Tech Talk #218: Curing Monetary Stockholm Syndrome (mention) Jimmy Song

Community

For feedback or support, please tag @adrien_lacombe and @Ledger on Twitter. To report any bugs related to full node on Ledger Live, you can create issues on this repository.

Contributing

Contributions in the form of code improvements, documentation, tutorials, and feedback are most welcome.

For contributions to the code, we recommend these guidelines.

Call for Cowsay contributions

On startup, satstack will display a message about Bitcoin, randomly picked from a curated collection of interesting quotes, facts, email excerpts, etc. You are welcome to contribute by creating a pull request modifying this file (includes guidelines for editing the file). Here's an example of how it is rendered:

Cowsay ideas

Please mention the source when you make a contribution, so we can attribute the original author(s) and include a copy of the license if required.

More Repositories

1

ledger-live-desktop

⛔️ DEPRECATED - Ledger Live (Desktop)
JavaScript
954
star
2

ledgerjs

⛔️ MOVED to monorepo "ledger-live"
TypeScript
574
star
3

ledger-live

Mono-repository for packages related to Ledger Live and its JavaScript ecosystem.
JavaScript
410
star
4

ledger-live-mobile

⛔️ DEPRECATED - Ledger Live (Mobile)
JavaScript
381
star
5

ledger-nano-s

Ledger Nano S, a personal security device from Ledger (blockchain / bitcoin / ethereum / FIDO)
277
star
6

app-monero

Monero wallet application for Ledger Nano S & X
Python
267
star
7

app-ethereum

Ethereum wallet application for Ledger devices
C
178
star
8

ledger-wallet-chrome

Ledger Wallet Chrome application
JavaScript
162
star
9

ledger-javacard

Ledger Unplugged - Java Card implementation of Ledger Bitcoin Hardware Wallet
Java
140
star
10

ledger-live-common

⛔️ DEPRECATED - Common ground for the Ledger Wallet apps
TypeScript
135
star
11

speculos

Ledger Nano/Blue apps emulator
C
129
star
12

app-bitcoin

Bitcoin wallet application for Ledger Blue and Nano S
C
118
star
13

blue-loader-python

Python Loader for Ledger Blue (all), Nano S (all) and Nano X (developer units)
Python
114
star
14

openpgp-card-app

OpenPGP Card Application
C
110
star
15

nanos-secure-sdk

Secure (ST31) SDK for Ledger Nano S
C
94
star
16

app-bitcoin-new

Modern Bitcoin Application based on PSBT and Descriptors
C
93
star
17

ledger-wallet-api

High level API to the Ledger Wallet Chrome app
HTML
82
star
18

lib-ledger-core

C++
79
star
19

app-ssh-agent

Simple SSH and GPG agent for Ledger Blue and Nano S
C
78
star
20

udev-rules

udev rules to support Ledger devices on Linux
Shell
76
star
21

app-passwords

Password Manager application for Ledger Blue and Nano S
C
74
star
22

ledger-wallet-ripple

JavaScript
65
star
23

ledger-u2f-javacard

Java Card FIDO U2F authenticator for Ledger Unplugged
Java
63
star
24

btchip-python

Ledger HW.1 Python API
Python
60
star
25

ledger-wallet-ethereum-chrome

Ledger Wallet Ethereum Chrome application
JavaScript
55
star
26

ledger-sample-apps

Sample Applications for Ledger Nano S and Ledger Blue
C
54
star
27

ledgerjs-examples

LedgerJS examples
JavaScript
53
star
28

ledger-manager-chrome

Ledger Manager Chrome application
Scala
50
star
29

android-u2f-bridge

Generic support for USB U2F tokens on Android
Java
49
star
30

ledger-dotnet-api

.NET API for Ledger
C#
48
star
31

xpub-scan

Tool to perform master public key analysis
TypeScript
45
star
32

ledger-blue

Ledger Blue, a personal security device from Ledger (blockchain / bitcoin / ethereum / FIDO)
41
star
33

ledger-device-rust-sdk

Rust SDK for Ledger device applications
Rust
38
star
34

wallet-api

Wallet API Monorepo
TypeScript
38
star
35

ledgerctl

A library to control Ledger devices
Python
37
star
36

bolos-enclave

BOLOS community enclave for SGX & simulator
C
34
star
37

ledger-wallet-ios

Ledger Wallet iOS application
Swift
34
star
38

app-u2f

FIDO U2F Application for Ledger Blue and Nano S
C
33
star
39

app-boilerplate

Boilerplate application for Ledger Nano S/X
C
33
star
40

recover-whitepaper

33
star
41

app-boilerplate-rust

Rust boilerplate application for Ledger Nano S/S+/X
Python
31
star
42

bolos-tee

Implementation of Ledger BOLOS for TEE applications
C
29
star
43

ledger-dev-doc

DEPRECATED - please use https://github.com/LedgerHQ/developer-portal
Python
28
star
44

developer-portal

MDX
27
star
45

nanos-ui

UI application for Ledger Nano S
C
26
star
46

blue-devenv

DEPRECATED - Development Environment for Ledger Blue and Nano S
26
star
47

OUTDATED_ledger-wallet-android

OUTDATED – for Ledger Live mobile, the correct repository is here =>
Scala
26
star
48

solidity-exercise

A RPG multiplayer game that will be used for interviews and internal workshops.
Solidity
22
star
49

app-streaming

Develop apps without any constraints
C
22
star
50

ledger-app-builder

Docker image to compile app for the Ledger Nano S.
Dockerfile
22
star
51

rust-app-demo

(DEPRECATED) Proof of concept setup for a Rust App on Nano
Rust
19
star
52

ledger-secure-os

C
19
star
53

nanox-secure-sdk

This repository has been replaced by https://github.com/LedgerHQ/ledger-secure-sdk/. Please read the new repository README for more information.
C
19
star
54

app-xrp

Ripple wallet application for Ledger Blue and Nano S
C
18
star
55

connect-kit

TypeScript
16
star
56

rust-app-password-manager

Rust
15
star
57

ui

⛔️ MOVED to monorepo "ledger-live"
TypeScript
15
star
58

app-starknet

Official Ledger Starknet application (Rust implementation)
Python
15
star
59

ledger-wallet-webtool

A utility application used to deploy utility functions to Ledger users
JavaScript
14
star
60

ledger-fresh-management

This is where product topics are discussed for Ledger Fresh
14
star
61

nanos-nonsecure-firmware

Non Secure (STM32) Firmware for Ledger Nano S
C
14
star
62

cargo-ledger

(Moved in the ledger device rust SDK --> https://github.com/LedgerHQ/ledger-device-rust-sdk). Load code on a Ledger device with a `cargo` subcommand
Rust
14
star
63

live-app-sdk

TypeScript
13
star
64

ledger-live-wagmi-connector

Wagmi JS lib Connector for Ledger Live Dapp Browser
TypeScript
13
star
65

lascar

Mirror of lascar (https://github.com/Ledger-Donjon/lascar)
Python
13
star
66

app-starknet-zondax

Starknet application for Ledger Nano S, SP, X
Rust
13
star
67

moosig

Fun with MuSig2 and Ledger devices 🎵
Python
13
star
68

nanos-nonsecure-firmware-releases

Non Secure (STM32) Firmware releases for Ledger Nano S
12
star
69

blue-secure-sdk

Secure (ST31) SDK for Ledger Blue
C
12
star
70

web3allowlist

Allowlist data for Web3Checks
Python
12
star
71

lib-ledger-core-node-bindings

C++
12
star
72

btchip-c-api

Ledger HW.1 C APIs
C
12
star
73

resigner

The hottest miniscript signing server
Python
12
star
74

innovation-contracts-solidity

Collection of smart contracts written in Solidity
Solidity
11
star
75

app-plugin-boilerplate

C
10
star
76

ledger-nano-piv

Hackathon project, not production ready (yet)
Rust
9
star
77

app-age

Rust
9
star
78

ledger-repl

DEPRECATED, this project moved to https://github.com/LedgerHQ/ledger-live – this repository will be archived once we migrated the website too
JavaScript
9
star
79

btchip-doc

Ledger HW.1 firmware documentation
HTML
9
star
80

app-near

Ledger repo for Near app
C
9
star
81

ledger-javacard-eligibility

Java Card applet to test features and performance of a Hierarchical Deterministic Bitcoin Hardware Wallet implementation
Java
9
star
82

ledger-asset-dapps

Python
9
star
83

passwords-backup

JavaScript
8
star
84

ledger-starter-iso

Ledger Starter ISO recipe
Python
8
star
85

vanadium-legacy

Unlimited power for apps
C
8
star
86

lib-ledger-core-react-native-bindings

Java
8
star
87

ledger-app-otherdime

Offchain private key exchange as an attestation demonstration for Ledger Blue and Nano S
C
8
star
88

app-recovery-check

C
7
star
89

app-exchange

Exchange application to SWAP and SELL with Ledger Live
C
7
star
90

CTF

C
7
star
91

ragger

Small wrapper around Speculos, LedgerWallet & LedgerComm to ease instrumentation
Python
7
star
92

wallet-connect-live-app

TypeScript
7
star
93

btchip-js-api

Ledger HW.1 JavaScript APIs
JavaScript
7
star
94

starknet-wallet-contracts

Python
7
star
95

ethereum-plugin-sdk

C
7
star
96

bitcoin-lib-grpc

A modular gRPC service to interact with the Bitcoin protocol. ₿
Go
7
star
97

blue-nonsecure-firmware

Non Secure (STM32) Firmware for Ledger Blue
C
7
star
98

ledger-fresh-web

Frontend of Ledger fresh, our open source web wallet based on the account abstraction
TypeScript
7
star
99

ledgercomm

Library to communicate with Ledger Nano S/X and Speculos
Python
7
star
100

notification-center

Open source notification web service
TypeScript
6
star