Bitcoin Forum
May 01, 2024, 05:36:11 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: BTC tx outputs. I am trying to understand  (Read 125 times)
Unsaint32 (OP)
Newbie
*
Offline Offline

Activity: 29
Merit: 7


View Profile
June 09, 2021, 01:31:39 AM
Merited by bitmover (1)
 #1

In one bitcoin transaction showing 2 outputs with different addresses, how do I know the wallet address of the recipient?  I guess I don't understand what the 2 addresses of the 2 outputs.  The 2 addresses are 2 public addresses of the wallet?  That doesn't make sense because the 2 addresses have different btc amounts. 
The forum strives to allow free discussion of any ideas. All policies are built around this principle. This doesn't mean you can post garbage, though: posts should actually contain ideas, and these ideas should be argued reasonably.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714541771
Hero Member
*
Offline Offline

Posts: 1714541771

View Profile Personal Message (Offline)

Ignore
1714541771
Reply with quote  #2

1714541771
Report to moderator
1714541771
Hero Member
*
Offline Offline

Posts: 1714541771

View Profile Personal Message (Offline)

Ignore
1714541771
Reply with quote  #2

1714541771
Report to moderator
DannyHamilton
Legendary
*
Offline Offline

Activity: 3374
Merit: 4612



View Profile
June 09, 2021, 01:36:06 AM
Merited by hugeblack (2), ABCbits (1), bitmover (1)
 #2

In one bitcoin transaction showing 2 outputs with different addresses, how do I know the wallet address of the recipient?  I guess I don't understand what the 2 addresses of the 2 outputs.  The 2 addresses are 2 public addresses of the wallet?  That doesn't make sense because the 2 addresses have different btc amounts. 

If you sent the transaction, then you know which address you sent to.  The other address is an address in your own wallet that the change is sent back to.

If you did not send the transaction, then it is difficult to know for certain what each address is.  It's possible that thee sender sent a single transaction and paid 2 different people at the same time. It's possible that the sender sent bitcoins only to themselves moving bitcoins between wallets.  It's also possible that they sent a transaction to a single other person and that the change from the transaction was sent back to a new address in their own wallet.

Sometimes, depending on the amounts available, and the values of the outputs, it might be possible to make an educated guess as to what happened.  Sometimes that educated guess will be right, but it's always possible that the guess is wrong.
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10519



View Profile
June 09, 2021, 03:07:55 AM
Merited by bitmover (1)
 #3

Sometimes, depending on the amounts available, and the values of the outputs, it might be possible to make an educated guess as to what happened.
Considering almost all wallets are deterministic and most of them produce same address type, the address/script types involved in inputs and outputs also help with the guess.
If the input is coming from the same address type as the output that we guessed is the change while the other output(s) are of different type there chance of our guess being correct is higher.
P2WPKH ┌── P2PKH (different type, higher possibility of being someone else)
       └── P2WPKH (same type, higher possibility of being from same wallet)

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

Activity: 2282
Merit: 5914


bitcoindata.science


View Profile WWW
June 09, 2021, 04:37:37 PM
 #4

In one bitcoin transaction showing 2 outputs with different addresses, how do I know the wallet address of the recipient?  I guess I don't understand what the 2 addresses of the 2 outputs.  The 2 addresses are 2 public addresses of the wallet?  That doesn't make sense because the 2 addresses have different btc amounts. 

You cannot really split coins.

Let's supposed you received 1 btc from an exchange in one transaction.

If you want to send 0.1 btc to a friend you cannot split your previous 1 btc.
You will sent 1 btc, and 0.1 will be send to your friend and 0.9 btc will come back to you as a chance  usually in another address.

This is the most common type of transaction  and this is probably the case you mentioned.

As DannyHamilton mentioned, you cannot really know for sure which is the change address , but you can try to guess. For example, usually change addresses have 8 fractional digits,  while the receiver is a round number.

For example , in the above case the receiver would be 0.1 and the change would be 0.8998373 (mining fees discounted)

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ARTURVHt
Jr. Member
*
Offline Offline

Activity: 54
Merit: 1


View Profile
June 10, 2021, 06:22:58 AM
 #5

Simply put, a bitcoin transaction is the transfer of bitcoins from one address to another address. Different bitcoin addresses represent different bitcoin owners. Therefore, a bitcoin transaction means that the owner of bitcoin authorizes the transfer of bitcoin to a new address. The owner. Of course, the new Bitcoin owner can also authorize the transfer of Bitcoin to another owner, and so on, forming a chain of Bitcoin owners.
NeuroticFish
Legendary
*
Offline Offline

Activity: 3654
Merit: 6371


Looking for campaign manager? Contact icopress!


View Profile
June 10, 2021, 10:50:37 AM
 #6

In one bitcoin transaction showing 2 outputs with different addresses, how do I know the wallet address of the recipient?  I guess I don't understand what the 2 addresses of the 2 outputs.  The 2 addresses are 2 public addresses of the wallet?  That doesn't make sense because the 2 addresses have different btc amounts. 

