user66991: I want to understand Bitcoin data structure. So i try to understand a raw transaction in json format. 
When i checked the blockchain.info API documentation, i see that input structure is defined for transactions like this:
"prev_out":
{
    "hash":"a3e2bcc9a5f776112497a32b05f4b9e5b2405ed9",
    "value":"100000000",
    "tx_index":"12554260",
    "n":"2"
},
"script":"76a914641ad5051edd97029a003fe9efb29359fcee409d88ac"

But when I query a transaction from blockchain.info, it seems differently:
"prev_out":
{
    "spent":true,
    "tx_index":8845778,
    "type":0,
    "addr":"1CfD77hupeUvFwBPxZ2fA8iyWmVwQY22oh",
    "value":10212000000,
    "n":1,
    "script":"76a9147fe34b97aeff4ab754770be5c8f12e2e95332fd488ac"
 }

Is there any document that clearly explains these data fields? 
My current wonders:

What is the spent field?
There is no hash field at queried transaction, there must be i think?
What is type field?
Which fields are signed? The signature is generated by which fields hash?


user100290: You should know that different transaction parsers often include their own fields that aren't directly included in the raw transaction. For example, the "address" would not be found in the raw transaction, but it can be inferred by looking at it. I'm not sure what the 'type' and 'n' fields refer to. You may want to have a look at these links:
dissecting transactions
create raw bitcoin tx
redeeming a raw tx
I'm not sure about your questions 1, 3, it'll be specific to the api. I'm not sure what you are referring to in question 2. For question 4, it depends on the type of transaction (non-segwit or segwit) and the type of signature (sighash_all, sighash_none, sighash_single).

66991: <p>I want to understand Bitcoin data structure. So i try to understand a raw transaction in json format. 
When i checked the <a href="https://blockchain.info/api/blockchain_api" rel="noreferrer">blockchain.info API documentation</a>, i see that input structure is defined for transactions like this:</p>

<pre><code>"prev_out":
{
    "hash":"a3e2bcc9a5f776112497a32b05f4b9e5b2405ed9",
    "value":"100000000",
    "tx_index":"12554260",
    "n":"2"
},
"script":"76a914641ad5051edd97029a003fe9efb29359fcee409d88ac"
</code></pre>

<p>But when I <a href="https://blockchain.info/rawtx/ee475443f1fbfff84ffba43ba092a70d291df233bd1428f3d09f7bd1a6054a1f" rel="noreferrer">query a transaction from blockchain.info</a>, it seems differently:</p>

<pre><code>"prev_out":
{
    "spent":true,
    "tx_index":8845778,
    "type":0,
    "addr":"1CfD77hupeUvFwBPxZ2fA8iyWmVwQY22oh",
    "value":10212000000,
    "n":1,
    "script":"76a9147fe34b97aeff4ab754770be5c8f12e2e95332fd488ac"
 }
</code></pre>

<p>Is there any document that clearly explains these data fields? </p>

<p>My current wonders:</p>

<ol>
<li>What is the spent field?</li>
<li>There is no hash field at queried transaction, there must be i think?</li>
<li>What is type field?</li>
<li>Which fields are signed? The signature is generated by which fields hash?</li>
</ol>
 100290: <p>You should know that different transaction parsers often include their own fields that aren't directly included in the raw transaction. For example, the "address" would not be found in the raw transaction, but it can be inferred by looking at it. I'm not sure what the 'type' and 'n' fields refer to. You may want to have a look at these links:</p>

<p><a href="https://klmoney.wordpress.com/bitcoin-dissecting-transactions-part-2-building-a-transaction-by-hand/" rel="nofollow noreferrer">dissecting transactions</a></p>

<p><a href="https://medium.com/coinmonks/how-to-create-a-raw-bitcoin-transaction-step-by-step-239b888e87f2" rel="nofollow noreferrer">create raw bitcoin tx</a></p>

<p><a href="https://bitcoin.stackexchange.com/questions/32628/redeeming-a-raw-transaction-step-by-step-example-required">redeeming a raw tx</a></p>

<p>I'm not sure about your questions 1, 3, it'll be specific to the api. I'm not sure what you are referring to in question 2. For question 4, it depends on the type of transaction (non-segwit or segwit) and the type of signature (sighash_all, sighash_none, sighash_single).</p>
