Bitcoin Forum
May 08, 2024, 05:38:10 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: These testnet outputs are not making sense to me. What's going on?  (Read 163 times)
hautch (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 2


View Profile
June 21, 2019, 03:15:30 AM
Merited by LoyceV (1), ABCbits (1)
 #1

Today I took some time to mess around with the bit Python library (https://github.com/ofek/bit), which I find pretty easy to use. I have been wanting to do some Bitcoin programming for a while, soo I decided to create a simple web wallet to test creating and broadcasting transactions. I'm obviously using testnet for this.

I initially used a testnet faucet to send two transactions to a main address, 0.0005 and 0.0001 tBTC to get started. I used my code to check for this address' balance and got 0.0006, cool. I then proceeded to used my newly developed web wallet to send two transactions to another address, both with a value of 0.00001 tBTC. I immediately noticed the balance from my main address was off, showing me 0.000028 tBTC which to me makes no sense, it should have been something close to 0.00058. I used blockcypher to check on those transactions (which are unconfirmed, but I believe this is irrelevant) to make sure my code was ok. Sure enough, 0.00001 tBTC was sent twice to the correct address, but the change sent back to the sender address is way off. What exactly happened here?

The transactions:
#1: https://live.blockcypher.com/btc-testnet/tx/91224995f2c240159141a499b91db8d26f0a6425fb12f5277d2f735576596aa7/
#2: https://live.blockcypher.com/btc-testnet/tx/92287c75721563643f8dbf9ee5fff59abe1c9b6b36a638daa05c35d5fea981d0/

Thanks in advance!
1715146690
Hero Member
*
Offline Offline

Posts: 1715146690

View Profile Personal Message (Offline)

Ignore
1715146690
Reply with quote  #2

1715146690
Report to moderator
If you see garbage posts (off-topic, trolling, spam, no point, etc.), use the "report to moderator" links. All reports are investigated, though you will rarely be contacted about your reports.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715146690
Hero Member
*
Offline Offline

Posts: 1715146690

View Profile Personal Message (Offline)

Ignore
1715146690
Reply with quote  #2

1715146690
Report to moderator
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10555



View Profile
June 21, 2019, 03:31:18 AM
Merited by bones261 (2), LoyceV (1), ABCbits (1)
 #2

i am going to write numbers in satoshi to make it easier:
you sent 10000 satoshi and 50000 satoshi to mxdnjqD875oeVGzc88z3vmpL6MmimdWAZr so your balance is 60000 satoshi.

then you sent tx #2 92287c75.... (which is the first transaction you sent) that is sending 1000 satoshi to mkRHp1qT3rXp4LukVAkD8ghWM1a1NX6m4r the "cost" of this transaction is the fee you must pay the miners and  the fee you paid is 20792 satoshi. so out of your 60k you are left with 38,208 satoshi. (60000-1000-20792)

then you create another tx#1 91224995f2... (the second transaction) and send 1000 satoshi to mkRHp1qT3rXp4LukVAkD8ghWM1a1NX6m4r this transaction fee is 34408 satoshi so you are left with (38208-1000-34408) 2,800 satoshi
hence the balance of 0.00002800 tBTC

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

Activity: 4
Merit: 2


View Profile
June 21, 2019, 07:58:54 PM
 #3

You're right. I didn't immediately see fee values in the tx explorer so I just assumed testnet transactions didn't have those. Thanks!
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!