A complete process for bitcoin transactions

Source: Internet
Author: User

This article explains the contents, purposes and results of Bitcoin transactions. The explanations below apply to novice and intermediate Bitcoin users.

As an encrypted currency user, you need to be familiar with the rudiments of trading-for your confidence in this evolving innovation, and as a basis for understanding emerging multi-signature transactions and contracts, both of which will be explored later in this series. This is not a purely technical article, and the explanation will focus on the standard Bitcoin transactions that you need to know--what we usually do with spending--and we'll cover up what you can safely ignore.

The infographic at the bottom of this article provides a comprehensive description of the entire Bitcoin trading process from wallet to blockchain.

Note: Even core developers admit that some of the languages used to describe transactions and their components can cause people to misunderstand what actually happened. These misunderstandings are avoided in the 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 .
    • TXID: is transaction id the abbreviation--this is the hash of the person and the Protocol reference transaction.
    • Script: Is the name of the Bitcoin Protocol's scripting system, used to process and validate transactions--The script is a smart, stack-based instruction engine that makes it possible to make all transactions from simple payments to complex Oracle supervisory contracts.
    • UTXO: Unspent Transaction Output The abbreviation, also known as "output".
    • Satoshi:1 BTC = 100,000,000 Satoshi
What is Bitcoin trading? Why?

1. Definition

A bitcoin transaction is a signed data that is broadcast to the network and, if it works, eventually into a chunk of the blockchain.

2. Purpose

The purpose of Bitcoin transactions is to transfer the ownership of a certain amount of bitcoin to the bitcoin address.

3. Results

When you send Bitcoins, your wallet client creates a single data structure, bitcoin transactions, and then broadcasts to the network. The bitcoin node on the network will relay and re-broadcast the transaction, and if the transaction is valid, the node will include it in the block they are digging. Typically, within 10-20 minutes, the transaction will be included with other transactions in one chunk of the blockchain. At this point the recipient can see the amount of the transaction in their wallet.

4. Example

The following are examples of transactions that were included in the blockchain earlier this year:

The main components of this standard transaction are color coded:

    • Transaction ID (highlighted in XXX)
    • Describe and metacharacters data (blue curly braces are detailed on the right)
    • Input (pink area)
    • Output (green area)
Bitcoin trading inputs and outputs

First, there are four axioms about trading:

    • Any Bitcoin amount we send is always sent to an address.
    • Any Bitcoin amount we receive is locked in the receiving address-this is usually associated with our wallet.
    • Whenever we spend Bitcoins, the amount we spend will always come from the money we received before and currently in our wallets.
    • Addresses receive bitcoins, but they do not send bitcoins-Bitcoin is sent from the wallet.

The amount of money entering our purse is not as confusing as the coin in the physical purse. The amount received is not mixed, but remains independent and differs from the exact amount received by the wallet. This is an example:

Example:

You create a brand new wallet and receive three 0.01,0.2 and 3BTC of money in a timely manner, as follows: You send 3BTC to the address associated with the wallet, and the payment is made to another address by Alice.

The wallet report has a balance of 3.21BTC, but if you really look inside the wallet, you'll see-not 321,000,000 Satoshi (321 Mil Satoshi), but three different numbers are still combined by their original trade: 0.01,0.2 and 3BTC.

The received Bitcoin amount is not mixed, but remains separate as the exact amount sent to the wallet. The three amount in the previous example is called the output of its original transaction.

Bitcoin wallets always keep the output separate and unique.

The output output is the amount that is sent to the Bitcoin address (through a standard transaction), and a set of rules that unlock the output amount. In bitcoin terminology, the output is called "unused trade output" or UTXO .

The standard trade output can be unlocked using the private key associated with the receive address. The address and its associated public/private key pair will be described later in this series. At the moment, we are only focusing on totals.

Example:

Let's consider an example of tracking money in case you send Bob 0.15BTC.

As we can see, your wallet does not have a choice of 15mil Miloshi (0.15 BTC) from an undifferentiated 321 mil Satoshi to form a wallet balance. Instead, the wallet outputs chooses an expense candidate from the three existing outputs contained in the wallet. Therefore, it chooses (for various reasons, now unimportant) the 0.2BTC output. The wallet will unlock the 0.2 BTC output and use all 0.2BTC as input to the new 0.15 BTC transaction input . The 0.2BTC output is spent in this process spent .

