Bitcoin Forum
May 21, 2024, 09:12:58 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin-etl transactions.json parameters explanation  (Read 269 times)
kristiano92 (OP)
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
July 31, 2020, 12:40:23 PM
Last edit: October 08, 2020, 09:15:42 AM by kristiano92
 #1

Hi,

I use bitcoinetl to download data from bitcoin blockchain.
For example:
Code:
{
  "hash": "412910031c9677c24d08a27034c994564ca0801a7817b4fa0e6d38ab425508cc",
  "size": 223,
  "virtual_size": 223,
  "version": 1,
  "lock_time": 0,
  "block_number": 641225,
  "block_hash": "00000000000000000001c40a6317eec0cdd1b669a237bf1e049d7f70d56a8345",
  "block_timestamp": 1595969476,
  "is_coinbase": false,
  "index": 379,
  "inputs": [
    {
      "index": 0,
      "spent_transaction_hash": "1ad97eaf9013507e0f2ae8f42a4381adf2141b45ca874c5e0b1956c60854f4ec",
      "spent_output_index": 2,
      "script_asm": "30440220357d50e85dd29c52e54bc14dde809956abe1ac691a5fb6ffc46f79ace749b2bd02201447841e72078f0b2f9b512bea3d91e2b787ef6f3318c4c0192a4266f0d6d7ac[ALL] 0292423edb90a4b950ecf25bc0b76173ebea211bb56c5f7d05518bd02603b97ded",
      "script_hex": "4730440220357d50e85dd29c52e54bc14dde809956abe1ac691a5fb6ffc46f79ace749b2bd02201447841e72078f0b2f9b512bea3d91e2b787ef6f3318c4c0192a4266f0d6d7ac01210292423edb90a4b950ecf25bc0b76173ebea211bb56c5f7d05518bd02603b97ded",
      "sequence": 4294967295,
      "required_signatures": 1,
      "type": "pubkeyhash",
      "addresses": [
        "13yQitAQzggzTr6dw7Qe5PZnGhsoMxjrEM"
      ],
      "value": 59822256
    }
  ],
  "outputs": [
    {
      "index": 0,
      "script_asm": "OP_HASH160 8f7c778eb3d10e78f19e42c4e810c0c4748cd15c OP_EQUAL",
      "script_hex": "a9148f7c778eb3d10e78f19e42c4e810c0c4748cd15c87",
      "required_signatures": 1,
      "type": "scripthash",
      "addresses": [
        "3Emhf6WMZSgqZorB2SeymSE55XeL3JLcqa"
      ],
      "value": 3636800
    },
    {
      "index": 1,
      "script_asm": "OP_DUP OP_HASH160 3948bdcd3ae6de4ced68de778bbd88c27b18e75f OP_EQUALVERIFY OP_CHECKSIG",
      "script_hex": "76a9143948bdcd3ae6de4ced68de778bbd88c27b18e75f88ac",
      "required_signatures": 1,
      "type": "pubkeyhash",
      "addresses": [
        "16Dtf6axb6BYXXmMmdhTNuqHFSePDg1654"
      ],
      "value": 56153138
    }
  ],
  "input_count": 1,
  "output_count": 2,
  "input_value": 59822256,
  "output_value": 59789938,
  "fee": 32318
}

I don't know what this parameter mean "index: 379". Could anyone explain me ?
A-Bolt
Legendary
*
Offline Offline

Activity: 2317
Merit: 2318


View Profile
July 31, 2020, 06:52:55 PM
 #2

what this parameter mean "index: 379"

It's tx index in a block.
HeRetiK
Legendary
*
Offline Offline

Activity: 2940
Merit: 2091



View Profile
August 01, 2020, 03:32:59 PM
Merited by HCP (2), ABCbits (1)
 #3

Usually transactions are stored in a list as part of a block, which means each transaction is indexed.

I haven't used bitcoinetl before, but I presume since bitcoinetl splits this data into the blocks.json and transactions.json schemas, the index needs to be stored explicitely as part of the transaction data, hence the transaction index. This enables you -- in theory -- to rebuild and verify the original block data as stored on the Bitcoin blockchain. Without the transaction index this would not be possible as no ordering information would be available.
kristiano92 (OP)
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
August 03, 2020, 11:30:12 AM
 #4

Thank you for explanation Smiley
kristiano92 (OP)
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
October 01, 2020, 12:00:18 PM
 #5

