Input size smaller than 148 byte

1

How does this TestNet bitcoin transaction have 85 bytes?

is this result wrong or it's possible to have input smaller than 148 bytes.

Array
(
    [txid] => 687fb5d0659ef7e21bd567f9b7677d1847d4cc84839a537ab8da8336101a5ca7
    [hash] => 687fb5d0659ef7e21bd567f9b7677d1847d4cc84839a537ab8da8336101a5ca7
    [version] => 2
    [size] => 85
    [vsize] => 85
    [locktime] => 0
    [vin] => Array
        (
            [0] => Array
                (
                    [txid] => 0ac6f42816611c2ed7b31dc38e0dece1eeaf987d1f373bd6e8109430aba826f6
                    [vout] => 0
                    [scriptSig] => Array
                        (
                            [asm] => 
                            [hex] => 
                        )

                    [sequence] => 4294967295
                )

        )

    [vout] => Array
        (
            [0] => Array
                (
                    [value] => 0.000708
                    [n] => 0
                    [scriptPubKey] => Array
                        (
                            [asm] => OP_DUP OP_HASH160 c3f01af4ca2ef310c61d2244a22bbbe42739202f OP_EQUALVERIFY OP_CHECKSIG
                            [hex] => 76a914c3f01af4ca2ef310c61d2244a22bbbe42739202f88ac
                            [reqSigs] => 1
                            [type] => pubkeyhash
                            [addresses] => Array
                                (
                                    [0] => myNyhGasXAHDoRS58StxuVmRLofCN1kcZ2
                                )

                        )

                )

        )

)

Adam

Posted 2018-01-03T20:42:58.423

Reputation: 3 215

Answers

2

This transaction is not signed. It is not valid and I cannot find it on my testnet node nor on any testnet blockchain explorers. The signature takes up the bulk of the bytes in a transaction, so this is expected behavior.

Andrew Chow

Posted 2018-01-03T20:42:58.423

Reputation: 40 910

in that case is it possible to calculate signature size somehow and add it up to this transaction size, so we have the final transaction size?Adam 2018-01-03T20:59:38.450

1Yes. The signature will be at most 72 bytes, the public key is either 33 or 65 depending on whether it is compressed (and you will know that if you know the public key). So the entire scriptsig for one input is 72+33+2=107 bytes or 72+65+2=139 bytes. Just add that to the size of the unsigned transaction for each input and you will get a decent estimate of the size of the final, signed transaction.Andrew Chow 2018-01-03T21:09:08.767

Not all transactions need to have signatures, to be clear.Anonymous 2018-01-04T01:26:35.377