diff --git a/packages/docs/how-it-works.md b/packages/docs/how-it-works.md index f0fcb83d1..83dfe1d02 100644 --- a/packages/docs/how-it-works.md +++ b/packages/docs/how-it-works.md @@ -7,20 +7,19 @@ icon: light-bulb ## Intuition -A Bitcoin Computer transaction is a Bitcoin transaction with a Javascript expression inscribed. The value of the expression is associated with the first output of the transaction. If the value is an object or array that has sub-objects, then each sub-object is associated with a distinct output of the transaction. +In a Bitcoin Computer transaction, a JavaScript expression is embedded within a standard Bitcoin transaction. The result of evaluating this expression is linked to an output. If the result contains objects, each of these objects is assigned to a separate output. -If the expression contains a free variable (for example the variable `x` is free in the expression `x + 1`), then that free variable has to be associated with an input of the transaction. To determine the values of the outputs, the Bitcoin Computer recursively determines the values of each output spent. The free variable is then substituted with the value before the expression is evaluated. +For expressions with an undefined variable (for example, the variable `x` is undefined in the expression `x + 1`), the smart contract developer can associate that variables with an input of the transaction. The Bitcoin Computer then recursively calculates the values of these outputs, and replaces the undefined variables with their computed values from previous transactions to evaluate the expression. ### Basic Example ![](/static/legend@1x.png)- -In the examples below, white boxes represent transactions and grey boxes represent expressions inscribed. Inputs and outputs are displayed as circles and spending relations are shown as arrows. -
+ -![](/static/int-example@1x.png) -Consider a transaction with the expression `1+2` inscribed. As this expression evaluates to `3`, the Bitcoin Computer will associate the first output with the value `3`. -If this output is spent by a transaction with an inscription `x+4` and the first input is associated with `x`, the Bitcoin Computer determines the value of the output spent by that input. In the example that output has the value `3`. Hence, the output of the second transaction has the value `7`. +In this example, the transaction is inscribed with the arithmetic expression `1+2`, which evaluates to `3`. This value is then associated with the transaction’s first output. In a subsequent transaction, an expression `x+4` uses this output's value as its variable `x`. Given that the output from the first transaction was `3`, the expression in the second transaction evaluates to `7`, and this new value is assigned to its output. This demonstrates how values can be propagated and transformed across transactions in the Bitcoin Computer system. +
## Detailed Description @@ -29,23 +28,25 @@ If this output is spent by a transaction with an inscription `x+4` and the first We will refer to a Javascript expression that is inscribed in a transaction as a *smart contract*. The value that such an expression evaluates to is called a *smart value*. If a smart value is of object type we refer to it as a *smart object*. -### Data Ownership +In the Bitcoin Computer system, JavaScript expressions embedded within transactions are called smart contracts. The values of these expressions is known as a smart values. When a smart value is of an object type, it is referred to as a smart object. This terminology is borrowed from object oriented programming and helps distinguish between a class and the objects created from such a class. -The method of associating data values to outputs described above gives rise to a natural notion of data ownership: A smart value that is *owned* by the users that can spend that output. This is analogous to how satoshis in an output are owned by the users that can spend the output. +### Data Ownership -The Bitcoin Computer adds a property `_owners` to every smart object. It is set to the array of the public keys of the owners. Conversely, if an object is created with a property `_owners` that is set to an array of *n* string encoded public keys, then the output that represents the object has a *1*-of-*n* multisig script with these public keys. +In the TBC system, data ownership is linked to the ability to spend an output, similar to the ownership of Bitcoin. A “smart object embedded in a transaction is the property of the user(s) who can spend that output. For enhanced security and ownership clarity, every “smart object” includes an `_owners` property, listing the public keys of its owners. Conversely, if an object is created with a property `_owners` that is set to an array of $n$ string encoded public keys, then the output that represents the object has a $1$-of-$n$ multisig script with these public keys. ### Creating Objects and Object Identity -One advantage of associating values with transaction outputs is that the transaction id and output number can be used as an *identity* for the object. Whenever a smart object is created the Bitcoin Computer assigns the identity to a property `_id` of the object. The object identity cannot be reassigned and remains fixed throughout the lifetime of the object. +Associating values with transaction outputs facilitates the use of the transaction ID and output number as a unique identifier for each smart object. This identifier is assigned to the _id property of the smart object upon its creation and remains unchanged for the object’s entire lifespan. ### Updating Objects and Object Revisions -Whenever a smart object is updated a transaction is broadcast that spends the outputs representing the object's old state. The outputs of the transaction are associated with the new state of the object. The transaction id and output number that is associated with the new state of an object is referred to as it's *revision*. The revision is assigned to a property `_rev` of the object. +When a smart object is updated, a transaction is broadcast that spends the old state’s utxo with new one, reflecting the object’s updated state. This transaction ID and output number are designated as the object’s revision and stored in the `_rev` property of the object. This mechanism ensures that each update is traceable and securely linked to the specific transaction. ### Ancestors and Roots of Objects -If an object is created in a function call of the form `x.f(...)` we say that `x` is its parent. We say that an object `x1` is the ancestor of an object `xn` if there is a sequence of objects `z2 ... zn-1` such that `xi` is the parent of `xi_1` for all `i`. The *root* of an object is its (unique) ancestor that does not have a parent. The Bitcoin Computer assigns the root of an smart object to the property `_root`. The root can be used to create fungible tokens with the Bitcoin Computer. +If an object is created in a function call of the form $x.f(\ldots)$ we say that $x$ is its parent. We say that an object $x_1$ is the ancestor of an object $x_n$ if there is a sequence of objects $x_2 \ldots x_{n-1}$ such that $x_i$ is the parent of $x_{i+1}$ for all $i$. The root of an object is its (unique) ancestor that does not have a parent. The Bitcoin Computer assigns the root of a smart object to the property `_root`. The root can be used to create fungible tokens with the Bitcoin Computer. + +In other words, an object’s lineage is defined by its function calls. If an object is created within a function, the object calling the function is deemed the parent. An ancestor of an object is defined by a lineage of parent-child relationships leading back to a unique ancestor with no parent, which is called the root. The root identity is critical for creating fungible tokens, as it provides a stable reference point for all transactions and interactions related to that object. ## Examples diff --git a/packages/docs/index.md b/packages/docs/index.md index 36808e604..464793dcf 100644 --- a/packages/docs/index.md +++ b/packages/docs/index.md @@ -6,20 +6,21 @@ layout: page # Introduction -The Bitcoin Computer (TBC) is a Turing-complete smart contract system for Bitcoin and Litecoin. You can build decentralized applications, such as tokens, exchanges, games, social networks, and more. +The Bitcoin Computer (TBC) is a Turing-complete smart contract system for Bitcoin and Litecoin, designed for creating decentralized applications. With TBC, you can create tokens, exchanges, games, social networks, and more. -**Free Computation.** The most important feature of TBC is that the execution cost is independent of the computational complexity of the smart contract. For most other smart contract systems, the execution cost increases with each computational step. Instead, the cost on TBC is fixed for an unlimited number of computational steps. +**Free Computation.** A key feature of TBC is that execution costs do not depend on the computational complexity of the smart contract itself. Unlike other systems where costs escalate with computational intensity, TBC maintains a fixed cost for an unlimited number of computational steps. -**JavaScript.** Smart contracts are JavaScript or TypeScript classes. This makes it seamless to integrate smart contracts into web applications and makes development easy due to the existing JavaScript ecosystem. +**JavaScript and TypeScript Support.** Smart contracts on TBC are built using JavaScript or TypeScript classes, ensuring fluid integration with web applications. This compatibility leverages the robust JavaScript ecosystem, simplifying development and enhancing functionality. -**How it works.** You can inscribe a JavaScript class to deploy a smart contract. Then, you can inscribe a constructor call to create a smart object and a function call to update a smart object. +**How it works.** To deploy a smart contract on TBC, simply inscribe a JavaScript class. You can then instantiate your smart contract by inscribing a constructor call, creating a “smart object”. Updates to this object are managed through subsequent inscribed function calls, enabling dynamic interactions within your application. -**Data Ownership.** Conceptually, a smart object is stored in a UTXO, and only the owner of the UTXO can update its state. This captures a natural notion of data ownership that is as secure as ownership of Bitcoin. -**Historical States.** As every update is recorded in a separate transaction, every historical state of a smart object can be recovered, together with information about who updated it and when. +**Data Ownership.** In TBC, each smart object resides within a UTXO (Unspent Transaction Output). The owner of the UTXO is the only entity authorized to modify the object’s state, reflecting a natural approach to data ownership that mirrors the security associated with Bitcoin transactions. -**Encryption and Off Chain Storage.** By default, every user can read all states of all smart objects. However, TBC has support for end-to-end encryption and storing data off-chain built-in. These properties make it easy to build applications that comply with consumer protection laws such as CCPA and GDPR. +**Historical States.** Every transaction on TBC records an update, allowing for the recovery of every historical state of a smart object. This history includes details on who made updates and when, providing a comprehensive audit trail for each object. -**Pure Bitcoin.** Finally, TBC relies only on Bitcoin. It does not require a side-chain or an extra token. This makes it possible to build applications that are as stable as Bitcoin. +**Encryption and Off Chain Storage.** By default, every user can read the states of smart objects on TBC. However, the platform includes built-in support for end-to-end encryption and off-chain data storage. These features facilitate the development of applications that adhere to consumer protection regulations such as the CCPA and GDPR, ensuring both security and compliance. + +**Pure Bitcoin.** Finally, TBC relies only on Bitcoin. It does not require a side-chain or an extra token. This makes it possible to build applications that are as trustless as Bitcoin. **Contact.** TBC is being developed by BCDB Inc. If you have any questions, please let us know in our [Telegram group](https://t.me/thebitcoincomputer), on [Twitter](https://twitter.com/TheBitcoinToken), or by email at clemens@bitcoincomputer.io. diff --git a/packages/website/README.md b/packages/website/README.md index 69bbd267b..625d1c5c7 100644 --- a/packages/website/README.md +++ b/packages/website/README.md @@ -12,4 +12,12 @@ ## Usage +### Run Locally + +``` +npm start +``` + +### Deploy + To deploy a new version merge a pull request into main. diff --git a/packages/website/src/Features.tsx b/packages/website/src/Features.tsx index 1431e7975..8723bd99d 100644 --- a/packages/website/src/Features.tsx +++ b/packages/website/src/Features.tsx @@ -22,44 +22,43 @@ function Features() { diff --git a/packages/website/src/Introduction.tsx b/packages/website/src/Introduction.tsx index d862f18f9..48f78cb10 100644 --- a/packages/website/src/Introduction.tsx +++ b/packages/website/src/Introduction.tsx @@ -25,14 +25,13 @@ function Introduction() { Features -

Turing Complete Smart Contracts

-

for Bitcoin.

+

Enabling Turing-complete smart contracts

+

on Bitcoin.

-

Bitcoin Computer is an easy to use smart contract system for Bitcoin.

-

You can build fungible and non-fungible tokens (NFTs), games, social

-

networks, exchanges, auctions, voting, office applications, artificial

-

intelligence ... anything really.

+

Bitcoin Computer is an easy-to-use smart contract platform for Bitcoin,

+

enabling the creation of fungible tokens, NFTs, games, social networks,

+

or complex systems like exchanges, auctions, and even artificial intelligence.