Skip to content

Instantly share code, notes, and snippets.

Avatar

Richard Myers remyers

View GitHub Profile
@remyers
remyers / channel_interceptor.md
Last active January 16, 2023 13:15
channel interceptor comparison
View channel_interceptor.md
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 / async-payment-donation.md
Last active March 22, 2023 18:46
async-payments user story: donation QR code
View async-payment-donation.md

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 / wsl2-network.ps1
Created January 24, 2022 14:35 — forked from xmeng1/wsl2-network.ps1
WSL2 Port forwarding port to linux
View wsl2-network.ps1
$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;
}
View poke_printer.sh
#! /bin/sh
counter=$1
while [ $counter -gt 0 ]
do
cupsenable Canon_MX410_series__5FE302000000
sleep 60
done
View eltoo-timeouts.md

Thoughts on timeouts for eltoo/lot49 based on conversation with Snyke Aug4, 2020.

  • Assume online access to blockchain data once per week
  • Then the settlement tx CSV should be 1 week (~1008 blocks)
  • BUT the problem is: what if upstream node does not have fully signed update tx?
  • NOT a problem for for nodes that originate or receive a payment because they do not have both an upstream AND downstream peers.

Bad Scenario: Node connections: A-> B -> C

View taproot-eltoo.tx
[Fund Channel]
|
|
|
v
P=Musig(A,B)+scripts (for Taproot script-path spend)
Q=Musig(A,B) (for Taproot key-path spend)
OR ----------- [Cooperative Close]
@remyers
remyers / README-Ubuntu18.04.md
Last active April 27, 2020 07:52
LNProxy Ubuntu 18.04 Quick Start
View README-Ubuntu18.04.md

Ubuntu 18.04 install steps:

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install software-properties-common
$ sudo apt install python-pip -y
$ sudo apt install python3-pip -y
$ sudo apt install python3.7-venv -y
$ sudo apt install python3.7-dev -y
@remyers
remyers / gist:e2d4ba6a5cd277d6e319a52492425b90
Last active November 13, 2019 18:05
Debugging SighatureHash in interpreter.cpp
View gist:e2d4ba6a5cd277d6e319a52492425b90
Add this code at end of add_eltoo_witness
self.log.debug("\nbtcdeb --tx=%s --txin=%s --modify-flags=\"-NULLFAIL\"\n",tx_hex, spend_tx_hex)
or to debug from a transaction:
self.log.debug("btcdeb --tx=%s --txin=%s\n", ToHex(close_tx), ToHex(setup_tx[A]) )
Add code before and in the method after the normal CHashWriter call to serialize the txTo.
template <class T>
@remyers
remyers / compressed-tx-txfer.md
Created March 6, 2019 08:03 — forked from AdamISZ/compressed-tx-txfer.md
Compressed tx transfer
View compressed-tx-txfer.md

Looking for optimally minimal data transfer to send a transaction.

Just throwing this out there; I'm sure we can do better.

Some stuff should be pre-agreed by anyone following this protocol. For example:

  • Preagreed: script type (say legacy P2PKH)
  • Preagreed: version 1, locktime 0, sequence maxint-1, fee 10K sats (tweak this later)

Receiver has address AR, requests X sats.

View blockstack
Verifying my Blockstack ID is secured with the address 16ZGScXvPR8DU1Bs2MagWwXHi8B1yatjnM https://explorer.blockstack.org/address/16ZGScXvPR8DU1Bs2MagWwXHi8B1yatjnM