Skip to content

bitcoinerlab/playground

Repository files navigation

BitcoinerLab Playground

This repository contains a set of Playgrounds that serve as the foundation for the guides on the BitcoinerLab Site.

You can either run the code on a sandboxed playground or locally by installing it.

Note: The code shown in these guides is in TypeScript, but a transpiled JavaScript version is automatically generated when building the sources.

Running the Code on a Playground

To run the code in a playground, visit the respective guide and click the SHOW PLAYGROUND button.

All the guides provide thorough explanations of how the code works.

Running Locally

If you prefer to run the code locally, clone and run the BitcoinerLab Playground repository on your local machine.

For example:

git clone https://github.com/bitcoinerlab/playground.git
cd playground
npm install
npm run descriptors/legacy2segwit

This will execute the code in ./descriptors/legacy2segwit/index.ts and output the results.

Available Playgrounds

Below is the full list of playgrounds included in this repository, with links to their corresponding guides on the BitcoinerLab site.

descriptors/legacy2segwit

Guide: https://bitcoinerlab.com/guides/standard-transactions

Learn how to build standard Bitcoin transactions and migrate funds from Legacy to SegWit addresses using BitcoinerLab libraries.

npm run descriptors/legacy2segwit

descriptors/miniscript

Guide: https://bitcoinerlab.com/guides/miniscript-vault

Learn how to build a vault using Miniscript with a timelock and an emergency escape path. Learn how Miniscript descriptors work and how to build and compile policies.

npm run descriptors/miniscript

descriptors/ledger

Guide: https://bitcoinerlab.com/guides/ledger-programming

Learn how to sign transactions with Ledger hardware devices using BitcoinerLab Ledger helpers. Covers transport selection (WebHID / NodeHID), derivation policies and multi-input signing flows.

npm run descriptors/ledger

descriptors/multisig-fallback-timelock

Guide: https://bitcoinerlab.com/guides/multisig-fallback-timelock

Create a multisig with a time-delayed fallback path using Miniscript. Useful for inheritance, recovery-wallet setups and collaborative custody.

npm run descriptors/multisig-fallback-timelock

descriptors/p2a

Guide: https://bitcoinerlab.com/guides/p2a

Learn how to construct a P2A (Pay-to-Anchor) output and how these outputs are used as the anchor for TRUC fee-bumping transactions.

npm run descriptors/p2a

License

MIT License (c) 2025 Jose-Luis Landabaso — https://bitcoinerlab.com

About

Educational TypeScript code samples for learning Bitcoin transactions with @bitcoinerlab libraries.

Resources

Stars

Watchers

Forks

Packages

No packages published