Posts
Scalable Stake Slashing
Based on the paper titled Scalable Reward Distribution on the Ethereum Blockchain, we can derive an algorithm for proportionally slashing participants based on their stake. This is useful for nomination in Proof-of-Stake since a misbehaving validator can affect a broad number of participants.
Cosmos SDK vs Substrate
Innovative blockchain architectures are poised to address fundamental issues such as scalability, usability and interoperability. Furthermore, several state-of-the-art frameworks under development abstracts common infrastructure such as networking and consensus. This enables developers to focus on the core business logic of their application without re-inventing the wheel. In this post I will compare two of the most popular blockchain development tool-kits, the Cosmos SDK (Tendermint Core) and Substrate. Both projects are designed to extract the application’s State Transition Function (STF) into reusable modules, but additional features are included within their standard libraries.
Online Key Management
I was recently looking into key management for the BTC-Parachain and associated client software. Like similar software - namely Proof-of-Stake (PoS) validators or arbitrage keepers - they are designed to run autonomously 24/7 with unrestricted access to private keys for signing. In my effort to understand best-practices I decided to compare approaches across the industry.
BIP47: TL;DR
Reusable payment codes simplify identity management without loss of privacy.
LedgerJS
A hardware wallet is a specialized physical device used to store (and derive) your private keys. Some of the most popular products are developed by Ledger and you may be familiar with the Nano series. They support developing custom applications in C (for now, but Rust is coming) and the active library is well stocked, both Bitcoin and Ethereum have dedicated applications. To build on top of these we need to speak through the application protocol data unit (APDU) - for which Bitcoin has a technical specification.
Interchain Standards
The Inter-Blockchain Communication (IBC) protocol is an architecture designed for Cosmos to allow participating processes to share state. Each module is a deterministic process, such as a replicated state machine with fast transaction finality. Unlike sharded architectures (such as Polkadot), IBC does not provide pooled security. The specification builds on several assumptions to reason about the capabilities of the protocol. For instance, it assumes fast finality for any adopted consensus mechanism - Tendermint & GRANDPA are two such examples.
Dual Booting Windows & Arch Linux
Having spent far too much time reinstalling my desktop this weekend, I thought it best to write up the process. Before continuing, boot into the machine’s BIOS to enable UEFI booting and disable Secure Boot. Windows 10 Download the latest image and install it on a flash drive. Ensure that the machine boots with this flash drive in UEFI mode. Follow the wizard and delete all existing partitions. Create a new partition for Windows, leaving suitable unallocated space for Linux.
ELI5: Bitcoin Difficulty
In Bitcoin, difficulty is the measure of how hard it is to mine a block. To ensure constant output, this rate is adjusted every 2016 blocks - anticipating block production to take around ten minutes, we can expect recalculation every two weeks. If more blocks are produced than expected then the difficulty is increased, otherwise it is lowered. The following formulae can be used to calculate the difficulty rate for any given height - substituting an expected average of 600 seconds (10 minutes) and a base difficulty (introduced at genesis) of 1.
ENS & IPFS
By utilizing the Ethereum Name Service (ENS) for resolution and the Interplanetary File System (IPFS) for content hosting it is possible to decentralize a static website while retaining the predictable URL. My primary setup leverages GitHub pages to host a blog compiled with Hugo - linked to my domain name. Whenever I want to publish a change, I build the latest website from my markdown content using my custom theme and push it to a separate branch in my personal repository.
Containerizing Bitcoin
There are over 500,000 lines of code in Bitcoin Core, roughly 70% of which is pure C++. Compile times vary, but if you just want to get a node up and running, docker is the easiest way to go. Here’s something I prepared earlier… Courtesy of the official docs, there are only four commands to run which build bitcoind, bitcoin-cli and bitcoin-qt. The dependencies are clearly outlined for different architectures - including OSx, Windows and Unix flavours - but in my Dockerfile I have chosen to extend Ubuntu.