Skip to content

Instantly share code, notes, and snippets.

View qlrd's full-sized avatar
🏠
Working from home

qlrd qlrd

🏠
Working from home
  • selfcustody
  • internet
View GitHub Profile
@qlrd
qlrd / solution.py
Last active February 20, 2025 19:10
"""
solution.py
Read:
- https://gist.github.com/qlrd/0eed0c8a56aeab3f8894c6d67694d690
- https://gist.github.com/qlrd/d1696dd63e15d89ecbc191fa2d734b36
- https://gist.github.com/qlrd/1b6f6edc99915acee72f7c73b3e649f0
- https://gist.github.com/qlrd/aca897acb42f0b6cbd07d7337f16c790

a derivation path m/48'/0'/0'/<index>'

Once you have entered the passphrase, you will need to select a miniscript policy with a specific type of descriptor (either P2WSH or P2TR), and a custom derivation path m/48'/0'/0'/<index>' to spend the funds.

Basically, the index is a number that you will need to figure out to construct the given descriptor:

# <descriptor> : wsh || tr
#  -&gt; 0, 1, 2, 3 ... who knows?

Find a password to decrypt a qrcode;

After finding the mnemonic, you must find a 13th/25th word for this mnemonic. To find that, you will do the same thing as in the first part of this challenge:

derive_this_to_generate_the_passphrase = b" ".join([
    b"word 1",
    b"word 2",
    b"word 3",
 b"word 4",

Get the correct mnemonic

To solve this puzzle, it is useful to know that krux supports:

  • BIP39 with and without passphrases;
  • DoubleMnemonic (a valid 24w BIP39 mnemonic where the first and second halves are both valid mnemonics);
  • BIP85 derived 12w and 24w BIP39 mnemonics

A password to decrypt a qrcode

Scan this qrcode and type a sequence of characters that decrypt the QR code.

5ef3b16a pic.twitter.com/2P3G7ux3KE

— qlrd (@qlrddev) February 20, 2025

To find out the "password", you will need to edit solution.py. It have a line where you'll find a certain variable that require a byte string as input to the solution function. The output of solution will be the key to decrypt the mnemonic.

For example:

Miniscript challenge

Build a simple inheritance scheme on Liana and try to spend a ~170000 sats.

Prelude

During the workshop at BTC++ in 2025, the speaker created a simple inheritance scheme and put you as his heir. He can spend at any time, but you only can spend after some time.

Preliminary instructions

@qlrd
qlrd / measure-selfcustody-downloads.py
Last active May 12, 2025 02:38
Measure some download stats for selfcustody projects
import json
import requests
import argparse
HEADERS = {
"Accept": 'application/vnd.github+json',
"X-GitHub-Api-Version": "2022-11-28",
}
parser = argparse.ArgumentParser(
@qlrd
qlrd / krux_file_signer.py
Last active June 25, 2023 01:02 — forked from odudex/krux_file_signer.py
Sign files with Krux, airgapped and export openssl signature and public key
"""
This python script is aimed to help and teach how Krux can be used to sign files and create PEM public keys so openssl can be used to verify
Requirements:
- opencv, qrcode
pip install opencv-python qrcode
- This script also calls a openssl bash command, so it is required to have verification functionality
"""
import argparse