Compared to the original project warehouse:
GitHub Address: Https://github.com/Bytom/bytom
Gitee Address: Https://gitee.com/BytomBlockc ...
This section mainly for the user to manage the private key and address, and through the Utxo to build and send transactions.
1. Create a private key and public key
2. Create a Receive object from the public key
3. Find what you can spendutxo
4. Through utxo
, simplified schematic diagram similar to this:
This kind of bookkeeping is the easiest to think of, but the bitcoin blockchain is not used this way. The important thing to say three times, Bitcoin trading system is not like this, not so, not so. The reason is simple, if the use of this method of accounting, every time a new transaction, the system will have to retrace all the trading history, so as to determine whether the latest transaction is not legal, as shown above, User C has the money.
A brief analysis of Qtum account Abstraction Layer (AAL) implementation
Qtum is designed with the Bitcoin Utxo as the base account model and implements the smart contract that supports EVM specification, which is done through the account abstraction layer, the AAL. The AAL has adapted between the Utxo account and the EVM contract account so that the AAL can use the Utxo
of this article varies greatly, please click here to see all the code changes.
Reward
In the previous article, one of the little details we skipped was mining rewards. Now, we are ready to refine this detail.
Mining rewards, in fact, is a coinbase transaction. When a mining node starts digging a new block, it pulls the deal out of the queue and appends a Coinbase transaction to the front. The Coinbase transaction has only one output, which contains the miner's public key hash.
The rewards a
First, quotations
Design Bytom data structure, combine a lot of technical points, such as Patricia Tree,utxo, BVM, account Model,protobuf,sql,memcache and so on. This article will do the following two point analysis of some technical points.
Bytom Why should I use this technology point?
Bytom How to apply this technology point?
Finally, it introduces how to realize Bytom of these technical points.
[Patricial Tree] (http://www.allisons.org
. The resulting blockchain, which does not contain transaction information, is only 1/1000 of the total blockchain size. SPV nodes cannot build the full picture of all the utxo that can be consumed, because they do not know the complete information of all transactions on the network. The method used by the SPV node to verify the transaction is slightly different, which relies on the peer node "on demand" to provide a partial view of the relevant part
Recently in the exchange with colleagues in our palletone on the Utxo and signature processing, some experience, write down this blog post. The basic concept of Bitcoin is that bitcoin is a ECDSA digital signature to unlock the unspent balance in Utxo.
About Utxo I do not need to do too much introduction, after all, the introduction of the concept of the article
following explanations. So, while trying to describe as simple as possible, with some charts, let's start straight.Definitions of terms and abbreviations
Bitcoin: Bitcoin with uppercase B refers to the protocol--Code, node, network, and its peer interaction.
Bitcoin: b The currency is expressed in lowercase letters-the cryptocurrency we send and receive via the Bitcoin network.
TX: Any place used in text-is an abbreviation for bitcoin transactions ‘Bitcoin transaction .
TXI
Figure 6-6.
Figure 6-6 The node synchronizes the block chain 6.7 Simple payment verification (SPV) nodes by reading chunks from the peer node
Not all nodes have the ability to store complete block chains. Many bitcoin clients are designed to run on space and power-constrained devices such as smartphones, tablets, and embedded systems. For such devices, the simplified payment validation (SPV) approach allows them to work without having to store a complete block chain. This type of client is call
Reputation Systems, and asset transactions can solve basic liquidity requirements for MST.
The process of embedding blockchain as a basic service into IT systems is called Baas (blockchain as a service). Baas is a fast and convenient way to build blockchain applications.
2. Technical Features
The utxo model continues and extends. All utxo provides good security for assets and identities.
The built-in bisc
TX (Transaction) a deal
Balance Balance
Utxo (unspent Transaction output) indicates that the outputs are not spent
With a realistic wallet for example, a wallet has a 10 yuan, a 5 yuan, a 1 yuan, a total of 16 yuan. The balance of an account in Bitcoin is also calculated on the basis of this account Utxo.
When spending 12 yuan to buy things, you can put 10 yuan and 5 yuan to take out, then get the cha
know is luck or strength, did not choose this international general curve algorithm, but oneself find another one. The public key then enters the hash to get the address. Addresses are the only personal information that is exposed when Bitcoin is traded, while the private key's two encryption methods are asymmetric encrypted, so there is no need to worry about any personal information being compromised.
Trading:
About trading, first we need to know the concept of a few bitcoin: Uxto:
It is also
judgment without downloading all the trades.
To check if it is correct so far:
$ blockchain_go createblockchain -address Ivan00000093450837f8b52b78c25f8163bb6137caf43ff4d9a01d1b731fa8ddcc8aDone!
Very good! We've got the first mining bonus, but how do we check the balance?
Non-spent trade output
We need to find all the unused trade outputs (unspent transactions outputs, UTXO). not spent (unspent) means that the output has not been included in the
data:Blocks. Describes the metadata for all the blocks on the chain.Chainstate. The state of the storage blockchain refers to all current Utxo (no transaction output is spent) and some meta data."In the Bitcoin world there are no accounts, no balances, only utxo that are scattered into the blockchain. ”See: The No. 06 chapter of the second edition of "Mastering Bitcoin"-input and output of transactionsIn a
data:Blocks. Describes the metadata for all the blocks on the chain.Chainstate. The state of the storage blockchain refers to all current Utxo (no transaction output is spent) and some meta data."In the Bitcoin world there are no accounts, no balances, only utxo that are scattered into the blockchain. ”See: The No. 06 chapter of the second edition of "Mastering Bitcoin"-input and output of transactionsIn a
trade in the blockchain prior to this block, as well as the index:
By trading Hash and index (starting from 0), you can uniquely determine an unused trade output--utxo (unspent Transaction output). in this way, each TX input is associated with a previous TX output.
We assume that in the last transaction, Bob paid Alice 0.15 BTC.
Since bitcoin does not have an account concept, the output of this transaction does not write Alice's name, nor does it wr
hash of a trade in the blockchain prior to this block, as well as the index: By trading Hash and index (starting from 0), you can uniquely determine an unused trade output--utxo (unspent Transaction output). In this way, each TX input is associated with a previous TX output. We assume that in the last transaction, Bob paid Alice 0.15 BTC. Since Ethereum was not developed with an account concept, the output of this transaction did not write Alice
.
2. Each person in the wallet finds the utxo containing the equivalent amount of bitcoin (such as 100mBTC) and creates a new public key of its own.
3. BC Hashes the UTXO information and public key to a (in this case, A is the organizer and is anonymous).
4. A constructs a transaction that takes all the utxo as input (a total of 300mBTC) and then evenly points th
transaction output Utxo
Let's create a transaction input class (Transactioninput)
public class Transactioninput {public String transactionoutputid;//point to Transaction output class-> TransactionID public transactionoutput Utxo; Contains all unused transaction output public transactioninput (String transactionoutputid) {this.transactionoutputid = Transactionoutputid;}}
Then add one more transaction output
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.