Skip to content

Instantly share code, notes, and snippets.

@kcalvinalvin
kcalvinalvin / utreexo-algorithms.md
Last active May 16, 2025 08:04
Utreexo algorithms

Add

Utreexo accumulator is a collection of proper merkle trees. All the merkle trees have 2 children or none.

Below is an example of adding 7 leaves to the tree. You can run the code I used to generate this at https://go.dev/play/p/um5263SDk59

This is an accumulator with 1 leaf. It has 1 root, which is also a leaf.

@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
@coreyphillips
coreyphillips / bitcoinjs-lib_Setup.md
Last active March 11, 2025 07:10
How To Add bitcoinjs-lib To A React Native v0.60+ Project

How To Add bitcoinjs-lib To A React Native v0.60+ Project

Add/Link the following dependencies:

  • yarn add bitcoinjs-lib ecpair @bitcoinerlab/secp256k1 react-native-randombytes buffer readable-stream
  • yarn add --dev rn-nodeify
  • cd ios && pod install && cd ..
  • Add the following postinstall to your script in package.json: "postinstall": "rn-nodeify --install buffer,stream,assert,events,crypto,vm,process --hack"

Install any remaining dependencies and run postinstall.