Skip to content

Instantly share code, notes, and snippets.

View johnzweng's full-sized avatar

Johannes Zweng johnzweng

View GitHub Profile
@johnzweng
johnzweng / export_testnet_difficulty_adjustments.sh
Created April 30, 2024 13:10
Export difficulty adjustments in testnet from BTC testnet node
#!/bin/bash
# Description:
# Analyze testnet difficulty changes.
# This script iterates over the blocks and exports blockheight, time, mediantime,
# difficulty, bits and blockhash for all blocks around difficulty adjustments
# (5 blocks before and 5 blocks afterwards).
#
# Author: John Zweng,30.04.2024
@johnzweng
johnzweng / New signs of satoshi.md
Last active March 14, 2024 17:21
Some technical facts around the story about the message allegedly signed by Hal Finney about Paul Le Roux being Satoshi.

New signs of Satoshi?

A few days ago, another sensationalist news story emerged, promising new clues regarding the true identity of Satoshi Nakamoto: Allegedly, an old message signed by Hal Finney had surfaced (published by Martin Shkreli in this blog post), suggesting that Paul Le Roux was the person behind the synonym of Satoshi Nakamoto.

I briefly highlight the facts surrounding this story:

The signed message:

Right away, yes indeed, a valid signed message has surfaced:

@johnzweng
johnzweng / SEC_2_Prime_order_koblitz_curves_generators_mystery.sage
Last active January 29, 2024 05:44
The mystery of the generation points of the secpXXXk1 curves.. :)
# The mystery around secpxxxk1 generation points :)
# -------------------------------------------------
#
# The SEC 2 familiy of elliptic curves are defined in https://www.secg.org/sec2-v2.pdf
# and widely used in cryptography.
#
# The generation points G of these curves are defined in the standard paper without any nearer
# explanation how they were chosen. Interestingly the generation points (G) of all prime order
# koblitz curves of the SEC 2 family (secp160k1, secp192k1, secp224k1, secp256k1) share some
# unusual mysterious property.
@johnzweng
johnzweng / BitcoinVersioning.md
Created August 6, 2021 05:55 — forked from gavinandresen/BitcoinVersioning.md
Suggestions on more smoothly rolling out blockchain validation rule changes

Blockchain Rule Update Process

We recently rolled out two changes to the Bitcoin block acceptance rules (BIP16 and BIP30); this document records the lessons learned and makes recommendations for handling future blockchain rule changes.

Note: there are "soft" rule changes and "hard" rule changes. "Soft" changes tighten up the rules-- old software will accept all the blocks and transactions created by new software, but the opposite may not be true. "Soft" changes do not require the entire network of miners and merchants and users to upgrade or be left behind.

"Hard" changes modify the rules in a way that old, un-upgraded software consider illegal. At this point it is much, much more difficult (some might say impossible) to roll out "hard" changes, because they require every miner and merchant and user to upgrade.

Lessons Learned

@johnzweng
johnzweng / check_taproot_signalling.sh
Created June 11, 2021 10:19
Check Taproot Signalling
#!/bin/bash
#
# This shell script allows you to check the Taproot signalling on your own
# Bitcoin fullnode (i.e. it does what https://taproot.watch/ does, but
# verified by your own node).
#
# Be a self-sovereign Bitcoiner!
#
# DON'T TRUST, VERIFY! :-)
@johnzweng
johnzweng / remap_keys.sh
Last active November 13, 2020 06:32
Remap key codes on macOS
#!/usr/bin/env bash
#
# Remap some keys on macOS (>=Sierra)
#
# Johnny, 2.11.2020
#
# Sources: based on https://gist.github.com/zbstof/6cba7d54e105cc5148c8a943d1581cad
#
@johnzweng
johnzweng / require_password_on_next_unlock.sh
Last active December 7, 2022 04:07
Require password for next unlock (disable touch-id for next unlock) – macOS
#!/bin/bash
# require_password_on_next_unlock.sh:
# -----------------------------------
# Johannes Zweng, 8.11.2020
#
# Disable and enable global touch id unlock on macOS.
#
# After re-enabling unlock by touch-id, macOS will ask for
# password on the first unlock event (which is exactly what we want). :-)
@johnzweng
johnzweng / Libra technical overview.md
Created June 19, 2019 12:49
First technical view on Libra

First technical view on "Libra":

Author: Johannes Zweng (johannes@zweng.at) Date: 19.6.2019

Notes:

  • Will be a new blockchain, not based on an existing blockchain
  • Permissioned blockchain (not everybody can be a validator)
Verifying my Blockstack ID is secured with the address 1FemuY4GdW1ToSfF4P6Nex5zR8N2vRZSda https://explorer.blockstack.org/address/1FemuY4GdW1ToSfF4P6Nex5zR8N2vRZSda

Status of CUDA 9 installation on my GCE instance:

Ubuntu version:

> lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:    16.04
Codename:    xenial