Bitcoin Forum
March 29, 2024, 11:14:38 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Help me understand how to read the blockchain transaction history..  (Read 245 times)
gentleman2019 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 27


View Profile
December 17, 2019, 09:20:47 PM
Merited by LoyceV (2), o_e_l_e_o (1)
 #1

For an example transaction:
https://www.blockchain.com/btc/tx/71df79fe8f379134adf95d44bcf451391726bd5d211a26b7fa90be83585adb4c

Firstly, to confirm, is 'input' the sender/spender and 'output' the receiver of the bitcoins?

Is the link above ONE transaction, i.e. when a person pays x BTCs from his wallet to another wallet? If so, why are there multiple ins and outs?

Is the 'hash' (also in the URL) basically the 'transaction reference (or number)' so to speak?

Is the fee (0.00105 BTC in the example) always paid by and deducted from the sender?

Thanks in advance..
1711710878
Hero Member
*
Offline Offline

Posts: 1711710878

View Profile Personal Message (Offline)

Ignore
1711710878
Reply with quote  #2

1711710878
Report to moderator
1711710878
Hero Member
*
Offline Offline

Posts: 1711710878

View Profile Personal Message (Offline)

Ignore
1711710878
Reply with quote  #2

1711710878
Report to moderator
1711710878
Hero Member
*
Offline Offline

Posts: 1711710878

View Profile Personal Message (Offline)

Ignore
1711710878
Reply with quote  #2

1711710878
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1711710878
Hero Member
*
Offline Offline

Posts: 1711710878

View Profile Personal Message (Offline)

Ignore
1711710878
Reply with quote  #2

1711710878
Report to moderator
LoyceV
Legendary
*
Offline Offline

Activity: 3262
Merit: 16326


Thick-Skinned Gang Leader and Golden Feather 2021


View Profile WWW
December 17, 2019, 09:26:59 PM
 #2

Firstly, to confirm, is 'input' the sender/spender and 'output' the receiver of the bitcoins?
Correct.

Quote
Is the link above ONE transaction, i.e. when a person pays x BTCs from his wallet to another wallet?
Yes.

Quote
If so, why are there multiple ins and outs?
The sender uses Bitcoins from different addresses. Compare it to paying in cash: you give a $20, a $10 and a $1 bill.
One transaction can pay to more than one address. In this case, there are 2 outputs, so it's likely one of them is a change address owned by the sender. In dollar terms: think of it as getting a nickel back.

Quote
Is the 'hash' (also in the URL) basically the 'transaction reference (or number)' so to speak?
Yes.

Quote
Is the fee (0.00105 BTC in the example) always paid by and deducted from the sender?
Yes. Note that this fee was much higher than needed for this transaction.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
bitmover
Legendary
*
Offline Offline

Activity: 2254
Merit: 5837


bitcoindata.science


View Profile WWW
December 17, 2019, 09:31:30 PM
 #3

Quote
Is the fee (0.00105 BTC in the example) always paid by and deducted from the sender?
Yes. Note that this fee was much higher than needed for this transaction.

Transaction fee  is calculated by satoshi per byte (sat/byte). Fees are calculated by the size, in bytes, of the transaction.

That transaction spent 200 sat/byte, which is ridiculously high. What wallet are you using? Is it blockchain.com?

You can easily and somehow quickly confirm transactions with less than 30 sat/byte. If you are not in hurry (if you can wait 12- 36 hours) you can even send with 1-2 sat/byte

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
gentleman2019 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 27


View Profile
December 17, 2019, 09:55:53 PM
 #4

Thanks!


The sender uses Bitcoins from different addresses. Compare it to paying in cash: you give a $20, a $10 and a $1 bill.
One transaction can pay to more than one address. In this case, there are 2 outputs, so it's likely one of them is a change address owned by the sender. In dollar terms: think of it as getting a nickel back.


Didn't understand why this is the case. If the sender pays from different addresses, should the system not make each into a seperate transaction? What is the cut-off for deciding which sends are consolidated into one transaction?

gentleman2019 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 27


View Profile
December 17, 2019, 10:09:37 PM
 #5

Quote
Is the fee (0.00105 BTC in the example) always paid by and deducted from the sender?
Yes. Note that this fee was much higher than needed for this transaction.

Transaction fee  is calculated by satoshi per byte (sat/byte). Fees are calculated by the size, in bytes, of the transaction.

That transaction spent 200 sat/byte, which is ridiculously high. What wallet are you using? Is it blockchain.com?

