News

What is the input and output of a Bitcoin transaction?

Advertisement

If ever from your personal wallet for someone Bitcoin BTC have sent, you may have noticed that the amount sent is more than the amount you wanted to send; You certainly want to know why this is happening. We will explain. Don’t worry, no money is lost.

Like most things with Bitcoin, this one starts with the blockchain. Blockchain is a giant public ledger that tracks all Bitcoin transactions. If you have bitcoins, you (and the public) can use the blockchain to find all transactions that have ever been made to your address. Transactions in which you have been the recipient are called “Input”. These entries are necessary to make payments.

Advertisement

Now suppose you go to a restaurant that accepts Bitcoin and you order some food there. When you want to pay for your order, instead of handing over cash to the cashier, you take their public key and refer them to your Bitcoin using that key. In this case, your Bitcoin is called “Output”.

In order for Bitcoin’s value to be divided and compounded, its transactions have multiple inputs and outputs. In a Bitcoin transaction, there is usually either an entry from a previous larger transaction or multiple entries that have smaller amounts and are combined together.

Bitcoin input and output in simple language

  • Blockchain stores all the transactions that have been made to your wallet so far. These incoming transactions are called “incoming”.
  • When you want to pay, you refer the recipient to your bitcoins, here called “withdrawals”.
  • You intend to send 2 bitcoins to the destination address in one transaction, but you only have 1 entry showing that you received 4 bitcoins.
  • Half of an entry cannot be deposited. So you send 4 bitcoins and get 2 bitcoins back as “remaining money”.

The above mechanism will be explained in detail:

In this mechanism, you confirm that all your transactions must add up to the number of bitcoins you need to make a purchase. This is the same output and consists of one or more previous inputs.

Once you use your entries to pay, your bitcoins are considered “spent”, which means you can’t use them to pay again. In fact, when you use the input to buy and your bitcoins are confirmed as output, it becomes the seller’s input. The seller can then use it to make a purchase.

When it comes to spending inputs, you can’t just spend a portion of it. Suppose you want to send 2 bitcoins to the user; But you only have one entry showing that you received 4 bitcoins. Just as you cannot cut a 10,000 Toman bill in half to pay 5,000 Tomans, it is not possible to spend only half of your input to pay 2 Bitcoins. So, as you give your 10,000 Tomans to the cashier and he gives you a 5,000 Tomans “remaining money”, you give your 4 Bitcoins to the blockchain and the Blockchain gives you 2 Bitcoins “remaining coins”.

This is why sometimes when making a transaction, the coins sent are more than the coins you sent. The extra coins will be sent back to your change address and you can have them in your wallet. Finally, everything is recorded in the ledger.

If you want to see how the inputs and outputs work, you can turn on the “advanced” mode on the blockchain. You will then be able to track inputs and find out which inputs are spent and which are not.

Types of Bitcoin transactions in terms of input and output

Each transaction in the Bitcoin blockchain has one or more inputs, and one or more outputs. Let’s take a look at the most common types of Bitcoin transactions.

Zero input – one output

A Coinbase transaction is the first transaction in each block and contains only one output (not to be confused with the Coinbase exchange). This happens only when a new coin is mined and the miner receives a reward. Since the input represents the receipt of a coin and the new coin is “mined” not “received”, the input is zero, and since the new coin is deposited to only one address (the miner’s wallet), we have only one output.

One input – two outputs

This is the most common type of Bitcoin transaction. In this type of transaction, when assets are transferred from one Bitcoin address to another, some “remaining coins” are returned to the original owner. The output of one address is the input of the next address. Therefore, this amount must be sent in full in the next transaction. If the value of this amount is more than what the sender wants to spend, a new transaction is created by the receiver and the difference is sent back to the sender’s address.

One input – multiple outputs

Usually, multiple outputs of a transaction can represent a payment by one person to many recipients. For example, when an organization wants to pay the salaries of its employees; Or even categorize outputs by mining pools and exchanges to save on transaction costs.

Multiple inputs – one or two outputs

A Bitcoin transaction can have multiple entries. This usually happens when a wallet generates multiple addresses and sends multiple small amounts to the recipient. These small amounts have already been received as “remaining coins”, so they are relatively small. In addition, the number of outputs may also depend on the number of receivers.

Source link

Adib

Adib Zahedi is the CEO and Founder of mazhd.com. He has nearly a decade of experience in IT, including two years spent working on a Youtube Chennal. He is also an author and writes articles for mazhd.com. Has articles include tutorials and covers everything from Windows PCs to smartphone's software.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button