Skip to content

Instantly share code, notes, and snippets.

Gareth Davies garethtdavies

Block or report user

Report or block garethtdavies

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
garethtdavies /
Last active Sep 23, 2019
Outputs aggregated metrics from the Zcash blockchain
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Output stats from Zcash blockchain using Blocksci
Uses for Zcash Blocksci adaptation
Credit @st4d for transaction type detection
import blocksci
import os
garethtdavies /
Last active Sep 10, 2019
Time a Coda transaction
import asyncio
import time
import CodaClient
import datetime
coda = CodaClient.Client(graphql_host="localhost", graphql_port="8000")
# This currently responds to all tx for the provided public key on L#33 - it could be filtered to listen for payment id
async def blockReceived(message):
receivedTime =
garethtdavies / mongo-memo.json
Created Sep 8, 2019
Extract matching memo data from Coda blocks
View mongo-memo.json
"transactions.userCommands": {
"$elemMatch": {
"memo": "2pn2vgS9sRdjnwZqRDndxVdGzeocYEwyJcHC1zbTgqrkmTnCFTA4MU"
garethtdavies /
Last active Aug 31, 2019
Parses the Coda GraphQL API to get public keys for those producing SNARK work
# A super quick "unofficial" script to parse the GraphQL API to get public keys for those producing SNARK work
# Install dependencies and run with `python3`
# You'll need to be running the GraphQL API see here for quick setup
# and here for a detailed overview and update line 14 if required
# Your results may vary depending on how many blocks your node has seen
# Dependencies
# >=Python 3.5
# pip3 install git+
# pip3 install pandas
garethtdavies / fully-shielded-sapling-tx.json
Created Aug 11, 2019
Fully Shielded Sapling Transaction
View fully-shielded-sapling-tx.json
"txid": "5328354a0b14c95b1f8ac26ec99c7b365638cd877a04aa3fb27d19deedc90fb7",
"overwintered": true,
"version": 4,
"versiongroupid": "892f2085",
"locktime": 0,
"expiryheight": 572130,
"vin": [
"vout": [
garethtdavies /
Created Jul 23, 2019
Outputs all shielded transactions from BlockSci
import blocksci
import csv
chain = blocksci.Blockchain("/home/gareth/blocksci/zcash-data")
migration_tx = 0
sprout_tx = 0
sprout_fully_shielded = 0
sapling_tx = 0
sapling_fully_shielded = 0
import blocksci
chain = blocksci.Blockchain("/home/gareth/blocksci/zcash-data")
migration_tx = 0
for blk in chain[500000:571501]:
for tx in blk:
if (tx.is_saplingshielded and tx.is_sproutshielded):
garethtdavies / zcash_migration.sql
Last active Jul 21, 2019
Google BigQuery Zcash Migration Transactions
View zcash_migration.sql
i.type AS input_type,
o.type AS output_type,
View zcash-2.0.5-rc1-build.assert
--- !!omap
- out_manifest: |
c304451e5c4c470486a941c927de70427362245f079eff85a2cef285b3cc9217 src/zcash-2.0.5-rc1.tar.gz
9a24c0b73f3abe7cdc163ebc95f0f9ead3aaf1dee1940c008b67d2c138248801 zcash-2.0.5-rc1-linux64-debug.tar.gz
d37d0a1a9b1062ad10f7071d9ff70aa888b51fa3c27a875f3d443fca73d2da44 zcash-2.0.5-rc1-linux64.tar.gz
- in_manifest: |-
bae2a72fda1a1212d2cf0382225d2254742a8593e90cc2a508c5a65665fd949c zcash-2.0.5-rc1-desc.yml
git:8010becd4e41956c1d64f683f715b15465e49748 zcash
- base_manifests: !!omap
- jessie-amd64: |
View reference-wallet-tx.json
./src/zcash-cli decoderawtransaction 0400008085202f89000000000000fc5c0700102700000000000001f5bcae9e10f97435222e11b0a5dc1846d9a925709893188a1c8222e658f06d0ff276281cf81c253fb4d221213d1e41e5e32c9f3d2b2240553dd66322337a135930cad4f3ffab45f5789fbd7ea2aa420e7811d3f442130c5db00975ec1639e155fc25529c84ebff3c16c75eca190c93e161a7aea584d1798e842b5da19ffa851292839fb46b1a5277435eddbb0cb34d3aefaee49a5bbeb72bee77d4360a539213b9af5b47b530c564090f38debe30e6438b80da1fd2ba5755619ea8743c14351b3b34e563c1aa039c4ff674e4fad2a829c2935444b2491a074b69064af7a6267f01345915945e69b04e119f1e9107ad0824677b69e916ea7375a7c9d4450b35740dda3d4d79c8bf1fff528c84fc2ea454b70210f592a016e835b79c696e1e3c273183a184d6b794ce163fa35ebb3efb224b5f47be6a9d27b58afbbcf190fe1e46c66c22da9c6b33dd21e3a51d4acd3004d8117d0f538091bf03c817e9bc0a4813615d93c1af50ca3bcfa57988d35e805346c28e630c701d21d036c2167874c60302556f4376ddf401013fc3086cc995ff17ac00736218b963062b4d86efbf6d7d68184319228ae42f2e1387d9c87f162b92fe314684b42044ff4ff27d8c4e2a883a8a8c83f2b859eedc4908af517554a3c2cd2
You can’t perform that action at this time.