Skip to content

Commit 8e0281f

Browse files
committed
translate the mvc improvement section
1 parent 78a0a88 commit 8e0281f

File tree

7 files changed

+745
-2
lines changed

7 files changed

+745
-2
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,56 @@
11
---
22
sidebar_position: 3
33
---
4+
45
# Back To Genesis Issue(B2G)
6+
7+
Introduction to what the Token tracing issue is and why tracing is needed.
8+
9+
In UTXO-type contracts, it is necessary to maintain contract states. These contract states need to be implemented
10+
through tracing, requiring validation from the current state all the way back to the genesis state. This process can
11+
potentially lead to infinite state expansion.
12+
13+
Let’s take a practical example:
14+
15+
FT, or Fungible Token contract, is a standard token contract. Unlike Ethereum’s global contract ledger state, in MVC,
16+
its contract state is composed of individual UTXOs. The state of these FT UTXOs includes multiple pieces of information
17+
such as token code, creation information, token quantity, ownership, etc. The contract needs to allow those with FT
18+
ownership to unlock it, while those without control (private key) cannot unlock and transfer FT. The issue of control is
19+
easily solved by requiring the state transition function in the contract to carry the owner’s signature and only
20+
allowing ownership transfer if the signature is correct.
21+
22+
However, there is another problem that cannot be solved merely through ownership verification, and that is the issue of
23+
token authenticity. Since UTXO itself is stateless, it cannot perceive information outside of itself unless external
24+
information is passed as a parameter to the function. Additionally, because the code and state data of the UTXO function
25+
are publicly available on the chain, anyone can forge an identical UTXO. This UTXO's state and code are correct, but it
26+
is not a genuine FT UTXO. If such behavior is allowed, it would mean FT could be arbitrarily over-issued, causing
27+
significant losses to the issuer and holders.
28+
29+
In UTXO contracts, this issue can theoretically be solved. When writing the FT contract, we can forcibly require the
30+
parameters to carry all ancestor transaction information of the current FT (whether recursively or through loops) and
31+
then verify the legality of the ancestor transactions one by one, tracing back to the original transaction. Only those
32+
that can fully form a traceability evidence chain are considered legitimate transactions. The forged transaction
33+
mentioned earlier cannot construct such a traceability evidence chain.
34+
35+
As we can see, with the accumulation of transfers or transactions of the FT contract, the data required for verifying
36+
the ancestor information increases, causing the data needed for unlocking the state to grow larger and larger. This
37+
process can lead to infinite state expansion, a very serious problem in UTXO contracts, severely affecting token
38+
usability.
39+
40+
![State Expansion](/img/russian-nesting-dolls.png)
41+
42+
In some competing chain solutions, token correctness is generally resolved in two ways: one is through indexer
43+
consensus, establishing an indexer mechanism outside the UTXO state on layer one, where the indexer is responsible for
44+
verifying UTXO legitimacy. This is a layer two solution. The biggest drawback of the layer two solution is its inability
45+
to ensure consistency with the main chain. For example, BRC20 relies on the indexer, and you can mistakenly spend BRC20
46+
tokens as ordinary satoshis. Additionally, there are scenarios where contracts unlockable on layer one are not valid on
47+
the indexer, meaning consensus is guaranteed not just by layer one but by both layer one and the indexer together,
48+
greatly increasing the likelihood of bugs and issues. Another solution is using oracles, which rely on external trusted
49+
data sources to ensure token correctness. However, the problem with oracles is their dependence on external data
50+
sources, and if these external sources fail, the token correctness is also affected (oracle malfeasance issue).
51+
52+
MVC uses a technology called [MetaTxid](meta-txid.md) that can achieve traceability of pure layer one contracts without
53+
causing transaction expansion, no longer relying on external indexers and oracles to maintain state correctness.
54+
Instead, it uses only the UTXO itself and some previous transactions to identify token legitimacy. In other words, the
55+
information to determine whether the token is legitimate is already entirely contained within the contract, without
56+
needing external blockchain state for auxiliary judgment (this is an important feature of layer one).
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,70 @@
11
---
22
sidebar_position: 1
33
---
4+
45
# BVM & OPCODE Unlocking
6+
7+
Introduction to the scripting system and BVM.
8+
9+
## Scripting System
10+
11+
Bitcoin Script is a programming language used in Bitcoin transactions to define payment conditions. It is a stack-based
12+
language where opcodes perform various operations such as data pushing, logical evaluation, cryptographic hashing, and
13+
signature verification. Script is not Turing-complete, avoiding complex infinite loops. Typical use cases include
14+
multi-signature addresses, time-locked transactions, and pay-to-hash-lock addresses. Each transaction contains a locking
15+
script and an unlocking script. A transaction is only validated if the unlocking script meets the conditions of the
16+
locking script.
17+
18+
Here are some common opcodes in Bitcoin Script:
19+
20+
1. `OP_DUP`: Duplicates the top item on the stack.
21+
2. `OP_HASH160`: Performs SHA-256 followed by RIPEMD-160 hashing on the top item of the stack.
22+
3. `OP_EQUALVERIFY`: Compares the top two items on the stack; if they are equal, it continues, otherwise validation
23+
fails.
24+
4. `OP_CHECKSIG`: Verifies if a signature is valid.
25+
5. `OP_CHECKMULTISIG`: Verifies multiple signatures.
26+
27+
These opcodes are used in Bitcoin transaction scripts to implement various functionalities such as signature
28+
verification, multi-signature, and hash locking.
29+
30+
For detailed information, refer to [Opcodes](../../contract/bitcoin-scripts/opcode.md).
31+
32+
![img.png](/img/bitcoin-script-stack.png)
33+
34+
## BVM (Bitcoin Virtual Machine)
35+
36+
BVM is a virtual machine based on Bitcoin's [scripting system](https://en.bitcoin.it/wiki/Script) with restored opcodes
37+
and extended functionalities. It serves as the execution engine for MVC smart contracts. Bitcoin's scripting system is a
38+
dual-stack executor, including input and output stacks, using a Forth-like language to perform arbitrary operations on
39+
the stack to achieve higher-level logic. In fact, many modern programming languages rely heavily on the execution stack.
40+
In principle, you can implement arbitrarily complex program logic through a stack structure, provided there are
41+
sufficient memory resources. The stack structure is the foundation of modern programming languages, with infinite
42+
potential.
43+
44+
However, due to BTC's limitations, the scripting system can only perform simple logical judgments with very limited
45+
opcodes, unable to realize complex smart contract logic. BVM expands the scripting system by introducing more opcodes,
46+
supporting more data types, and providing more functionalities, allowing MVC smart contracts to achieve more complex
47+
logic.
48+
49+
We can define and summarize the features of BVM and its contracts as follows:
50+
51+
1. BVM is a virtual machine that extends the functionalities of Bitcoin's script system opcodes.
52+
2. BVM consists of input and output stacks. The output stack can be viewed as the function definitions and data of smart
53+
contracts, while the input stack can be seen as the function calls and parameters of smart contracts.
54+
3. BVM contracts are [purely functional operations](https://www.turing.com/kb/introduction-to-functional-programming)
55+
with characteristics such as atomicity, statelessness, no side effects, and parallel execution typical of functional
56+
programming.
57+
4. The result of BVM contract computation is either TRUE or FALSE, determined by whether the UTXO can be unlocked to
58+
judge the contract's success.
59+
5. BVM contracts are atomic, meaning they either all succeed or all fail, with no partial execution. Failed contract
60+
validations do not consume GAS fees, as they are considered illegal transactions and are not recorded on the chain.
61+
62+
## Opcode Unlocking
63+
64+
For security reasons, Bitcoin's design restricts the number and type of usable opcodes, allowing only a few standard
65+
types of transaction outputs, limiting the functionality of smart contracts.
66+
67+
MVC restores the original version of the opcodes to expand the flexibility of transactions and contracts, supporting
68+
more data types and providing more functionalities, allowing MVC smart contracts to achieve more complex logic.
69+
70+
For the list of available opcodes, refer to [Bitcoin Opcodes](https://en.bitcoin.it/wiki/Script).
Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,43 @@
11
---
22
sidebar_position: 6
33
---
4-
# Meta Contract
4+
5+
# MetaContract
6+
7+
Introduction to MetaContract standard contracts.
8+
9+
According to previous content, MVC primarily solves the Token tracing issue, making the execution of stateless UTXO
10+
contracts possible. MetaContract represents a series of standard contracts that use MetaTxid technology.
11+
12+
## FT (Fungible Token) Contract
13+
14+
The FT contract is a standard token contract. Unlike Ethereum's global contract ledger state, in MVC, its contract state
15+
is composed of individual UTXOs. These FT UTXOs' states include multiple pieces of information such as token code,
16+
creation information, token quantity, ownership, and more. The contract needs to allow those with FT ownership to unlock
17+
it, while those without control (private key) cannot unlock and transfer FT. The state transition function in the
18+
contract must carry the owner's signature, and only with a correct signature can ownership be transferred.
19+
20+
For detailed contract analysis, refer to [FT Contract](../../contract/mvc-standard/ft-token.md).
21+
22+
Source repository: [https://github.com/mvc-labs/token-core](https://github.com/mvc-labs/token-core)
23+
24+
## NFT (Non-Fungible Token) Contract
25+
26+
The NFT contract is a standard non-fungible token contract. The contract state of an NFT contract is composed of
27+
individual UTXOs. These NFT UTXOs' states include multiple pieces of information such as token code, creation
28+
information, token quantity, ownership, and more. The contract needs to allow those with NFT ownership to unlock it,
29+
while those without control (private key) cannot unlock and transfer NFT. The state transition function in the contract
30+
must carry the owner's signature, and only with a correct signature can ownership be transferred.
31+
32+
For detailed contract analysis, refer to [NFT Contract](../../contract/mvc-standard/nft-token.md).
33+
34+
Source repository: [https://github.com/mvc-labs/nft-core](https://github.com/mvc-labs/nft-core)
35+
36+
## DAO (Decentralized Autonomous Organization) Contract
37+
38+
The DAO contract is a standard decentralized autonomous organization contract. The DAO contract is used for MVCDAO
39+
voting and governance, requiring the staking of sufficient SPACE tokens to vote on proposals.
40+
41+
For detailed contract analysis, refer to [DAO Contract](../../contract/mvc-standard/dao.md).
42+
43+
Source repository: [https://github.com/mvc-labs/mvcdao-core](https://github.com/mvc-labs/mvcdao-core)

docs/blockchain/mvc-improvements/meta-id.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,44 @@
22
sidebar_position: 5
33
---
44
# MetaId Web3 Identity
5+
6+
Introduction to the MetaId identity protocol.
7+
8+
[MetaID](https://docs.metaid.io/) is a unified identity and data format protocol built on Bitcoin and its isomorphic blockchains (such as MVC). Based on the MetaID protocol, developers can create various Web3 applications on Bitcoin, where data is owned by the user.
9+
10+
## Uses of MetaID
11+
12+
In simple terms, MetaID can be used to:
13+
14+
- Build all types of Web3 applications on Bitcoin and MVC, including social applications, games, e-commerce applications, etc.
15+
- Issue various FT and NFT assets closely tied to data value on Bitcoin and MVC.
16+
17+
## Features of MetaID
18+
19+
- Abstracts discrete blockchain data into an ordered tree structure, preparing it for building Web3 applications on Bitcoin.
20+
- All user information and application data are on-chain, stored at addresses corresponding to user-controlled private keys, ensuring data ownership solely by the data creator.
21+
- Each piece of MetaID on-chain data is inherently a non-fungible token (NFT) data, allowing users to freely transfer and trade it, giving users complete control over their data.
22+
- Data can be interconnected across different applications, eliminating data silos between applications. Different protocol data can be combined under a user's MetaID, significantly reducing Web3 application development efforts.
23+
24+
## Vision of MetaID
25+
26+
Bitcoin, with its high consensus, high concurrency, and support for on-chain data storage, is the best carrier for Web3 applications. MetaID aims to become the largest unified protocol for user identity and data in the Bitcoin ecosystem.
27+
28+
MetaID will create a new Web3 development paradigm where data is interconnected, owned by users, and naturally combined with user data and assets. We believe Bitcoin = Money + Data.
29+
30+
## Basic Principles of MetaID
31+
32+
Through the MetaID protocol, transactions based on MetaID scattered on the blockchain are fully categorized into a tree structure based on "people". From the perspective of the MetaID protocol, all on-chain data is abstracted and stored on-chain in the format of a "MetaID tree". Thus, data can be independent of the chain and even independent of the envelope format storing the data. As long as the resulting "MetaID tree" conforms to the MetaID format, it can achieve user-owned data, orderly data storage, and data interoperability. Therefore, all forms of Web3 applications can be built on this foundation.
33+
34+
Categorizing discrete blockchain data into ordered structured data based on "people":
35+
![img.png](/img/metaid-structure.png)
36+
37+
Reusing on-chain data through the protocol:
38+
![img_1.png](/img/metaid-reuseable.png)
39+
40+
Combining different protocols in an application through MetaID:
41+
![img_2.png](/img/metaid-composition.png)
42+
43+
## More Details
44+
45+
Please refer to the [MetaID official documentation](https://docs.metaid.io/).

0 commit comments

Comments
 (0)