Skip to content

Instantly share code, notes, and snippets.

@HeXenCore
HeXenCore / bitcoin-wif-litecoin-wif.py
Created May 26, 2021 11:26 — forked from losh11/bitcoin-wif-litecoin-wif.py
Convert Bitcoin WIF to Litecoin WIF format
'''
Bitcoin WIF to Litecoin WIF converter
=== INFO ===
Idk
=== USAGE (example) ===
% python3 litecoinwif.py
@HeXenCore
HeXenCore / gen.py
Created May 27, 2021 16:16 — forked from matthewdowney/gen.py
P2WPKH-P2SH (SegWit) Wallet Address Generation
"""
Implementation of "Pay to Witness Public Key Hash nested in BIP16 Pay to Script Hash" (P2WPKH-P2SH) address generation.
Described in BIP 141 (SegWit) https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#P2WPKH_nested_in_BIP16_P2SH
I.e.: Public key -> SegWit address
"""
import hashlib
from hashlib import sha256
@HeXenCore
HeXenCore / addrgen
Created May 27, 2021 17:14 — forked from JBaczuk/addrgen
addrgen
#!/bin/bash
echo
echo "Welcome to the Bitcoin address generator!"
echo "input private key (32 bytes, hex format)"
read priv
echo ""
echo "#####################################"
# priv=0C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D # Testing only
@HeXenCore
HeXenCore / _Very_big_int_in_cython.txt
Created June 6, 2021 12:55 — forked from ricrogz/_Very_big_int_in_cython.txt
Use int128 (really LONG integers) in cython
Taken from https://stackoverflow.com/questions/27582001/how-to-use-128-bit-integers-in-cython
Basically, we make cython believe we will use 64 bit int to generate the .c file,
but by using a C header we will, in fact, define a 128 bit int (the definition
in the .h file does not match what we put into the pyx file).
Once Cython has generated the .c file, we can compile it with GCC without further trouble,
as GCC does support 128 bit ints