Skip to content

Instantly share code, notes, and snippets.

View remyers's full-sized avatar

Richard Myers remyers

View GitHub Profile
@remyers
remyers / wsl2-network.ps1
Created January 24, 2022 14:35 — forked from xmeng1/wsl2-network.ps1
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
@remyers
remyers / async-payment-donation.md
Last active December 18, 2023 02:35
async-payments user story: donation QR code

The async-payment user story I'm interested in exploring is a mobile user (not always connected) who wants to receive donations (no PoP) via a static invoice from another mobile user.

My understanding of how this could work:

  1. The static invoice should contain a blinded route to the payment receiver via their LSP and an ephemeral public key that the payment sender will use to encrypt the last hop of a payment onion containing a keysend TLV. The LSP of the payment receiver must support store-and-forward of onion messages.

  2. A payment sender builds a payment onion where the first hop is their LSP that supports trampoline payments, onion messages and async-payments. The first hop of the onion includes a TLV to indicate the payment should be held until triggered (with a async-payment nonce) and gives the blinded route to the payment receiver. The last hop of the onion is encrypted to the payment receiver's ephemeral public key and includes:

  • the keysend TLV payment secret
  • the amount being sent
@remyers
remyers / channel_interceptor.md
Last active January 16, 2023 13:15
channel interceptor comparison
CLN (openchannel, openchannel2) LND (ChannelAcceptResponse) Eclair Description Example plugin use cases Include? Reason
result accept AcceptOpenChannel, RejectOpenChannel accept or continue the channel open whitelist Yes basic usage
psbt, our_funding_msat fundingAmount, psbt? to add inputs/outputs
@remyers
remyers / importrecent.sh
Last active September 1, 2023 11:33
Script to import recently used addresses from a legacy wallet into a new descriptor wallet
#!/bin/bash
shopt -s expand_aliases
alias btc-cli='bitcoin-cli -datadir=.bitcoin'
if [[ $# -lt 3 ]]; then echo "usage: $0 <rpcwallet-from> <rpcwallet-to> <maximum confirmations>" ; exit 1 ; fi
FROM=$1
TO=$2
CONFIRMATIONS=$3
@remyers
remyers / coin-selection-lsp.md
Last active February 13, 2024 13:48 — forked from t-bast/coin-selection-lsp.md
Coin selection for liquidity providers

Coin selection for liquidity providers

Bitcoin Core's coin selection algorithms optimizes mostly for the following metrics:

  • keep a low utxo count by consolidating regularly
  • avoid creating a change output
  • when a change output is needed, use an amount equivalent to the payment (for privacy)

This doesn't match what liquidity providers need. Liquidity providers need to: