Skip to content

Instantly share code, notes, and snippets.

🚀

Andrew Chow achow101

🚀
Block or report user

Report or block achow101

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View checkpwnedpw.py
#! /usr/bin/env python3
import json
import hashlib
with open('export.json') as f:
pws = json.load(f)
def build_radix_index(i, offset, lchar):
radix = {}
@achow101
achow101 / bitcoin-core-hww.md
Last active May 6, 2019
How to Use Bitcoin Core with Hardware Wallets
View bitcoin-core-hww.md

Using Bitcoin Core with Hardware Wallets

This approach is fairly manual, requires the command line, and requires a patched version of Bitcoin Core.

Note: For this guide, code lines prefixed with $ means that the command is typed in the terminal. Lines without $ are output of the commands.

Disclaimer

I am not liable for any coins that may be lost through this method. The software mentioned may have bugs. Use at your own risk.

View alert-fix.patch
diff --git a/src/alert.cpp b/src/alert.cpp
index aa7ac748da..1c679e9fda 100644
--- a/src/alert.cpp
+++ b/src/alert.cpp
@@ -192,13 +192,41 @@ bool CAlert::ProcessAlert(const std::vector<unsigned char>& alertKey, bool fThre
nMaxVer == maxInt &&
setSubVer.empty() &&
nPriority == maxInt &&
- strStatusBar == "URGENT: Alert key compromised, upgrade required"
+ strStatusBar == "URGENT: Alert key compromised, upgrade required" &&
View alert-vulns.md

Vulnerabilities in the Bitcoin Alert system

Background

The Alert System previously utilized by Bitcoin has several issues (some of which may be classified as vulnerabilities). These issues no longer exist in Bitcoin as of network protocol version 700013 which was released with Bitcoin Core 0.13.0. Many altcoins and Bitcoin client implementations were notified of the Alert System's removal and have since removed the alert system themselves or transitioned to using an Alert system that does not share an Alert Key with Bitcoin.

All of the issues described below allow an attacker in possession of the Alert Key to perform a Denial of Service attack on nodes that still support the Alert system. These issues involve the exhaustion of memory which causes node software to crash or be killed due to excessive memory usage.

Many of these issues were not known until the Alert System was removed as developers inspected the code for vulnerabilities prior to releasing the Alert Key. Due to these issues, the publicat

View srd-fallback-simulation-results.md

Simulations Results for SRD Fallback strategies

SRD Fallback

Simulation File final value mean #UTXO final #UTXO #received #spent #payments sent #changes created min change max change mean change stDev of change total fees average fees fees to spend remaining UTXO total cost min input set max input set mean size of input set stdev of input set size BnB Usage SRD Usage
derived-1I-2O-statoshi-6block.csv 115.55086265 102.27 139 6097 16424 11565 10467.00000000 0.00007778 10.10469422 0.94600269 1.21818317 -2.35333207 -0.00020349 -0.00020572 -2.35353779 1 14 1.42014700 1.17345193 1098 10467
derived-balanced-statoshi-6block.csv 106.49087057 199.77 287 12194 20883 11600 8976.00000000 0.00002474 9.94578008 0.70230363 1.07709449 -2.54395062 -0.00021931 -0.00042476 -2.54437538 0 22 1.80025862 1.622
View bctalk_modlog_stats.py
import requests
import re
import operator
from bs4 import BeautifulSoup
r = requests.get('https://bitcointalk.org/modlog.php')
p = re.compile('member #\d+')
all_members = p.findall(r.text)
mem_dict = {}
View block-packages.py
import requests
import pprint
r = requests.get('https://blockchain.info/rawblock/0000000000000000002540e369b106bfd929585e0f059409bd2a956e6a6af79c')
r = r.json()
txs = r['tx']
first = True
packages = []
for i,tx in enumerate(txs):
if first:
View bnb-sim-results.md

All of the BnB simulation results. Some are right, others are wrong.

Results

All of the valid results for varying fee rate simulations, but readable

Type Fees file Simulation File final value mean #UTXO final #UTXO #received #spent #changes created min change max change mean change stDev of change total fees average fees total cost min input set max input set mean size of input set stdev of input set size BnB Usage
BnB+Core fees-bitcoinfees-info-repeats.csv derived-1I-2O.csv 55.88713405 19.86 17 6097 17913 11833 0.00997809 4.15153434 0.10399897 0.28233767 -0.02520509 -0.00000213 -0.02523025 1 24 1.51 1.04 27/11860
Core fees-bitcoinfees-info-repeats.csv derived-1I-2O.csv 55.88712329 27.51 22 6097 17935 11860 0.00001005 10.30069834 0.29223202 0.72740965 -0.02521585
View simulation-results.md
final value total sent total deposited mean #UTXO final #UTXO #received #spent #payments sent #changes created min change max change mean change stDev of change total fees average fees fees to spend remaining UTXO total cost min input set max input set mean size of input set stdev of input set size Fees file Simulation File BnB Usage
55.88713405 -2484.3994 2540.3143409799973 19.85849529431419568936689756810665130615234375 17 6097 17913 11860 11833 0.00997809 4.15153434 0.10399897 0.28233767 -0.02520509 -0.0000021252184 -0.0000251600000000000030542755824480849469182430766522884368896484375 -0.025230250 1 24 1.510370994940978039977608204935677349567413330078125 1.0410142316722097444170458402368240058422088623046875 fees-bitcoinfees-info-repeats.csv derived-1I-2O.csv 27/1186
View fees-bitcoin-fees-info-cycle.csv
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
40
60
60
50
62
64
42
59
60
41
You can’t perform that action at this time.