First-class Functions in JavaScript

Posted on February 19, 2018 full post comments

The notion of first-class functions can be somewhat puzzling for those who are just starting with JavaScript, especially if they come from a Java background (as Java has only introduced them in version 8).

Understanding first-class functions is crucial in the JavaScript world as they are unavoidable when dealing with event handlers, non-blocking (asynchronous) I/O and they are the fundamental to functional programming.

Discovering Nix: Provisioning a static webserver with NixOps

Posted on December 26, 2017 full post comments

A few weeks ago I decided to pick up Nix. It’s a lovely concept: describe environments / Linux systems in an immutable, functional manner.

Although Docker solves the immutability part, the idea never really resonated with me: I find it a crude, but effective solution to put an immutable layer over our mutable OSs.

Nix has a different approach: instead of making our existing systems immutable, it tackles the problem on a lower level: it aims to make the environment immutable from the ground up with a package manager called Nix, and an OS built around it called NixOS. And with NixOps, you can manage instances running NixOS.

In this article, I will put together a simple static webserver running Nginx using NixOps.

Working with Bitcoin HD wallets II: Deriving public keys

Posted on January 16, 2017 full post comments

This post is the continuation of my previous about key derivation.

So we already know how to create an huge amount of wallets using a recovery seed or an extended private key, the well-known derivation method described in BIP32 and the derivation paths of BIP44.

However, generating keys based on the private key puts limits on the possible use cases. The private key allows to spend the coins sent to its own or its descendants’ addresses, so it must be kept secret. That implies that you have to fully trust the code and the runtime you use to generate your addresses.

There’s a way to generate addresses in an untrusted environment though: using extended public keys.