Skip to content

Instantly share code, notes, and snippets.

@moocowmoo
moocowmoo / dash_budget_payout_dates.sh
Created Nov 24, 2017
estimate future dash budget payout dates
View dash_budget_payout_dates.sh
#!/bin/bash
D0=$(TZ=UTC date --date="$(date --date="2015-12-07T08:27:12+0000")");
for block in `seq 398784 16616 $((382168 + (16616*48)))`;
do DD=$(TZ=UTC date --date="$(date --date="$D0") +692 hours +20 minutes");
D0=$DD;
echo "$block - $DD";
done
@moocowmoo
moocowmoo / tagchain-list.py
Last active Jul 11, 2017
block-a-doodle-chain - scan dash core bdb files for P2PK graffiti
View tagchain-list.py
#!/usr/bin/env python
# tagchain-list - scan dash core bdb files for P2PK graffiti
from __future__ import print_function
import re
import os
from collections import OrderedDict
from itertools import izip, repeat
@moocowmoo
moocowmoo / bitwalletrecover.py
Created Apr 17, 2017 — forked from UdjinM6/bitwalletrecover.py
bitwalletrecover.py - recover compressed private keys from your bitcoin/litecoin/darkcoin wallet. Requires python3, pycoin (https://pypi.python.org/pypi/pycoin), and base58 (https://pypi.python.org/pypi/base58).
View bitwalletrecover.py
## bitwalletrecover.py - recover private keys from your darkcoin wallet
## (this version was not tested with bitcoin/litecoin).
## Requires python3, pycoin (https://pypi.python.org/pypi/pycoin),
## and base58 (https://pypi.python.org/pypi/base58).
##
## Starting with Python 3.4, pip is included by default with the Python binary
## installers. To install pip for older versions 3.x:
##
## sudo apt-get install python3-setuptools
## sudo easy_install3 pip
@moocowmoo
moocowmoo / dashrpc.py
Last active Oct 9, 2018
calculate your masternode queue position
View dashrpc.py
import io
import os
from bitcoinrpc.authproxy import AuthServiceProxy
def ParseConfig(fileBuffer):
assert type(fileBuffer) is type(b'')
f = io.StringIO(fileBuffer.decode('ascii', errors='ignore'), newline=None)
result = {}
for line in f:
@moocowmoo
moocowmoo / dash-minmax_coin_projection.py
Last active Jan 8, 2017
projection of total dash generated if budget is completely allocated (max) or never allocated (min)
View dash-minmax_coin_projection.py
# blockchain state at first block of 2017
year_now = 2017
now_height = 596411
now_outstanding = 6990727
# 200423 == average annual block discovery rate across 2 years
avg_blocks_per_year = float(((596411 - 395793) + (395793 - 195565)) / 2)
View check_all_dash_binary_checksums.sh
#!/bin/bash
echo "getting checksum list"
wget -q https://github.com/dashpay/dash/releases/download/v0.12.1.5/SHA256SUMS.asc
FILENAMES=$(cat SHA256SUMS.asc | grep dash | awk '{print $2}')
echo "downloading binaries"
View round_deanon_prob.py
#!/usr/bin/env python2
def capture_probability( n_full_set, n_capture_set, rounds):
return (n_capture_set / n_full_set) ** rounds
masternode_count = 4270
if __name__ == "__main__":
for percentage in range (5, 100, 5):
View gist:791a89727ba2e1796926ce47fc7f1e98
Verifying that "moocowmoo.id" is my Blockstack ID. https://onename.com/moocowmoo
View selection_probability.py
#!/usr/bin/env python
def selection_probability(mns, blocks):
p_pool = mns / 10
p_prob = 1.0 - ((float(p_pool - 1) / float(p_pool)) ** float(blocks))
return "{:0.2f}%".format(p_prob * 100)
masternode_count = 4387
View dash_block_estimate.py
#!/usr/bin/env python2
now_height=460854
now_outstanding=6406809
def min_blok_subsidy(nHeight):
nSubsidy = float(5) # assume minimum subsidy
for i in range(210240, nHeight, 210240):
nSubsidy -= nSubsidy/14
return nSubsidy