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
                                )

                        )

                )

        )

)
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.

3
  • 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
    Jan 3 '18 at 20:59
  • 1
    Yes. 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
    Jan 3 '18 at 21:09
  • Not all transactions need to have signatures, to be clear.
    – Claris
    Jan 4 '18 at 1:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.