Content

Clarity of Mind Foreword Introduction

Foreword

Information wants to be free. But, most people believe in the concept of ownership. Despite the seeming contradiction, a blockchain synthesizes a mechanical social contract from these two premises. Everyone gets a copy of the chain, and everyone collectively ensures that only the rightful owner can create, modify, or transfer data within it. Smart contracts are programs on the blockchain that encode the rules for owning data, which are collectively and deterministically enforced by the blockchain users’ computers.

Naturally, writing smart contracts is a high-stakes business. Bugs can lose or destroy other peoples' data, and despite the high cost this may impose, there is no way to retroactively fix them. Indeed, the history of smart contract development is rife with incidents of buggy smart contracts destroying hundreds of millions of dollars of value. Despite this, the promise of a worldwide social contract that is enforced fairly and uniformly, dispassionate of the participants’ circumstances, has inspired a generation of software developers to ply their talents to build a stable, predictable world in a time of political and economic precarity.

Clarity of Mind is a timely and much-needed resource for navigating this new world. Mr. Janssen, as both an educator and software developer, expertly guides novice and experienced readers alike on the path to successful smart contract development in the Clarity programming language. In this book, the reader not only finds a formidable language reference, but also a plethora of code examples, and proven strategies and tactics for effective smart contract design and implementation. In addition, this book familiarizes the reader with contemporary design standards for common smart contracts, such as those for implementing fungible and non-fungible tokens.

The book is approachable to all audiences, and its open-source nature guarantees that new knowledge will be assimilated in real-time as the rapidly-evolving landscape of smart contracts grows. It provides the most thorough description of the Clarity programming language outside of the language’s source code, and is poised to be the preeminent language guide and cookbook for the foreseeable future.

Jude Nelson, Stacks Open Internet Foundation, 2022