Bitcoin Computer
Javascript Smart Contracts on Bitcoin
 
 
Simple Development
The Bitcoin Computer allows every web developer to write smart contracts in Javascript and run them on Bitcoin. There are many advantages to using Javascript: Developers can use a familiar language and their favorite tools. Entrepreneurs can hire from an abundance of experienced talent. The integration of smart contracts into web applications is seamless. Often the entire backend can be replaced by a smart contract which can vastly simplify web development.
The Bitcoin Computer is a Turing complete smart contract engine. It enables NFTs, fungible tokens, auctions, exchanges, stable coins, chats, games, business applications, and social networks on Bitcoin.
Low Fees
The limiting factor in smart contract development is usually the high mining fee. These fees are charged for every computational step and for every memory update. On the Bitcoin Computer there is no such mining fee. This is because smart contracts are evaluated by the users as opposed to miners. The only fees that need to be paid is the block space required to encode the name of the function being called and its parameters. This is mostly less than a few cents.
For the first time it is possible to run compute and memory intense programs as smart contracts.
High Throughput
We aim to support BTC, LTC, DOGE, BCH, and BSV. Between these blockchains, the Bitcoin Computer will have a maximum throughput of over 300 transactions per second. If one of these blockchains scales exponentially with hardware improvements over time, the maximum throughput increases exponentially as well.
How it Works
Before Ethereum existed Bitcoin had support for tokens that were built on colored coin protocols. Colored coins allow users to encode updates to data structures in Bitcoin transactions. Other users can parse these transactions to recompute the latest state of the data structure. However the kinds of applications that can be built on a specific colored coins protocol is very limited because the supported updates are hard coded into the protocol. Only protocol developers can add support for additional data structures and updates which makes it hard to build tailored applications
The Bitcoin Computer is an improvement over previous colored coin protocol by supporting arbitrary user defined data types and updates. In fact, all computable updates can be encoded. This is achieved by exploiting a basic similarity between Bitcoin's transaction format and the way that data is maintained in computer hardware: memory cells can be simulated by unspent transaction outputs (utxos), when a memory cell is updated a Bitcoin transaction spends the utxo representing the old state of that memory cell and creates an utxo representing the new state.
The Bitcoin Computer creates a shared memory on the blockchain. This utxo based memory can do things that normal memory cannot do: Utxos can store satoshis so that money can be stored in an atomic unit with data. Only users that can unlock the output script can spend a utxo. Thus the right to update data in the Bitcoin memory can also be restricted by Bitcoin Script. This leads to a natural notion of data ownership, enforced by Bitcoin's mining network.
Data structures and updates are specified in Javascript. When a new object is created, a transaction encoding the class and the arguments to the constructor is broadcast. When a function is called, the name of the function as well as its parameters are stored as metadata on a transaction. Other users can parse the transactions and compute the latest state of the data structure, just like in a traditional colored coin.
The computation required to evaluate smart contracts is shifted from the most expensive computing devices (blockchains) to the cheapest ones (user hardware). Users do not consider electricity cost for computation, even when running demanding software like games. Client side validation enables arbitrary computation at a fixed cost. This is the biggest advantage of smart contracts on Bitcoin as it will make it possible to build all applications, even compute intense ones, as smart contracts.
Like for all colored coins, users only need to perform computation for objects they are interested in. This makes it possible for some users to run a smart contract that requires a supercomputer to evaluate without bothering other users.
Application development with the Bitcoin Computer can be compared to web development. The biggest difference is that (nested) Javascript objects can be persisted directly on the blockchain via the client side Bitcoin Computer library. This makes it possible to build any application without a backend just using Bitcoin. This has the potential to greatly reduce development costs because no dedicated backend team is needed.
Plus it's cool to run smart contracts on Bitcoin.
Download from NPM