Skip to content

Instantly share code, notes, and snippets.

View garethtdavies's full-sized avatar

Gareth Davies garethtdavies

View GitHub Profile
SELECT alltxs.block_timestamp_month, fulltxs.fully_shielded_count, 100*fulltxs.fully_shielded_count/alltxs.count AS fully_shielded_percent FROM
(SELECT
block_timestamp_month, count(distinct `hash`) AS fully_shielded_count
FROM
`bigquery-public-data.crypto_zcash.transactions` AS zec_txs
WHERE
NOT EXISTS (SELECT 1 FROM UNNEST(zec_txs.inputs) WHERE NOT type = 'shielded')
AND NOT EXISTS (SELECT 1 FROM UNNEST(zec_txs.outputs) WHERE NOT type = 'shielded')
GROUP BY block_timestamp_month) fulltxs
INNER JOIN
@tromer
tromer / zcash-fully-shielded-per-month.sql
Created July 23, 2019 02:13
Count the number of fully-shielded Zcash transactions per month
/* Count the number of fully-shielded Zcash transactions per month */
SELECT FORMAT_DATE("%E4Y-%m", Date(block_timestamp)) as month, count(distinct `hash`) as fully_shielded_tx FROM
(
SELECT /* fully shielded transactions with 0 fee */
`hash`,
block_timestamp,
fee
FROM
`bigquery-public-data.crypto_zcash.transactions`
@prestwich
prestwich / scriptsig.md
Last active May 4, 2024 19:16
But what is a scriptsig?

What is a ScriptSig anyway?

Bitcoin legacy transactions (and Zcash transparent sends) use "ScriptSigs" to prove authorization. A ScriptSig contains the user's signature andm maybe some other information. They let the protocol check that the tx came from someone allowed to spend those Bitcoin. Most users never interact with them directly, and with the advent of SegWit, they're slowly being phased out of Bitcoin. But it's still worth knowing how they work.

Basics

How do I verify the Sapling MPC?

What you'll need

  1. Install the Rust compiler. A version from a year ago will work but the recent one is fine too.
  2. Download the transcript from the Powers of Tau MPC. (See the links here.)
  3. Download the params file from the Sapling MPC.
  4. Check out the attestations for the Powers of Tau MPC. (Similar can be found for the Sapling MPC but participants chose various ways to distribute their attestations, they have not been coalesced into a single repository.)

Step 1: Verify Powers of Tau

@ageis
ageis / zcash-monitor.md
Last active September 16, 2019 16:41
Prometheus exporter for monitoring statistics of Zcash daemon

zcash-monitor.py

This is a script written in Python intended to run alongside a Zcash node and export statistics for monitoring purposes. It assumes the existence of zcash-cli in the PATH and access to the RPC interface over localhost.

It tracks stuff like: block height, difficulty, number of peers, network solutions per second, errors, mempool size, size of recent blocks, number of transactions within blocks, chaintips, total bytes received and sent, transaction inputs and outputs, and the make-up of transactions in terms of JoinSplits, shielded, unshielded or mixed. These Zcash metrics are refreshed once every 2 minutes.

How it works

Prometheus is a monitoring system and time-series database.

@ro31337
ro31337 / docker_completion_for_zsh.md
Created August 13, 2017 02:12
Zsh docker completion

Docker Completion for Zsh (Official)

  • mkdir -p ~/.oh-my-zsh/plugins/docker/
  • curl -fLo ~/.oh-my-zsh/plugins/docker/_docker https://raw.githubusercontent.com/docker/cli/master/contrib/completion/zsh/_docker
  • Add docker to plugins section in ~/.zshrc
  • exec zsh
@sultanqasim
sultanqasim / zram.sh
Created June 21, 2016 02:41
ZRAM config for Raspberry Pi 3
#!/bin/bash
# Raspberry Pi ZRAM script
# Tuned for quad core, 1 GB RAM models
# put me in /etc/init.d/zram.sh and make me executable
# then run "sudo update-rc.d zram.sh defaults"
modprobe zram
echo 3 >/sys/devices/virtual/block/zram0/max_comp_streams
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm
@loonies
loonies / 1_phpunit-api.md
Last active January 19, 2024 07:34
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this->anything()