What is the change mechanism for blockchain development underlying trading virtual currency?

Source: Internet
Author: User

Blockchain Enthusiast (qq:53016353)

The change mechanism of the cottage currency has been a bit confusing, obviously only to one address sent the cottage currency why blockchain above the display is sometimes 1 addresses to multiple addresses, sometimes multiple addresses to 1 addresses, and sometimes display multiple addresses to multiple addresses.

Why the Shanzhai senior users to remind you that when the cottage coin wallet trading more than 100 times to re-back the wallet after the transaction, restore the previous wallet backup may suffer losses.


Yes, it's all because of the change mechanism of the cottage currency, explaining how the change mechanism of the cottage currency works in detail for you.


The rules of the trading of Shanzhai coins: The output amount of the previous transaction on the address of a number of shanzhai remittance addresses that the user is entitled to use as the input of a single transaction, and the amount of the transaction added on the address of a number of shanzhai coins as the output of this transaction. The input amount must be greater than or equal to the output amount, which is exceeded as the transaction fee. The fee does not have an output address and is awarded to miners who have successfully accounted for the transaction.


Because sometimes the amount that is output exceeds the amount that the user wants to pay. In this case, the Shanzhai client will create a new cottage currency address and send the difference back to this address, which is the change mechanism of the cottage currency.


For example, if you want to buy a dollar lollipop from the store, you open your purse and find that there is only a RMB 20 yuan in it. What is the minimum amount you can pay? Of course not 1 dollars, you can not take this 20 yuan money to tear off 20 1 and then hand over to the salesperson. You have to give the cashier the 20 yuan, and then because you only have to pay 1 yuan, the cashier will find you 19 yuan.


In addition to the central bank, the law prohibits anyone from issuing renminbi, so the renminbi is a fixed denomination. The process of this transaction looks like this:


Input:


RMB 20


Output:


1 dollars to the cashier.


10 bucks for you.


5 bucks for you.


1 bucks for you.


1 bucks for you.


1 bucks for you.


1 bucks for you.


Because we do this every day with a single hand to pay for the delivery of the transaction, so the above process seems to have become a legitimate thing. Let's break the inertia of the mind and see what happens.


Now let's imagine a scenario where there is a system that allows the cashier (or anyone else) to effectively destroy any number of real currencies (renminbi) and allow the cashier to print out any amount of real money as an alternative. Not necessarily 10 yuan denomination or 20 yuan denomination, if necessary, such as printing out 18.94537208 yuan denomination of RMB.


At the same time, in order to prevent double payments and counterfeiting, it is important to ensure that at any time the newly created currency amount is exactly the same as the amount of the currency being destroyed. In this case, your transaction may look like this:


Input:


Your 20 yuan has been destroyed


Output:


The new issue of 1 dollars to the cashier


19 Dollars for your new issue.


This is the operation mechanism of the cottage currency. Unlike fiat currencies, we are accustomed to calling this approach the input and output of a trading unit.


When you "pay" the cottage currency and create a transaction, you must enter the amount of money you pay at the address (the output from the previous transaction) as the input to the new transaction. There may be more than one address, and your cottage wallet will secretly look for all the available output in your wallet (possibly from different addresses) and add them together to show the wallet's available balance.


So, when your cottage coin wallet says you have 130 BTC, it just means that all your addresses are available to pay for the trade output plus a total of 130 BTC. This and your ordinary wallet with 1 sheets of 100 yuan and 3 yuan 10 yuan almost one meaning.






Let's look at the figure above to show the deal: 0a1c0b1ec0ac55a45b1555202daf2e08419648096f5bcc4267898d420dffef87, the Shanzhai client will have the output of a previous trade that exists on the 19f address: 10.89 The BTC is paid out and the actual transaction amount is paid to 1KM for this address, and the 0.89 BTC is returned to the 1HP address as a change.


Like a person can not only spend 20 yuan in the same as 1 yuan, the cottage currency client can not only pay the 10.89 BTC in the other side of the ten BTC.


The last trade output amount of the 10.89 BTC will be all as the input amount for the new transaction, and in this process there are two new available output amounts, the BTC to 1km,0.89 BTC to 1HP, and two output amounts together just equal to 10.89 BTC.


The 19f address above the 10.89 BTC that is available for payment of the output amount will be completely destroyed after this transaction is completed and the entire Shanzhai network will prevent it from being paid again.


The two newly-created payments can now be entered into the next trade.


In this transaction, the transaction fee is 0. If the transaction fee is paid, the input and output will have a difference. (For example, enter 10.89 BTC, output 10.88 BTC, transaction fee = 0.01 BTC)


The Cottage coin Wallet file contains all the change address of the private key, they can normally receive or send the cottage currency. However, the official client interface does not show the change address in the Address book, perhaps for the sake of anonymity, perhaps to reduce customer confusion, although this also caused many people new doubts.


Because the Shanzhai client initially produces only 100 private keys (called private-key pools) of the client-only address, one of these 100 addresses is preferred when the change address is created, but when these addresses are used, the new change address is created outside of 100. If you only back up the wallet at the beginning of the 100 address, then in this case the recovery wallet will lose the new change address.


In short, after a detailed understanding of the change mechanism of the cottage currency, you can correctly answer the questions raised at the beginning of this article, let us step by step to become the experts of the cottage coin.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.