If there are 2 outputs, then there are 2 recipients. As simple as that and basically that's all you know.
The fact that in reality there's a high chance that one of the recipients is the same or a different address in the sender's wallet, it's only a (rather small) detail.
If you know/expect that one of the addresses is the change address, then you can look for various other small details that can provide extra info:

* if one "recipient" address starts with the same character as the sender and the other doesn't, there's a good chance that the similar address is change address

* if one address received some pretty "round" amount (in BTC, or USD, or EUR, ..) then the other one may be the change address; also because many wallets don't do fee rounding, the recipient that got coins with more number of characters after the decimal point is probably the change wallet (because of the tx fee)


All these are assumptions based on common use, but most of the times they don't really give a 100% certainty.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
BlackFor3st
Hero Member
*****
Offline Offline

Activity: 1932
Merit: 506


Betking.io - Best Bitcoin Casino


View Profile
June 10, 2021, 12:00:53 PM
 #7

In one bitcoin transaction showing 2 outputs with different addresses, how do I know the wallet address of the recipient?  I guess I don't understand what the 2 addresses of the 2 outputs.  The 2 addresses are 2 public addresses of the wallet?  That doesn't make sense because the 2 addresses have different btc amounts. 

I'm not quite sure about this but I think I have the same questions before and found out the other address was my own wallet in other words that address was your exchange address. Just for example you have 1 Bitcoin and you only need to send 0.5 Bitcoins the 0.5 Bitcoin will send to your target address and the 0.5 will be sent back to you, I'm not just sure why it works like that.

nc50lc
Legendary
*
Offline Offline

Activity: 2394
Merit: 5571


Self-proclaimed Genius


View Profile
June 11, 2021, 04:02:07 AM
 #8

-snip-
I'm not quite sure about this but I think I have the same questions before and found out the other address was my own wallet in other words that address was your exchange address. Just for example you have 1 Bitcoin and you only need to send 0.5 Bitcoins the 0.5 Bitcoin will send to your target address and the 0.5 will be sent back to you, I'm not just sure why it works like that.
You almost got the name, it was "Change Address" not "Exchange Address"  Wink

It works like that because an "unspent transaction output" (UTXO) needs to be spent whole, a part of its value can't just be deducted.
Once a UTXO was spent, it can't be used again, that's why the excess amount should be a new UTXO (the change) or it will be considered as transaction fee.
Read this: https://en.bitcoin.it/wiki/Transaction#Output

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
khaled0111
Legendary
*
Offline Offline

Activity: 2506
Merit: 2840


Top Crypto Casino


View Profile WWW
June 11, 2021, 07:51:11 PM
 #9

...
Exactly! Bitcoin uses the UTXOs model. Each transaction consists of Inputs and Outputs and an Inputs is basically the output of a previous transaction.
The balance of an address is the sum of all its UTXOs (unspent transaction outputs) or simply the outputs it received from previous transactions but didn't spent them yet.
Now, if you want to create a transaction, you will use as much as needed of UTXOs to cover the spent amount and network fees. However you should know that an unspent transaction output has to be spent in full. So, if the value of the used inputs is bigger than the amount you want to spend (plus fees), the difference will be sent to one of your wallet addresses as an extra output.
Almost all bitcoin wallets do this automatically, though.

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


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Shymaa-Arafat
Full Member
***
Offline Offline

Activity: 228
Merit: 156


View Profile
June 14, 2021, 08:21:03 AM
 #10

Quote
Sometimes, depending on the amounts available, and the values of the outputs, it might be possible to make an educated guess as to what happened.  Sometimes that educated guess will be right, but it's always possible that the guess is wrong.

Quote
P2WPKH ┌── P2PKH (different type, higher possibility of being someone else)
       └── P2WPKH (same type, higher possibility of being from same wallet)

What u both say here is almost what I mean we should consider when building the UTXOs Merkle Tree or whatever data structure used.
We should make an educated guess of how long this UTXO is going to stay & maybe also put it near others likely to be spent in the same transaction.
More here on previous results showing that UTXOs maybe divided to 2-3 groups according to their lifespan, we could add ur ideas here, and also guessing/identifying burned UTXOs as they will probably live forever in the system
https://mobile.twitter.com/ArafatShymaa/status/1403246321956438017
.
This should not be hard to do, only a few if statements added to the code (after accurate analysis of all TXs kinds not just a few like I did in coinbase, accumulating rewards, distributing rewards; and what u added here gratefully enriching the idea a lot).
.
-After these few "ifs" one could think of many ways the code could branch in..
  • -Two trees/forests one for long-living one for fast spending
  • -Weighted tree with less weights assigned to those staying for long (to give shorter paths for the fast spent ones)
....
[/list]
More thoughts in here
https://mobile.twitter.com/ArafatShymaa/status/1402465971147841537
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!