Mastering Bitcoin: Programming the Open Blockchain