Get Set Up To Build On BCH - Developer Resources

December 10 2020

Bitcoin development may sound intimidating, but luckily the developers who partied before you have already laid the necessary groundwork.
Seamless integration of Bitcoin Cash into your desktop, web, or mobile application is just a library away.

This document will provide a short summary for each of CoinParty2020’s recommended tools and resources for the hackathon. These resources were chosen for their low start up costs, reasonable learning curves, and overall quality.

More tools can be found at https://developer.bitcoin.com/, https://bch.info/en/developers, https://developers.cash/, and elsewhere!

Javascript

Libauth is a lightweight Bitcoin, Bitcoin Cash, and Bitauth JavaScript library. It’s made up of simple functions that are combined for more complex functionality. This functional approach makes libauth “flexible, lightweight, and easily auditable”.

https://libauth.org/

SLPJS is a Javascript library for creating and validating “Simple Ledge Protocol” (SLP) token transactions. It can be used to create “genesis” transactions, “mint” transactions, and regular SLP token transactions.

https://github.com/simpleledger/slpjs

Electrum-cash is a Javascript library for connecting to Electrum servers. (See under “Public Infrastructure”.)

https://www.npmjs.com/package/electrum-cash

Electrum API: https://bitcoincash.network/electrum

Python

Bitcash is a Python Bitcoin Cash library with an emphasis on performance and usability. It uses multiple Blockchain APIs for redundancy, supports multiple private key formats, and allows you to construct P2PKH (“Pay-to-public-key-hash”) transactions. There is a complete user guide on the github repository, covering keys, transactions, networking, and other advanced features.

https://pybitcash.github.io/bitcash/

Python-bitcoincash is a python library with a “low level”, “ground up” approach. It provides an easy interface for manipulating Bitcoin Cash data structures and interacting with the protocol. It also includes an RPC interface that is designed to work with a Bitcoin Unlimited full node or an Electrum server.

https://bitcoincash.network/python/

Go (golang)

BCHD provides a collection of resources and tools, all written in Go (golang).

One of these is a full node implementation that fully indexes the BCH blockchain and exposes it via a gRPC API. There are publicly accessible instances of BCHD, covering both “testnet” (a parallel Bitcoin Cash network where the coins are worthless) and “mainnet” (the main Bitcoin Cash network where you’re dealing with real money).

Testnet: bchd-testnet.greyh.at:18335

Mainnet: bchd.greyh.at:8335

There’s also a script debuggerv (see “Bitcoin Cash Script” below), a network crawler and DNS seeder, a set Bitcoin Cash-specific utilities, a generic wallet, the “neutrino” wallet (which uses a privacy-preserving protocol when communicating with nodes), and more.

https://github.com/gcash

Java

Bitcoincashj is a java library that takes care of the basics (like transaction generation and input/output script generation) and also provides cutting edge features like Schnorr signatures, BIP47, and multi-signature wallets. There are example applications, but there is not up-to-date documentation for this library. (So it may require some digging through code to learn how it works.)

https://github.com/pokkst/bitcoincashj

Bitcoin Cash Script

Using the scripting functions available on the BCH network, you can decide under what conditions a coin can be spent. These features are generally referred to as “smart contracts”, and there are currently two languages used to write Bitcoin Cash smart contracts:

CashScript treats “contracts” similarly to “classes” in object-oriented programming. But instead of changing states, one satisfies the requirements of the contract and spends coins stored in the contract. (This transaction can be required to send the coin to another contract!)

https://cashscript.org/

Spedn is a purely-functional, statically typed, and explicitly typed smart contract language with syntax resembling C# or Rust.

https://spedn.pl/

Meep is a Bitcoin Cash script debugger. (“Bitcoin Cash Script” is what’s used to create smart contracts.)

https://github.com/gcash/meep

Bitcoin Unlimited Public Infrastructure

BU hosts “block explorers” (where you can browse the contents of the entire blockchain), for both Mainnet, which is the “real” Bitcoin Cash network, and Testnet, where the coins are worthless, which makes it useful for… testing!

Mainnet explorer: https://explorer.bitcoinunlimited.info/

Testnet explorer: https://texplorer.bitcoinunlimited.info/

BU also hosts an “electrum server”. Instead of browsing for data manually on the web, you can request blockchain data from this server directly from your applications, for example with the electrum-cash JavaScript library above.

Mainnet electrum server: electrs.bitcoinunlimited.info s50002

Protocol Documentation

The Bitcoin Cash protocol is in the process of being thoroughly documented. It’s not finished yet, but it is already an excellent resource for learning how certain parts of the Bitcoin Cash network function, at a low level. (You may or may not need these kinds of details for your project.)

https://reference.cash/