Keep your main identity key safely offline while authorizing a different key to sign on your behalf.
Demo of Keith's experimental Nostr integration.
Other posts:
Keep your main identity key safely offline while authorizing a different key to sign on your behalf.
Demo of Keith's experimental Nostr integration.
Other posts:
Sign any Nostr event without ever having your key "hot" in a Nostr client app, web browser, or browser extension.
Demo of Keith's experimental Nostr integration.
Other posts:
Create a new key with your own entropy, save it as a standard bitcoin BIP-39 mnemonic phrase and/or SeedQR, then export for use in Nostr.
Demo of Keith's experimental Nostr integration.
Other posts:
""" | |
see: https://github.com/nostr-protocol/nips/blob/master/26.md | |
""" | |
import hashlib | |
from binascii import unhexlify | |
from embit import bip39 | |
from embit.bip32 import HDKey | |
from embit.ec import PrivateKey |
# check if we can list zero value tx as available coins | |
# 1. create raw_tx | |
# 2. hex-changed one output to 0.0 | |
# 3. sign and send | |
# 4. check if recipient (node0) can list the zero value tx | |
usp = self.nodes[1].listunspent(query_options={'minimumAmount': '49.998'})[0] | |
inputs = [{"txid": usp['txid'], "vout": usp['vout']}] | |
test_amount = Decimal("0.00001000") # this output amount will be zeroed and thereby added to the fee | |
fee = Decimal("0.00000400") # start with a modest fee so our final fee won't exceed default maxfeerate | |
outputs = {self.nodes[1].getnewaddress(): usp['amount'] - test_amount - fee, self.nodes[0].getnewaddress(): test_amount} |
from embit import bip32, bip39, script | |
from embit.slip39 import secure_randint | |
from embit.wordlists.bip39 import WORDLIST | |
for i in range(0, 100): | |
mnemonic = [] | |
for j in range(0, 11): | |
# note: `secure_randint` is inclusive of the end of the range | |
mnemonic.append(WORDLIST[secure_randint(0, 2047)]) | |
mnemonic.append(WORDLIST[0]) |
""" | |
dependency: pip install embit | |
""" | |
from embit import compact | |
from embit.psbt import PSBT, OutputScope | |
from embit.script import Script | |
class OPCODES: | |
OP_RETURN = 106 | |
OP_PUSHDATA1 = 76 |
import os | |
from embit import bip39 | |
from embit.wordlists.bip39 import WORDLIST | |
from seedsigner.models.decode_qr import DecodeQR | |
from seedsigner.models.encode_qr import EncodeQR | |
from seedsigner.models.qr_type import QRType | |
from seedsigner.helpers.qr import QR | |
seed_bytes = b'' |
import sys | |
if sys.platform == 'esp32': | |
import machine | |
if machine.freq() != 240_000_000: | |
machine.freq(240_000_000) # 240MHz | |
print("Set CPU frequency to 240MHz") | |
import time | |
import secp256k1 | |
from embit import bip39, bip32 |
See the full video walkthrough on twitter.
Spending uxto from regtest: 3641312fc3e418804f1a0a88098b6bf8e3bdca13afd2f0633ca3166fc8533f17
Signing mnemonic: "smoke chimney announce candy glory tongue refuse fatigue cricket once consider beef treat urge wing deny gym robot tobacco adult problem priority wheat diagram"