You can easily and somehow quickly confirm transactions with less than 30 sat/byte. If you are not in hurry (if you can wait 12- 36 hours) you can even send with 1-2 sat/byte

So far only have a wallet on localbitcoins. The transaction I linked to was random, not mine.

I'm fascinated by the fact that we can set the fee. Suppose I set it to the minimum (or zero...?) is the transaction guarenteed to go through (with the delay)? Thanks.
khaled0111
Legendary
*
Offline Offline

Activity: 2478
Merit: 2807


Top Crypto Casino


View Profile WWW
December 17, 2019, 10:31:50 PM
 #6

I'm fascinated by the fact that we can set the fee. Suppose I set it to the minimum (or zero...?) is the transaction guarenteed to go through (with the delay)? Thanks.
Some web wallets doesn't allaw their customers to customize fees.
a transaction with zero fee will not be relayed. The minimum is 1 sat/b (1 sat/vB for segwit transactions).

Transaction confirmation time depends on how much fees you pay though. The higher the fees are, the faster your transaction get confirmed.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
hosseinimr93
Legendary
*
Offline Offline

Activity: 2352
Merit: 5117



View Profile
December 17, 2019, 10:33:14 PM
Last edit: December 17, 2019, 10:48:13 PM by hosseinimr93
 #7

Didn't understand why this is the case. If the sender pays from different addresses, should the system not make each into a seperate transaction? What is the cut-off for deciding which sends are consolidated into one transaction?
We can have several inputs and outputs in a single transaction.

Quote
I'm fascinated by the fact that we can set the fee. Suppose I set it to the minimum (or zero...?) is the transaction guarenteed to go through (with the delay)? Thanks.
The fee should be higher than zero, so the transaction is included in a block.
You can use the link below for the calculation of the required fee.
https://www.buybitcoinworldwide.com/fee-calculator/


By the way, making multiple posts in a row is against forum rules.
Please delete the last post you made and merge it into the previous one.
1. Edit the last post you made. 2. Copy the entire post into your clipboard. 3. Edit the previous post and paste your clipboard content. 4. delete your last post.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
bitmover
Legendary
*
Offline Offline

Activity: 2254
Merit: 5837


bitcoindata.science


View Profile WWW
December 18, 2019, 03:00:01 AM
 #8

I'm fascinated by the fact that we can set the fee. Suppose I set it to the minimum (or zero...?) is the transaction guarenteed to go through (with the delay)? Thanks.

The  minimum fee you can set is 1 sat/byte.
The total fee depends on the size of your transaction, which increases with the number of inputs and outputs (so the total fee vary)

