Skip to main content

⚡️📝 TLV Payment Metadata Records Parser for LND

Extract custom TLV payment metadata records that may have been attached to lightning payments you received. For example, you can extract boostagrams from payments received through value-for-value podcasting apps.

For more information, see the release notes of LND's v0.9 release.

Installation

Make sure you have up-to-date installations of pip and setuptools:

pip install --upgrade pip
pip install --upgrade setuptools

Then install the lntlvs CLI:

pip install lntlvs

Examples

By default, only podcast metadata will be extracted. To query the first 100 payments on your node, run:

lntlvs --maxinvoices 100

To queriy from the next 100 payments, run:

lntlvs --maxinvoices 100 --indexoffset 100

To extract another type of custom records other than podcast metadata, specify the --tlvkey option. To extract multiple types of custom records, repeat this option multiple times. See here for a list of TLV keys used in the open.

lntlvs --tlvkey 7629171 --tlvkey 7629169 # Extract tip note and podcast metadata

Usage

Usage: lntlvs [OPTIONS]

  Extract custom metadata records that may have been attached to lightning payments you received.

Options:
  --tlscertpath <value>   Path to the TLS certificate for lnd's RPC service  [default: ~/.lnd/tls.cert]
  --macaroonpath <value>  Path to the (read-only) macaroon for lnd's RPC service  [default: ~/.lnd/data/chain/bitcoin/mainnet/readonly.macaroon]
  --rpchost <value>       The address and port where lnd's RPC service is listening  [default: 127.0.0.1:10009]
  --tlvkey <value>        A TLV key to extract - can be specified multiple times  [default: 7629169]
  --indexoffset <value>   Query for invoices starting at (not including) this offset  [default: 0]
  --maxinvoices <value>   The maximum number of invoices to query  [default: 1000]
  --help                  Show this message and exit.

Development

Create a virtual environment:

python -m venv .venv && source .venv/bin/activate

Install production and development dependencies:

pip install -e ".[dev]"

Re-generating gPRC Code

If required, update the LND interface definition in src/protobuf/custom_records/generated/lightning.proto by running:

src/protobuf/update.sh

Then re-generate the gPRC code with:

src/protobuf/generate.sh

Release files for lntlvs 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lntlvs 0.0.1
File Size Uploaded
lntlvs-0.0.1.tar.gz 79.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lntlvs 0.0.1
File Interpreter ABI Platform
lntlvs-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 160.7 kB

Release files / lntlvs-0.0.1.tar.gz

Download URL lntlvs-0.0.1.tar.gz
Size 79.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4df8146df7de36f60ccc36cc224f56b4ed3668c7297f668b4b8f95d030161fd9
BLAKE2b-256 checksum
How to use checksums
1c9115b3c9eabc99e4ec9cbd6162aeb11f9b8222aaa2aa874b4c9bb71037fcd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release files / lntlvs-0.0.1-py3-none-any.whl

Download URL lntlvs-0.0.1-py3-none-any.whl
Size 81.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
39e1ed3b813c33dddf66ad06c0defacf2eb77362ec79292fa5d08fb4b7478919
BLAKE2b-256 checksum
How to use checksums
f5561227e83b0a9899536642ccba8023499bec72dc8d60d1483599389e50b93f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page