Is "required_signatures" parameter always be "1" ?
HeRetiK
Legendary
*
Offline Offline

Activity: 2940
Merit: 2091



View Profile
October 01, 2020, 01:41:15 PM
 #6

Is "required_signatures" parameter always be "1" ?


Not always:

Code:
            {
                "name": "required_signatures",
                "type": "INT64",
                "description": "The number of signatures required to authorize spending of this output"
            },


There's multisig transactions that require n-of-m signatures so according to the above the value of "required_signatures" will depend on whether it's a multisig transaction or a regular one with only a single required signature.
kristiano92 (OP)
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
October 04, 2020, 03:41:37 PM
 #7

Is "required_signatures" parameter always be "1" ?


Not always:

Code:
            {
                "name": "required_signatures",
                "type": "INT64",
                "description": "The number of signatures required to authorize spending of this output"
            },


There's multisig transactions that require n-of-m signatures so according to the above the value of "required_signatures" will depend on whether it's a multisig transaction or a regular one with only a single required signature.

Ok, thanks Smiley When it comes to outputs, can they be always "1" ? I haven't found any ouput > 1
PrimeNumber7
Copper Member
Legendary
*
Offline Offline

Activity: 1624
Merit: 1899

Amazon Prime Member #7


View Profile
October 04, 2020, 10:35:39 PM
 #8

Ok, thanks Smiley When it comes to outputs, can they be always "1" ? I haven't found any ouput > 1
The transaction you referenced in the OP has two outputs.

It is very common for an individual to have transactions that have exactly two outputs, one to the person/enttity they are sending coin to and one change output.

Many businesses who send many transactions per day will consolidate transactions such that they send coin to many individuals/entities in a single transaction.

Here is an example of a recent transaction that has more than two outputs.
kristiano92 (OP)
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
October 06, 2020, 04:17:34 PM
 #9

Ok, thanks Smiley When it comes to outputs, can they be always "1" ? I haven't found any ouput > 1
The transaction you referenced in the OP has two outputs.

It is very common for an individual to have transactions that have exactly two outputs, one to the person/enttity they are sending coin to and one change output.

Many businesses who send many transactions per day will consolidate transactions such that they send coin to many individuals/entities in a single transaction.

Here is an example of a recent transaction that has more than two outputs.


I thought about required_signatures parameter for outputs. This parameter doesn't include P2SH Multisig. It shows "1" for multisigs addresses. I am right?
PrimeNumber7
Copper Member
Legendary
*
Offline Offline

Activity: 1624
Merit: 1899

Amazon Prime Member #7


View Profile
October 06, 2020, 07:21:44 PM
 #10

Ok, thanks Smiley When it comes to outputs, can they be always "1" ? I haven't found any ouput > 1
The transaction you referenced in the OP has two outputs.

It is very common for an individual to have transactions that have exactly two outputs, one to the person/enttity they are sending coin to and one change output.

Many businesses who send many transactions per day will consolidate transactions such that they send coin to many individuals/entities in a single transaction.

Here is an example of a recent transaction that has more than two outputs.


I thought about required_signatures parameter for outputs. This parameter doesn't include P2SH Multisig. It shows "1" for multisigs addresses. I am right?
You cannot tell if an output needs to be signed by more than one private key.

The only exception to the above is if that address has previously signed a transaction that you can review.
kristiano92 (OP)
Jr. Member
*
Offline Offline

Activity: 68
Merit: 1


View Profile
October 08, 2020, 09:35:14 AM
 #11

Ok, thanks Smiley When it comes to outputs, can they be always "1" ? I haven't found any ouput > 1
The transaction you referenced in the OP has two outputs.

It is very common for an individual to have transactions that have exactly two outputs, one to the person/enttity they are sending coin to and one change output.

Many businesses who send many transactions per day will consolidate transactions such that they send coin to many individuals/entities in a single transaction.

Here is an example of a recent transaction that has more than two outputs.


I thought about required_signatures parameter for outputs. This parameter doesn't include P2SH Multisig. It shows "1" for multisigs addresses. I am right?
You cannot tell if an output needs to be signed by more than one private key.

The only exception to the above is if that address has previously signed a transaction that you can review.

Do you mean that is it possible only when I have input ?


I have one more question about bitcoin-etl. What is the best way to recognize witness transactions ? What parameters should be used ? Addresses , which starts with 3.. could be segwit or non-segwit (multisig)
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!