UPDATED 15:47 EST / DECEMBER 29 2015

finger on a keyboard NEWS

21, Inc. releases comprehensive 21 Bitcoin Library for developers

Today 21, Inc. producer of the 21 Bitcoin Computer, a tiny programmable Linux machine with a Bitcoin miner attached, announced the release of a comprehensive library for use with the machine. This is expected to be the first step on a roadmap towards a portable open-source release.

This continues 21’s strong show for its developer community, which appears to be aiming for a distributed autonomous network layer where developers (and devices) can expose jobs to the network and pay for work in bitcoins. This has obvious implications for an Internet of Things marketplace and has been proof-of-concept tested by Jeff Garzik, Bitcoin core developer.

The 21 Bitcoin Library is written in Python 3 and the core module is available under the namespace “two1.lib.bitcoin” with documentation available from the 21 Bitcoin Library website.

The core key features include:

  • Classes for major Bitcoin data structures, like blocks, block headers, transactions, scripts, public and private keys, and digital signatures;
  • Code to consistently serialize and deserialize these data structures to and from raw byte representations;
  • Creation of standard scripts (Pay-to-Public-Key-Hash [P2PKH] and Pay-to-Script-Hash [P2SH]) as well as multi-sig support;
  • Transaction creation, signing, verification, and broadcasting, including for multisig transactions;
  • Standard public/private key generation as well as generation of keys for HD wallets;
  • Utilities for working with Bitcoin’s various idiosyncrasies, from parsing variable length integers to converting difficulties to bits and back.

The second module is the 21 Blockchain Library, which is accessible from the “two1.lib.blockchain” namespace. This library provides an API for requesting transaction and block data from a blockchain provider (in this case the Bitcoin blockchain). The API also allows the submission of transactions to the provider for inclusion in new blocks.

The third module is the 21 Machine Wallet Library, which is accessible from the “two1.lib.wallet” namespace. This provides a wallet that is optimized for machine-to-machine transactions that connects directly to the 21 Mining Chip, combined with every 21 Bitcoin Computer. The announcement added that the wallet conforms to both BIP-32 and BIP-44 standards.

The final module is the 21 Crypto Library, which is accessible from the “two1.lib.crypto” namespace. With this module, developers can access low-level cryptographic functions used for Bitcoin transactions for creating public key signatures using Elliptic Curve Digital Signature Algorithm (ECDSA) on the secp256k1 curve. This module provides two sub-modules, one which uses OpenSSL if the OpenSSL library is available on the system and the second sub-module is a pure Python module designed to be more portable, but comes with less performance optimizations and is not as fully audited.

Developers interested in the new library can see the whole documentation on the 21 Bitcoin Computer reference website and those new to the system can find tutorials at 21.co/learn.

Featured image credit: Photo via Pixabay

Since you’re here …

… We’d like to tell you about our mission and how you can help us fulfill it. SiliconANGLE Media Inc.’s business model is based on the intrinsic value of the content, not advertising. Unlike many online publications, we don’t have a paywall or run banner advertising, because we want to keep our journalism open, without influence or the need to chase traffic.The journalism, reporting and commentary on SiliconANGLE — along with live, unscripted video from our Silicon Valley studio and globe-trotting video teams at theCUBE — take a lot of hard work, time and money. Keeping the quality high requires the support of sponsors who are aligned with our vision of ad-free journalism content.

If you like the reporting, video interviews and other ad-free content here, please take a moment to check out a sample of the video content supported by our sponsors, tweet your support, and keep coming back to SiliconANGLE.