Even 1 Sat/byte transactions are guaranteed to go through,  but you may have to wait a couple of days. Personally,  I see no problem in waiting a few hours or even 2days (never waited more than 36hours and i always use 1sat/byte.

One additional parameter which let you control the fee is the type of address.  If it is segwit  your transactions are smaller so they are cheaper. I recommend  you download electrum.org wallet for desktop or samurai wallet for android to get to know bitcoin a little more

Few years ago you could make 0sat /byte transactions,  but not anymore.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
nc50lc
Legendary
*
Offline Offline

Activity: 2366
Merit: 5429


Self-proclaimed Genius


View Profile
December 18, 2019, 03:58:53 AM
 #9

Didn't understand why this is the case. [1] If the sender pays from different addresses, should the system not make each into a seperate transaction? [2] What is the cut-off for deciding which sends are consolidated into one transaction?
Let me.
  • 1. It will be less efficient in terms of transaction fee and if that's how transactions are made, the number of unconfirmed tx in the network will grow exponentially.
  • 2. Your client (wallet) decides which input(s) (UTXO: visually, the addresses you see in the "input") to use.
    The commonly used method is: choose the one with the closest balance to the amount being sent, if one isn't enough, the wallet will use two or more.
    Some clients are choosing random UTXO(s) for privacy purposes.

..JAMBLER.io..Create Your Bitcoin Mixing
Business Now for   F R E E 
▄█████████████████████████████
█████████████████████████
████▀████████████████████
███▀█████▄█▀███▀▀▀██████
██▀█████▄█▄██████████████
██▄▄████▀▄▄▄▀▀▀▀▀▄▄██████
█████▄▄▄██████████▀▄████
█████▀▄█▄██████▀█▄█████
███████▀▄█▀█▄██▀█▄███████
█████████▄█▀▄█▀▄█████████
█████████████████████████
█████████████████████████
▀█████████████████████████████
█████████████████████████████████████████████████
.
      OUR      
PARTNERS

.
█████████████████████████████████████████████████
████▄
██
██
██
██
██
██
██
██
██
██
██
████▀
▄█████████████████████████████
████████▀▀█████▀▀████████
█████▀█████████████▀█████
████████████████████████
███████████████▄█████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████▀█████████
████████████████████████
█████▄█████████████▄█████
████████▄▄█████▄▄████████
▀█████████████████████████████
█████████████████████████████████████████████████
.
   INVEST   
BITCOIN

.
█████████████████████████████████████████████████
████▄
██
██
██
██
██
██
██
██
██
██
██
████▀
pooya87
Legendary
*
Offline Offline

Activity: 3402
Merit: 10435



View Profile
December 18, 2019, 04:47:34 AM
 #10

I'm fascinated by the fact that we can set the fee. Suppose I set it to the minimum (or zero...?) is the transaction guarenteed to go through (with the delay)? Thanks.

The  minimum fee you can set is 1 sat/byte.

please note that 1 satoshi/byte is the minimum fee that you can set when using a wallet, and minimum fee that 99% of the nodes and miners have set in their minrelayfee which means they would reject any less than that.
but at protocol level the actual minimum fee is zero which means sending the entire amount.

..JAMBLER.io..Create Your Bitcoin Mixing
Business Now for   F R E E 
▄█████████████████████████████
█████████████████████████
████▀████████████████████
███▀█████▄█▀███▀▀▀██████
██▀█████▄█▄██████████████
██▄▄████▀▄▄▄▀▀▀▀▀▄▄██████
█████▄▄▄██████████▀▄████
█████▀▄█▄██████▀█▄█████
███████▀▄█▀█▄██▀█▄███████
█████████▄█▀▄█▀▄█████████
█████████████████████████
█████████████████████████
▀█████████████████████████████
█████████████████████████████████████████████████
.
      OUR      
PARTNERS

.
█████████████████████████████████████████████████
████▄
██
██
██
██
██
██
██
██
██
██
██
████▀
▄█████████████████████████████
████████▀▀█████▀▀████████
█████▀█████████████▀█████
████████████████████████
███████████████▄█████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████▀█████████
████████████████████████
█████▄█████████████▄█████
████████▄▄█████▄▄████████
▀█████████████████████████████
█████████████████████████████████████████████████
.
   INVEST   
BITCOIN

.
█████████████████████████████████████████████████
████▄
██
██
██
██
██
██
██
██
██
██
██
████▀
gentleman2019 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 27


View Profile
December 18, 2019, 08:46:01 AM
 #11

Didn't understand why this is the case. [1] If the sender pays from different addresses, should the system not make each into a seperate transaction? [2] What is the cut-off for deciding which sends are consolidated into one transaction?
Let me.
  • 1. It will be less efficient in terms of transaction fee and if that's how transactions are made, the number of unconfirmed tx in the network will grow exponentially.
  • 2. Your client (wallet) decides which input(s) (UTXO: visually, the addresses you see in the "input") to use.
    The commonly used method is: choose the one with the closest balance to the amount being sent, if one isn't enough, the wallet will use two or more.
    Some clients are choosing random UTXO(s) for privacy purposes.


Thanks, its still a bit technical for me Smiley

Lets say I want to send 0.05 BTC from my Coinbase wallet to my friend who has a Bitpay wallet. Will this show up on the blockchain as one transaction with one input (my public address) and one output (friend's public address)?
nc50lc
Legendary
*
Offline Offline

Activity: 2366
Merit: 5429


Self-proclaimed Genius


View Profile
December 18, 2019, 10:56:53 AM
Merited by LoyceV (4)
 #12

Lets say I want to send 0.05 BTC from my Coinbase wallet to my friend who has a Bitpay wallet. Will this show up on the blockchain as one transaction with one input (my public address) and one output (friend's public address)?
That will probably come up as multiple inputs (from Coinbase's Hot wallet) and multiple outputs (to your friend and other users).
Because Coinbase isn't a wallet and they might process withdrawals in batch like other Exchanges do.

IDK if they implemented it already though, 'coz I stopped using their service years ago. (Their statement that mentioned batching: blog.coinbase.com)

..JAMBLER.io..Create Your Bitcoin Mixing
Business Now for   F R E E 
▄█████████████████████████████
█████████████████████████
████▀████████████████████
███▀█████▄█▀███▀▀▀██████
██▀█████▄█▄██████████████
██▄▄████▀▄▄▄▀▀▀▀▀▄▄██████
█████▄▄▄██████████▀▄████
█████▀▄█▄██████▀█▄█████
███████▀▄█▀█▄██▀█▄███████
█████████▄█▀▄█▀▄█████████
█████████████████████████
█████████████████████████
▀█████████████████████████████
█████████████████████████████████████████████████
.
      OUR      
PARTNERS

.
█████████████████████████████████████████████████
████▄
██
██
██
██
██
██
██
██
██
██
██
████▀
▄█████████████████████████████
████████▀▀█████▀▀████████
█████▀█████████████▀█████
████████████████████████
███████████████▄█████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████▀█████████
████████████████████████
█████▄█████████████▄█████
████████▄▄█████▄▄████████
▀█████████████████████████████
█████████████████████████████████████████████████
.
   INVEST   
BITCOIN

.
█████████████████████████████████████████████████
████▄
██
██
██
██
██
██
██
██
██
██
██
████▀
RapTarX
Hero Member
*****
Offline Offline

Activity: 1358
Merit: 850



View Profile
December 18, 2019, 12:23:54 PM
 #13

Will this show up on the blockchain as one transaction with one input (my public address) and one output (friend's public address)?
If you send through coinbase, your public address will not be visible; coinbase don't hold your fund in your public address. For instance; you have received fund in one of your coinbase address- the fund will not be in your address, it will be held by coinbase cold wallet. You may check it through one of your address when you receive fund through coinbase.
So, your friend's public address will be seen & the address coinbase used to send the fund will be seen in blockchain.

Because Coinbase isn't a wallet and they might process withdrawals in batch like other Exchanges do.

IDK if they implemented it already though, 'coz I stopped using their service years ago. (Their statement that mentioned batching: blog.coinbase.com)
You are right, they still send fund through a batch.

bitmover
Legendary
*
Offline Offline

Activity: 2254
Merit: 5837


bitcoindata.science


View Profile WWW
December 18, 2019, 12:27:01 PM
 #14

Thanks, its still a bit technical for me Smiley

Lets say I want to send 0.05 BTC from my Coinbase wallet to my friend who has a Bitpay wallet. Will this show up on the blockchain as one transaction with one input (my public address) and one output (friend's public address)?

You will have a better understanding if you stop using coinbase and move your funds to a real wallet.

For now you don't have access to your inputs, private keys, etc. All of that is done by your custodial service (coinbase) and you are paying them to do that (paying high fees for example).

Use the wallets I recommended (electrum or samourai) and everything will be much clear to you

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3346
Merit: 4505



View Profile
December 18, 2019, 03:44:21 PM
Merited by LoyceV (4), bitmover (2), hosseinimr93 (1), o_e_l_e_o (1), DdmrDdmr (1)
 #15

Thanks, its still a bit technical for me Smiley

Lets say I want to send 0.05 BTC from my Coinbase wallet to my friend who has a Bitpay wallet. Will this show up on the blockchain as one transaction with one input (my public address) and one output (friend's public address)?

The following analogy is not perfect, but it will get you started down a path of understanding.  There are a few more details to understand beyond the scope of the analogy, so don't get too caught up in the specifics...

Think of your bitcoin wallet as an actual physical wallet.  When someone pays you, think of that as them handing you a physical bill that you put into your physical wallet.

So, Alice pays you a $5 bill.  Then, Bob pays you a $10 bill. Then Carl pays you a $5 bill.

All together, you've received a total of $20, but what do you actually now have in your wallet?  Do you have a single $20 bill?  Or do you have a single $10 bill and two $5 bills?

Now, lets say you want to pay David $14?  You have to pull out two separate bills (the $10 and a $5). That's two inputs into your transaction to David, however, David gives you $1 back for your wallet.

The way Bitcoin works is similar to this (except the recipient doesn't send the change back, instead the sender creates the change when they create the transaction).

Every time you receive a payment (regardless of whether it is to the same address or a different address) the transaction paying you creates a new separate output that represents that payment.
Then when you want to make a payment, you need to choose from all the previous outputs that you received.  You need to choose enough of these separate outputs so that the sum of their value is at least the amount that you are trying to pay.  Each output that you choose gets listed as an input in the transaction that you are creating.  Then if the sum of all those inputs happens to be more than the amount you are trying to send, the transaction needs to create two new outputs, one for the value of the payment that you are sending, and another for the extra so that it can be added back to your wallet.

Note that it is possible to create a single transaction that pays multiple people.  So, if I want to pay Alice 0.1 BTC, and I want to pay Bob 0.2 BTC, and I want to pay Carl 0.3 BTC, and I have two outputs in my wallet each worth 0.5BTC, then I can create and send a transaction that has two inputs each valued at 0.5 BTC (for a total input value of 1 BTC), and has FOUR outputs (one for each person I'm paying plus an additional output worth 0.4 BTC back into my own wallet).
gentleman2019 (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 27


View Profile
December 18, 2019, 06:40:52 PM
 #16

Thanks for the excellent explanation @DannyHamilton! If I understood it right, multiple inputs are due to the history of those particular bitcoins - they could be paid from 1 large source or consolidated from multiple smaller sources, presumably going all the way back to when they were created.

Are remaining BTC always sent to a new address after a transaction? i.e. the address always changes after every spend?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3346
Merit: 4505



View Profile
December 18, 2019, 08:21:56 PM
 #17

Thanks for the excellent explanation @DannyHamilton! If I understood it right, multiple inputs are due to the history of those particular bitcoins - they could be paid from 1 large source or consolidated from multiple smaller sources, presumably going all the way back to when they were created.

Are remaining BTC always sent to a new address after a transaction? i.e. the address always changes after every spend?

It is a best practice to always use a new address for every transaction.  However, there is no requirement to do so.  Therefore, there have been some wallets that the developers have chosen to send the remaining BTC back to the same address every time. I prefer NOT to use wallets that make such a lazy decision.
genesis2020
Newbie
*
Offline Offline

Activity: 6
Merit: 4


View Profile
December 19, 2019, 02:58:07 PM
 #18

Thanks, its still a bit technical for me Smiley

Lets say I want to send 0.05 BTC from my Coinbase wallet to my friend who has a Bitpay wallet. Will this show up on the blockchain as one transaction with one input (my public address) and one output (friend's public address)?

The following analogy is not perfect, but it will get you started down a path of understanding.  There are a few more details to understand beyond the scope of the analogy, so don't get too caught up in the specifics...

Think of your bitcoin wallet as an actual physical wallet.  When someone pays you, think of that as them handing you a physical bill that you put into your physical wallet.

So, Alice pays you a $5 bill.  Then, Bob pays you a $10 bill. Then Carl pays you a $5 bill.

All together, you've received a total of $20, but what do you actually now have in your wallet?  Do you have a single $20 bill?  Or do you have a single $10 bill and two $5 bills?

Now, lets say you want to pay David $14?  You have to pull out two separate bills (the $10 and a $5). That's two inputs into your transaction to David, however, David gives you $1 back for your wallet.

The way Bitcoin works is similar to this (except the recipient doesn't send the change back, instead the sender creates the change when they create the transaction).

Every time you receive a payment (regardless of whether it is to the same address or a different address) the transaction paying you creates a new separate output that represents that payment.
Then when you want to make a payment, you need to choose from all the previous outputs that you received.  You need to choose enough of these separate outputs so that the sum of their value is at least the amount that you are trying to pay.  Each output that you choose gets listed as an input in the transaction that you are creating.  Then if the sum of all those inputs happens to be more than the amount you are trying to send, the transaction needs to create two new outputs, one for the value of the payment that you are sending, and another for the extra so that it can be added back to your wallet.

Note that it is possible to create a single transaction that pays multiple people.  So, if I want to pay Alice 0.1 BTC, and I want to pay Bob 0.2 BTC, and I want to pay Carl 0.3 BTC, and I have two outputs in my wallet each worth 0.5BTC, then I can create and send a transaction that has two inputs each valued at 0.5 BTC (for a total input value of 1 BTC), and has FOUR outputs (one for each person I'm paying plus an additional output worth 0.4 BTC back into my own wallet).

I cant merit as I'm too new I think, but just wanted to say thanks for the excellent explanation.
bitmover
Legendary
*
Offline Offline

Activity: 2254
Merit: 5837


bitcoindata.science


View Profile WWW
December 19, 2019, 10:11:39 PM
 #19

Are remaining BTC always sent to a new address after a transaction? i.e. the address always changes after every spend?

It is a best practice to always use a new address for every transaction.  However, there is no requirement to do so.  Therefore, there have been some wallets that the developers have chosen to send the remaining BTC back to the same address every time. I prefer NOT to use wallets that make such a lazy decision.

Additionally to the excellent explanation provided by DannyHamilton.

Using the same address doesn't consolidate your inputs. If you use a wallet which sends the change back to the original address you will have multiple inputs from the same address.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!