Questions about Nu blockchain

To avoid topic drift I move the questions here

Is the “n” you refer to the “n:” in vout in the example below? I don’t see n=-1

{
    "txid" : "148dc9326bdb6b71a82a7fd6017e0b4c65c2a71a97c6fbf245776b0c865b3abe",
    "version" : 1,
    "time" : 1413510636,
    "locktime" : 0,
    "unit" : "B",
    "vin" : [
        {
            "txid" : "0000000000000000000000000000000000000000000000000000000000000000",
            "vout" : 4294967295,
            "scriptSig" : {
                "asm" : "",
                "hex" : ""
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 4040000.0,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_HASH160 9328780d1dac8ea60169f0508b91ed0493ce732e OP_EQUAL",
                "hex" : "a9149328780d1dac8ea60169f0508b91ed0493ce732e87",
                "type" : "scripthash",
                "reqSigs" : 1,
                "addresses" : [
                    "BhCnQrYrA5LZm871dtMQEXeU93gmqbhdrC"
                ]
            }
        }
    ]
}

Indeed. It’s because I didn’t see it’s named “vout” here instead of “n” and it’s displayed as an unsigned 32 bits integer: 2^32-1 = 4294967295.

Thanks.

It seems that this case

and this case (bold face part)

cannot be distinguished by looking at vin or vout alone. One has to test (vout-vin) == 40 to make sure. Neither case satisfies the “one input and its hash is 0” criteria – they have no input hash. Only the grant tx has zero hash looking like “000…00”

That’s how the raw data are, but getrawtransaction parses that in an attempt to make it more readable. When it’s a CoinBase getrawtransaction actually returns an object with a “coinbase” key in “vin”.

What do you want to know? Whether a transaction is a minting reward? If

  • there is at least one input
  • and the first input does not have a “coinbase” key
  • and the first output is empty (0 value and empty scriptPubKey)

Then it’s a PoS reward.

It’s here: https://bitbucket.org/JordanLeePeershares/nubit/src/cd6e9ee263579fc3e2cddd3cad1e6eef685112a5/src/main.h?at=master&fileviewer=file-view-default#main.h-701
And getrawtransaction uses this function to display the results: https://bitbucket.org/JordanLeePeershares/nubit/src/d7766481e780d413d5988d82489ee79efc365270/src/bitcoinrpc.cpp?at=2.0.3-Stable-Release&fileviewer=file-view-default#bitcoinrpc.cpp-247 (where you can see the CoinBase special case).

To find a way to distinguish mintng reward and grant without calculating vin and vout, which is slow.

thanks.