Introducing Blockchain with Lisp

Retired

This book is no longer available for sale.

Introducing Blockchain with Lisp

Implement and Extend Blockchains with the Racket Language

About the Book

You can purchase this book on Apress

Implement blockchain from scratch covering all the details with Racket, a general-purpose Lisp. You'll start by exploring what a blockchain is, so you have a solid foundation for the rest of the book. You'll then be ready to learn Racket before starting on your blockchain implementation. Once you have a working blockchain, you'll move onto extending it. The book's appendices provide supporting resources to help you in your blockchain projects.

The recommended approach for the book is to follow along and write the code as it’s being explained instead of reading passively. This way you will get the most out of it. All of the source code is available for free download from GitHub. 

What You Will Learn

Discover the Racket programming language and how to use it

Implement a blockchain from scratch using Lisp

Implement smart contracts and peer-to-peer support

Learn how to use macros to employ more general abstractions

Who This Book Is For

Novices that have at least some experience with programming, as well as some basic working experience with computers. The book also assumes some experience with high school mathematics, such as functions.

  • Share this book

  • Categories

    • Computer Science
    • Computers and Programming
    • Software Engineering
    • Functional Programming
  • Feedback

    Email the Author(s)

About the Author

Boro Sitnikovski
Boro Sitnikovski

Boro Sitnikovski has over 10 years of experience working professionally as a Software Engineer. He started programming with the Assembly programming language on an Intel x86 at the age of 10. While in high school, he has won several prizes on competitive programming, varying from 4th, 3rd, and 1st place.

He is an Informatics graduate - his Bachelor's thesis was titled "Programming in Haskell using algebraic data structures", and his Master's thesis was titled "Formal verification of Instruction Sets in Virtual Machines". He has also published a few papers on software verification. Other research interests of his include programming languages, mathematics, logic, algorithms, and writing correct software.

He is a strong believer in the open-source philosophy and contributes to various open-source projects.

In his spare time, he enjoys some time off with his family.

Table of Contents

  • Preface and acknowledgments
  • 1. Introduction to Blockchain
    • 1.1. Motivation and basic definitions
    • 1.2. Encryption
      • 1.2.1. Functions
      • 1.2.2. Symmetric-key algorithm
      • 1.2.3. Asymmetric-key algorithm
    • 1.3. Hashing
    • 1.4. Smart contracts
    • 1.5. Bitcoin
    • 1.6. Example workflows
    • Summary
  • 2. Racket programming language
    • 2.1. Introduction to Lisp
      • 2.1.1. Data structures and recursion
      • 2.1.2. Languages and syntax
    • 2.2. Configuration and installation
    • 2.3. Introduction to Racket
      • 2.3.1. Primitive types
      • 2.3.2. Lists, evaluation, quotes
      • 2.3.3. Dotted pairs
      • 2.3.4. Adding definitions
      • 2.3.5. Procedures and functions
      • 2.3.6. Conditional procedures
      • 2.3.7. Recursive procedures
      • 2.3.8. Procedures that return procedures
      • 2.3.9. General higher-order procedures
      • 2.3.10. Packages
      • 2.3.11. Scope
      • 2.3.12. Mutation
      • 2.3.13. Structures
      • 2.3.14. Threads
    • 2.4. Creating an executable
    • Summary
  • 3. Blockchain implementation
    • 3.1. wallet.rkt
    • 3.2. block.rkt
      • 3.2.1. Construction
      • 3.2.2. Hashing and verification
      • 3.2.3. Hashcash algorithm
    • 3.3. utils.rkt
    • 3.4. Transactions
      • 3.4.1. transaction-io.rkt
      • 3.4.2. transaction.rkt
    • 3.5. blockchain.rkt
      • 3.5.1. Initialization
      • 3.5.2. Rewards
      • 3.5.3. Adding a transaction
      • 3.5.4. Verification
    • 3.6. Integrating components
      • 3.6.1. main-helper.rkt
      • 3.6.2. main.rkt
    • Summary
  • 4. Extending the blockchain
    • 4.1. Smart contracts implementation
      • 4.1.1. smart-contracts.rkt
      • 4.1.2. Updating existing code
    • 4.2. Peer-to-peer implementation
      • 4.2.1. peer-to-peer.rkt
      • 4.2.2. Updating existing code
      • 4.2.3. main-p2p.rkt
    • Summary
  • Conclusion
  • Further reading
  • Appendix A: Macros
    • Hygienic macros
  • About the author
  • Notes

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub