Introduction
History
There is a payment called P2SH( pay to script hash) in bitcoin. With this feature, you can compile many interesting scripts( the original form of contract) like this wiki and this.
Here more sample for P2SH:
- Hash Locked Tx on ZKCP
OP_SHA256
<Y> OP_EQUAL
OP_IF
<Seller Pubkey>
OP_ELSE
<block_height+100> OP_CHECKLOCKTIMEVERIFY OP_DROP
<Buyer Pubkey>
OP_ENDIF
OP_CHECKSIG
But for more complex logical control on contract, such as colored bitcoin, and stake IPO, Bitcoin has no these abilities.
More Inventions
- Powerful script: a Turing-Complete VM and interperter
- State stroage: MPT as a database
- Protection of network from abusing of the powerful script: Gas
Experiment on Ethereum private network
- Construct a Private network
what happens on block-chain
- Install a script interpreter: Solidity for example
- Fund a EOA with ether
- Create Contract from this EOA
- write a script
- compile
- deploy
- get address of this contract
what happens on block-chain
- Call the contract
what happens on block-chain
时间: 2024-08-27 00:09:41