Bitcoin Forum
May 20, 2019, 08:13:50 AM *
News: Latest Bitcoin Core release: 0.18.0 [Torrent] (New!)
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Understanding transactions (testnet)  (Read 96 times)
yocal
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
February 07, 2018, 08:15:48 AM
 #1

I'm writing a blockchain explorer tool and trying to understand what's going on with this transaction:

 - https://testnet.blockchain.info/tx/efdf1b981d7bba9c941295c0dfc654c4b5e40d7b9744819dd4f78b8e149898e1

It has a lot of inputs, and one of them are this:

 - https://testnet.blockchain.info/tx/db21b413421bca55d87c44e17f0a79369e73e3b53e1fcb9d11c6beb9491087e1

Looking at it in a neo4j graph database could look something like this:

https://i.imgur.com/vrt8Qol.png

Can anyone tell me what's going on?

Thanks in advance!

// Yoc.
1558340030
Hero Member
*
Offline Offline

Posts: 1558340030

View Profile Personal Message (Offline)

Ignore
1558340030
Reply with quote  #2

1558340030
Report to moderator
Crypto Casino Since 2014
Level Up & Get Even More Rewards!
Daily Treasure Chest
& Much More
Roll Hunt
Rakeback
Blackjack
Jackpot
Dice
Slots
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
pebwindkraft
Sr. Member
****
Offline Offline

Activity: 259
Merit: 251


View Profile
February 07, 2018, 10:22:42 AM
Merited by achow101 (1), LFC_Bitcoin (1), HeRetiK (1), Xynerise (1)
 #2

Here is what's going on:

Code:
VERSION 01000000
 
TX_IN COUNT [var_int]: hex=01, decimal=1
 TX_IN[0]
  TX_IN[0] OutPoint hash (char[32])  141C97B3217E4642BE92D616BB8821E85EC1EC40C6D7154AA231B6804D0B8FB8
  TX_IN[0] OutPoint index (uint32_t)  hex=00000000, reversed=00000000, decimal=0
  TX_IN[0] Script Length (var_int)      hex=48, decimal=72
  TX_IN[0] Script Sig (uchar[]) 47304402204A56F7B2AFE3739D9A8651B49B1E48E9ED6B06676531DFED482FB741B4D5711E0220267681828247A929CF7353D592D8E307092828AFDF423620C2B3F43D488AF41701
  TX_IN[0] Sequence (uint32_t)         FFFFFFFF
 
TX_OUT COUNT, hex=02, decimal=2
 TX_OUT[0]
  TX_OUT[0] Value (uint64_t)    hex=40195E2901000000, reversed_hex=00000001295E1940, dec=4989000000, bitcoin=49.89000000
  TX_OUT[0] PK_Script Length (var_int) hex=19, dec=25
  TX_OUT[0] pk_script (uchar[]) 76A9142A4AA4C0BC27C308CB3F40AFE9B6FAA45D32EFA988AC
 TX_OUT[1]
  TX_OUT[1] Value (uint64_t)    hex=C0D8A70000000000, reversed_hex=0000000000A7D8C0, dec=11000000, bitcoin=.11000000
  TX_OUT[1] PK_Script Length (var_int) hex=02, dec=2
  TX_OUT[1] pk_script (uchar[]) 6087
 
LOCK_TIME 00000000

So it is probably the second output, that you are asking for?
Someone decided to create a script, that pushes hex 0x60 followed by hex 0x87 on the stack. 0x60 equals OP_16, so the value 16 is put on the stack, followed by an OP_Equal. This means, if someone can create a spending tx with a sigscript, that pushes as the last element the value 16 on the stack, the condition would be fulfilled.
Scripting is explained here: https://en.bitcoin.it/wiki/Script.
I also recommend Andreas' book "Mastering Bitcoin", and maybe a good reading is Ken Shirrif's blog:
http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html
yocal
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
February 07, 2018, 03:04:54 PM
 #3

So it is probably the second output, that you are asking for?
Someone decided to create a script, that pushes hex 0x60 followed by hex 0x87 on the stack. 0x60 equals OP_16, so the value 16 is put on the stack, followed by an OP_Equal. This means, if someone can create a spending tx with a sigscript, that pushes as the last element the value 16 on the stack, the condition would be fulfilled.

I've looked through the scripting part and tried to understand it as good as possible, but it still doesn't make quite sense to me why you'd do something like this?

Can you come up with a usecase?

// Yoc.
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 1764
Merit: 2377


bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl


View Profile WWW
February 07, 2018, 04:29:50 PM
 #4

I've looked through the scripting part and tried to understand it as good as possible, but it still doesn't make quite sense to me why you'd do something like this?

Can you come up with a usecase?
It's testnet, people experiment with random things on testnet. It's possible that the transaction was a mistake and a bug in some software produced it. But it happened on testnet and that's fine.

It's also possible that someone is experimenting and learning how scripts work, so they created that transaction. It's testnet and that's okay, that's what testnet is for.

It really does not matter why such a script exists; you just need to know that it does and such scripts can exist so you need to be able to handle them.

yocal
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
February 08, 2018, 07:30:27 AM
 #5

It's testnet, people experiment with random things on testnet.

(...)

It really does not matter why such a script exists; you just need to know that it does and such scripts can exist so you need to be able to handle them.

Knowing the scripts makes you able to some analysis, so understanding them is key to me at least - but it's slowly going the right way Smiley

// Yoc.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!