Introducing Bitstore and Open Publish

This is a first in a series of articles about two pieces of technology that we've created at Blockai, Bitstore and Open Publish.

With Open Publish we want to give ownership of digital media back to the individual and allow them to create contracts for licensing and micropayment channels using Bitcoin as a currency. Think combining BlockSign, OpenAssets and a royalty payment mechanism.

Like BlockSign, digital media is represented as a cryptographic digest but in a content-addressable format that works seamlessly with Bittorrent and Webtorrent. This content-addressable representation is provably signed, timestamped, and recorded in perpetuity by the Bitcoin blockchain.

A private service we've created called Bitstore is dedicated to distribution and to permanently store and seed media over HTTP and on various torrent networks. Bitstore is a paid-only service that uses Bitcoin. Customers authenticate themselves with Bitcoin public-key infrastructure and cover their own hosting and distribution costs.

While Bitstore and Open Publish are natural compliments they are not dependent on each other. Media can be hosted on Bitstore and not registered as an Open Publish asset. At the same time Bitstore is not required by Open Publish as media can be hosted by any private third-party service.

We'll get things started with a quick overview of how to create a wallet and the basics of developing Bitcoin software.

Most of the interactions are dependent on previous steps, so make sure you go through everything in order!

Bitcoin Wallet

The first thing we need to do is generate a Bitcoin wallet.

We can generate a wallet with a long passphrase. This is known as a brain wallet. The same passphrase will always return the same wallet. This is convienient for our demonstration but impractical in use with actual Bitcoin.

Brain wallets, like passwords, are not by themselves a reliable part of self-authentication. Third-party services and physical devices are helpful in the the process of key management.

wallet-address

By itself a bitcoin wallet is just a private key and a public key. All of the information about the state of the wallet is stored in the public blockchain and is accessible from a number of open blockchain APIs.

balance

Send Bitcoin to Wallet

There are a number of testnet faucets like this at bitcoinfaucet.uo1.net or testnet-faucet.elementsproject.org. Use the above Wallet Address with one of these faucets and send yourself some testnet coin.

When you've done that, click on "Get Wallet" again to refresh you balance.

Sometimes it can take a little while for testnet transactions to post and your balance to update.

Bitstore

Bitstore is a content-addressable cloud storage web service that uses Bitcoin public key infrastructure for authentication and payment.

The basic idea is that customers pay for the storage and retrieval costs of their digital media. Here at Blockai we are committed to building consumer products that never rely on advertising or selling personal data to third-party companies to cover our costs. In essence, we're building products where people own their own content and with that comes taking on financial responsibility.

How it works is a customer sends a small amount of Bitcoin to a deposit address provided by Bitstore and their account is immediately credited. Once their credits are in place they are free to store and retrieve media on a per-file and per-use basis. Once a customer's credits have been used up the file is no longer available for retrieval, however anyone can make a deposit to any account.

If we did our math correctly it currently costs about 1/3rd of a cent to upload a photograph and distribute a 100 copies but I expect adjustments to our initial pricing mechanism. Needless to say, using Bitstore will cost very little and we don't really expect people to purchase more than a few dollars worth of credits, depending on their distribution needs.

Content-addressable

Content-addressable means that the file is referenced not by a name but by a cryptographic hash of the contents. Bitstore supports MD5, SHA-1, SHA-256 and BitTorrent Info Hash as identifiers.

Every digital file has a unique hash. Think of it like a fingerprint. If any of the bits in the file change, the fingerprint changes. This property is great for tracking different versions of files and is employed by revision control systems like git.

Bitstore Client

On the software side of things we need to generate a Bitstore client.

The Bitstore client uses a Bitcoin wallet to sign tokens for identification and to authorize with the Bitstore servers. In effect your Bitcoin wallet address is your ID.

bitstore-deposit-address
bitstore-balance

Send Bitcoin to Bitstore Deposit Address

Bitstore is a pay-per-use, per-file service and needs Bitcoin in order to operate.

We need to send some Bitcoin from our brain wallet to the Bitstore deposit address in order to top up our balance.

We're going to build and post our own Bitcoin transaction.

First we need to query the a public blockchain API for a list of all the unspent outputs for our wallet. These unspent outputs represent all the Bitcoin that was sent to our wallet. We'll use them to build our own transaction.

Here our values are listed in integer value units of Bitcoin known as satoshi. There are 100,000,000 satoshi in a single bitcoin. Taking the sum of all the values of our unspent outputs is how we compute the balance of our wallet.

We need to use this unspent outputs in order to create and sign our own transactions. We can examine the details of how a transaction is created in more detail at a later time.

Now that we have our transaction we need to sign and post it to a public bitcoin node.

We convert our signed transaction to the hex byte code representation supported by bitcoind.

Upload file to Bitstore

Once your Bitstore account has some credits you can start uploading files. The browser client has a convenient interface that pairs well with this drag-drop module on npm.

Drop File Here
hash_sha1
hash_btih
uri
size

Open Publish

Now that we've handled hosting and distribution for our media we're ready to register with the Open Publish protocol and claim ownership over a digital asset that we're using in our products to represent a limited and non-exclusive copyright of this document.

Any honest third-party software can read the state of ownership from the Bitcoin blockchain and create software that directs payments to the legitimate owners of the content in the form of direct tips, monthly subscriptions or various synchronization licenses modeled on existing intellectual property systems.

For example, we could write software that displays media with a consumer Bitcoin wallet allowing for people to easily and directly tip the rights-holders.

It assumes that the wallet address that posted the Open Publish registration transaction to the Bitcoin blockchain is controlled by the owner of the registered media.

Posting an Open Publish transaction to the Bitcoin network

Open Publish is not dependent on Bitstore. Hosting and distribution of content is not the goal of Open Publish although an optional link to the content can be part of the metadata.

Public stream

Open Publish transactions are native Bitcoin transactions. This means they are broadcast and stored on all nodes in the Bitcoin network. Anyone can freely stream, read, and write their own Open Publish transactions in same equal-access manner as native Bitcoin transactions. Open Publish takes advantage of the unique distributed yet single-source-of-truth nature of the Bitcoin blockchain.

What this means is that neither Blockai nor any other private entity is required to register with Open Publish.

Here we're scanning for a list of Open Published documents for our wallet. Open Publish uses the Blockcast protocol to embed data in the blockchain.

There's a lot more to discuss with both Bitstore and Open Publish, as well as how we're using these technologies to create products for consumers and publishers of digital media, but we'll leave the rest for future articles.

If you're interested in what we're working on, please get in touch.

We're currently hiring so send in a resume if you're as passionate about this kind of stuff as we are!

William Cotton, CTO Blockai

william@blockai.com