Skip to content

Instantly share code, notes, and snippets.

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

Tadeas Kmenta TheTrunk

🏠
Working from home
View GitHub Profile
{
"git.confirmSync": false,
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true
},
"search.useIgnoreFiles": true,
"workbench.iconTheme": "material-icon-theme",
"git.enableCommitSigning": true,
"vetur.format.defaultFormatter.js": "vscode-typescript",
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
public class BitcoinAddressValidator {
private static final String ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
public static boolean validateBitcoinAddress(String addr) {
mixin
:
20
serialized_signed_tx
:
"0200010200158b9104bf961db4841ef2bf01c5ee0ac9c30ae5b705cf9307d8ea0ea3fa01de9603b5dd03ad44d723b8b10186e001d6bf01ffd401e4ba08bbea03983a5171ac61c7fb6b5e0e1d936735b8d8dd3f584cd0363d314efa38e2e9a2cff614020002580bd107779abcc0e8d770312f4c6e8144fd4feaed8d2e53f9dd14cbd4b60f5b0002e1d23a861cbccef720e5104dc6e566476a4e800d9e2323ebfffc1757cc7259df2c02090116f0034bd2cbb5b501ac704dfdb8f37fbd9cd9447e8c6d2da87aa9fa8df5c65201c5216e8099f6f8fd04904e393da86f45a363ccc51f0184e5718214b14f307be21805e3e0bef905d4ea39cb6e9fb9ae1e2652d9688535d369bed1b5c155a9791ffe4e9a8b20564e24ca8268fb37c0f23e295c87cf84ae354524f91401312b73495e85be37530bea85ae6fd8002662d4c134e00263279988d53bc8657a93b89aa71c41ec150b0244c91d789b65841257b9293e904062c8782691ccedbe6d21e362f56cc2f7234c9af07de7210234b6d352e8dc2d04ad9b81c3f8e0d53380644e4848b08cba9f2363321c031b291b34241b5297ab441bdae2df81201533bb8e00c824a373e95980ce4411b79fb7da1e8740d75ae7c47055ff3f75b4b10449fe5f99194d91f8d8a4ce9f992041645ed875acc467760be59841b1bfd8f80c07c6ff67149f1
class Bitcoinzero(Coin):
NAME = "Bitcoinzero"
SHORTNAME = "BZX"
TX_COUNT = 43798
TX_COUNT_HEIGHT = 44
TX_PER_BLOCK = 576
NET = "mainnet"
GENESIS_HASH = '322bad477efb4b33fa4b1f0b2861eaf543c61068da9898a95062fdb02ada486f'
XPUB_VERBYTES = bytes.fromhex("0488b21e")
XPRV_VERBYTES = bytes.fromhex("0488ade4")
@TheTrunk
TheTrunk / gist:30ff5ef59d3063f465cc766a4a64a397
Created March 26, 2019 13:39
An overview of private key and compressed / uncompressed public keys
An overview of private key and derivation of compressed and uncompressed public key and its belonging corresponding addresses on utxo coins such as Bitcoin or Hush. Example was demonstrated on Hush mainnet network as of short same transaction type construction, short blocktime and cheap fees.
private key a8db568957aab4d708fa1cde6b3c19c14674d5ffe283REDACTEDREDACTEDREDA
t1W9D96R9hk8vtyuHdajwtDzSDRRtnXacT3 - address from uncompressed public key, private key in WIF from uncompresseed 5K6eoShWWsgptas3XYGL34xcj66Bn1tREDACTEDREDACTEDREDA
04317b3fd39dd25719563f46534e6d9779695ef3b5b8886c2293fc79e0c5c3283635c386d467ce6035c9862330f33dead77527b77474012410b3a26f1e7ed33447 - uncompressed pubkey
t1UPSwfMYLe18ezbCqnR5QgdJGznzCUYHkj - address from compressed public key, private key in WIF from compressed L2swqzRoGrinNgTt9nzf28UUgmTtZgtpfREDACTEDREDACTEDREDA
03317b3fd39dd25719563f46534e6d9779695ef3b5b8886c2293fc79e0c5c32836 - compressed pubkey
@TheTrunk
TheTrunk / Building Hush for windows
Last active January 27, 2018 17:54
Run the commands one by one as some dialogs may pop up, password is required, options needs to be selected
#install mingw-w64
#That will install x86_64-w64-mingw32-gcc with two version thread models: posix and win32.
#/usr/bin/x86_64-w64-mingw32-gcc-win32
#/usr/bin/x86_64-w64-mingw32-gcc-posix
#/usr/bin/x86_64-w64-mingw32-g++-win32
#/usr/bin/x86_64-w64-mingw32-g++-posix
cd ~
sudo apt-get install mingw-w64
#Make sure the posix model was selected:
#bitcore-node-hush
cd ~
git clone -b testver https://github.com/TheTrunk/bitcore-node-hush.git
cd bitcore-node-hush
npm install
cd bin
chmod 777 bitcore-node
./bitcore-node create mynode
cd mynode
../bitcore-node install https://github.com/TheTrunk/insight-api-hush#Oldver
@TheTrunk
TheTrunk / gist:935000778625101109bd9923f568e50e
Last active December 15, 2017 12:59
Test bitcore wallet hush and basically everything connected to it: BWS, BWC
# run all at once command: curl -L https://gist.github.com/TheTrunk/935000778625101109bd9923f568e50e/raw | sh
#it is also to possible to install like this: npm install TheTrunk/hushd-rpc#master
#Be noted that test folders and some documentations are unmodified and may not refer to hush!
#prereq : nodejs npm git and HUSH ofc! To install HUSH go ahead here: https://github.com/MyHush/hush
sudo apt-get install nodejs
sudo apt-get install npm
sudo apt-get install git
#hushd-rpc
cd ~