The expense transaction created by your wallet will be sent to Bob's address 0.15btc--it will be stored as output in his wallet-waiting for the final cost.

The 0.05BTC difference (0.2 btc input minus 0.15 BTC output) is called a change change and the trade will send it back to your wallet via the newly created address. The amount of 0.05 BTC changes will be stored in your wallet as a new output-waiting for the final cost. So, now you'll see the following in your wallet:

Each of the three output "waiting to be spent" is locked to its receive address until one or more of them is selected as input to the newly spent transaction.

In the background, different UTXO wallet clients apply different logic rules when choosing to enter as a new transaction. A sensible purse strategy is to use the old one as much as possible UTXO , but in a different way. We are not paying attention UTXO to the way we choose, because our goal has always been to emphasize that the amount of money that our wallets receive is separate and different.

Summary of how Bitcoin transactions are done

The amounts received will not be mixed in the same way as in the physical purse. Conversely, when we spend Bitcoins, the amount received (UTXO) is used alone (or combined). When creating an expense transaction, our wallet chooses utxo (with enough value to satisfy the amount we want to send) and typically creates two new outputs: one for the receiver and one for the changes we received to the wallet. Change to a brand new utxo in our wallet, the amount we send is the utxo--that is locked to the recipient's address may or may not be associated with the wallet, such as cold storage. The original Utxo used as input for the expense transaction will be "spent" and permanently destroyed.

This is an introduction to how the wallet software handles the output (UTXO). Once the Utxo is selected for expense, it needs the private key associated with the address that receives it. This private key is redeemed for Utxo and allows it to be entered in the new expense transaction. The mechanism of the previous transaction output being re-used as the input to the new transaction is at the heart of the Bitcoin protocol function-fully compliant with the Satoshi design.

We recommend that you browse our blockchain tutorials and blockchain technology blogs in the various programming languages of our network to gain insight into blockchain, bitcoin, crypto currency, Ethereum, and smart contracts.

  • Java Bitcoin Development tutorial, this course is for beginners, which covers core concepts of bitcoin, such as blockchain storage, de-centric consensus mechanism, key and script, trading and Utxo, and also details how to integrate bitcoin support functions in Java code, such as creating addresses, managing wallets, The construction of bare trade, etc., is a rare development of Java Engineers Learning course.
  • PHP Bitcoin Development tutorial, this course for beginners, the content is to cover the core concepts of Bitcoin, such as blockchain storage, de-centralized consensus mechanism, key and script, transaction and Utxo, but also detailed how to integrate the Bitcoin support functions in PHP code, such as creating addresses, managing wallets, structuring bare transactions, etc. is a rare bitcoin development learning course for PHP engineers.
  • PHP Ethereum, mainly introduces the use of PHP for intelligent Contract Development interaction, account creation, transaction, transfer, coin development and filter and trading and other content.
  • Java ethereum Development tutorial, mainly for Java and Android programmer for the blockchain development of WEB3J detailed.
  • Ethereum Introductory tutorial, mainly introduces the intelligent contract and DAPP application development, suitable for getting started.
  • Ethereum Development Advanced Tutorial, mainly introduces the use of node. js, MongoDB, Blockchain, IPFs to achieve a central e-commerce Dapp actual combat, suitable for advanced.
  • Python ethereum, mainly for Python engineers using web3.py for blockchain development.
  • C # Ethereum, which mainly explains how to use C # development based on. NET Ethereum applications, including account management, status and transaction, intelligent contract development and interaction, filters and transactions.
  • The EOS Introductory tutorial, this course helps you get started with the development of the EOS blockchain-centric application, covering the EOS toolchain, account and wallet, issuing tokens, smart contract development and deployment, the use of code and interaction with the smart contract, and finally the development of a note dapp with a combination of knowledge points.

Hui Zhi Network original translation, reproduced please indicate the source. This is the original.

A complete process for bitcoin transactions

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.