Adjoint News

Leap Workshop: "Building a Blockchain in Haskell"

LambdaConf 2018 Thomas Dietert Leap Workshop Speaker

Thomas Dietert, Software Engineer

As of 2017, 'blockchain' is ubiquitous in the world of finance and is a buzzword (arguably) known throughout the world. From the booming cryptocurrency market to private over-the-counter trading between the biggest of financial institutions, blockchain is revolutionizing the way in which untrusted counterparties transact everything from financial derivatives to bananas. Blockchain, i.e. distributed ledger technologies (DLTs), are an insightful marriage of several fields of computer science: distributed systems, cryptography, and (sometimes) programming language theory. In essence, DLTs provide a database abstraction layer and distributed network such that individuals who lack trust in one another can propose updates to a shared state in a manner that is cryptographically irrefutable. 

This workshop will give an overview of the blockchain data structure, the necessary cryptographic components that ensure data provenance and blockchain validity, and will teach attendees how to build a public distributed system allowing the submission of transactions and creation (mining) of blocks using a simple proof-of-work consensus algorithm. 

Attendees of this workshop will learn how to implement a blockchain using Haskell's ADTs and the relevant cryptographic components (e.g. hashing, merkle trees) that ensure the immutability of this linked-list-like data structure.

This workshop will give a sufficient overview of the relevant mathematics associated with the Elliptic Curve Digital Signature Algorithm (ECDSA) and demonstrate the implementation and use of this algorithm using the Haskell cryptography library "cryptonite."

Finally, attendees will learn how to implement a distributed system comprised of a binary messaging protocol facilitating peer discovery, transaction submission, and block consensus. This section of the workshop will familiarize attendees with the basics of the "distributed-process" library (i.e. Cloud Haskell), the relevant serialization library "binary," and how to create a simple command line interface to issue transactions and mine blocks using the "haskeline" library.