Skip to content

Instantly share code, notes, and snippets.


Antoine Poinsot darosior

View GitHub Profile
View rpc_command_hook_is_not_that_much_reckless_and_even_maybe_useful
This is a list of all the possible use cases for the `rpc_command` hook, which I keep so that I don't feel so bad to have
contributed something which had to be fixed 3 times by Rusty and once by Christian :
- "one use case for the rpc_command hook is to always provide a close_to address for a channel" -- niftiney
- "" -- fiatjaf
- " replace `getroute`." -- zmn
- "Or make it more powerful by letting it hook-chain as well." -- zmn

A is funder B is fundee

A initiates the process but B doesn't want its outputs to be snooped easily. One solution could be to require A to provide signed and broadcastable transactions in order to know about B's utxos. This can be done with SIGHASH_SINGLE|SIGHASH_ANYONECANPAY which an input and the corresponding output, so A signs its funding to the channel and can be sure that the created output is the P2WSH multisig used to fund the channel.

One downside of this is that it doesn't allow for change on A's side. This can be solved by using a (segwit) transactions chain. A creates a first tx, let's call it txA1 containing an arbitrary number of its inputs and of change outputs:

darosior /
Last active Sep 28, 2020
C-lightning admin utilities

Which one of your channels are you always failing to route through ?

for scid in $(lc listpeers |jq -r '.peers | map(.channels[].short_channel_id)[]');do echo "$scid failed $(lc listforwards |jq -r '.forwards | map(select(.status | contains("failed")).out_channel)' |grep $scid |wc -l) times";done

Which ones are often succeeding ?

View btcpay_theme.css
.top-header {background-color: #fff;}
.top-header .timer-row__progress-bar {background:#ef8022;}
.top-header .timer-row {background: #ffc313;}
.close-icon {color:#000;}
.payment-tabs__slider {background: #ef8022; }
.separatorGem {background: #ef8022;}
.action-button {color: #fff; background-color: #ef8022;border-color: #ef8022;}
.action-button:hover {background-color: #ffc313;}
.action-button:focus, .action-button.focus {color: #fff;background-color: #ef8022;
border-color: #ef8022;}
darosior /
Created Jan 11, 2020
Install libdb4.8 on Debian (from Ubuntu ppa) for i386 or amd64
#!/usr/bin/env bash
if [ "$#" -ne "1" ]; then
echo "usage :"
echo " $0 <amd64|i386>"
elif ! [ "$1" = "amd64" ] && ! [ "$1" = "i386" ]; then
echo "Bad architecture argument. First and only argument must be amd64 or i386."
mkdir "tmplibdb" && cd "tmplibdb"
if [ "$1" = "amd64" ]; then
darosior /
Created Aug 10, 2019
Sample markdown manpage


lightning-connect - Command for connecting to another lightning node.


connect id [host port]


darosior /
Created Jun 13, 2019
lightning-qt without plugin
#!/usr/bin/env python3
import os
from lightning import LightningRpc, Plugin, RpcError
from PyQt5.QtWidgets import QApplication, QWidget, QMainWindow
from mainWindow import MainWindow
def gui():
"""Launches the Qt GUI"""
darosior / confidentiality rules
Created Mar 15, 2019
Règles de confidentialité / confidentiality rules
View confidentiality rules
Confidentiality rules for c-simple / règles de confidentialités pour c-simple.
I/csimple/c-simple don't store any of your informations. They are your own.
Je/csimple/c-simple ne conserve aucune de vos informations. Elles vous appartiennent.
darosior /
Created Oct 22, 2018
Create a Python virtual environment even without permission
python3 -m venv --without pip "$1"
source "$1/bin/activate"
curl | python3
source "$1/bin/activate"
rm -rf pip