Author

Topic: Increase script size above 0xFF characters? (Read 669 times)

full member
Activity: 238
Merit: 109
February 17, 2014, 01:06:07 AM
#3

God dammit, I probably should read the whole page before giving up  Undecided

Anyway, not had a chance to actually test anything since (Eating something at the moment), but, can I confirm, if I wanted to do '0x0103', I should do 0xfd0301?

EDIT:- Finally finished my TV show and food, I can confirm it was as I thought, thanks!

Code:
01000000014665a822ecf6c9741c6646b244e571ba305f18f3665f707ef5aea0f29d78fa99010000000100ffffffff01107a070000000000
fd0301
4c
ff
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
76
88
00000000
full member
Activity: 238
Merit: 109
February 17, 2014, 12:26:36 AM
#1
https://en.bitcoin.it/wiki/Protocol_specification#tx

Field size:- 1+

How on earth do I actually mark it as greater than one? I tried just throwing another byte in there, but, that results in errors, I have this commented transaction so far:-
Code:
01000000014665a822ecf6c9741c6646b244e571ba305f18f3665f707ef5aea0f29d78fa99010000000100ffffffff01107a070000000000 //boring transaction stuff
07 //0x07 bytes script
4c //0x4c states "next byte defines how many bytes I should push to the stack"
03 //0x03 bytes
8f7a3c //Those 0x03 bytes, 0x8f, 0x7a, and, 0x3c
76 //OP_DUP
88 //OP_EQUALVERIFY
00000000 //More boring transaction stuff (locktime)

Which, results in:-
Code:
{
    "hash": "5e4a2e55b8c21d491749d1009f568192e211fa931e78af343675fedf2371041d",
    "ver": 1,
    "vin_sz": 1,
    "vout_sz": 1,
    "lock_time": 0,
    "size": 68,
    "in": [
        {
            "prev_out": {
                "hash": "99fa789df2a0aef57e705f66f3185f30ba71e544b246661c74c9f6ec22a86546",
                "n": 1
            },
            "scriptSig": "OP_FALSE",
            "sequence": 4294967295
        }
    ],
    "out": [
        {
            "value": "0.00490000",
            "scriptPubKey": "8f7a3c OP_DUP OP_EQUALVERIFY"
        }
    ]
}

However, like I said, I can't for the life of me work out how to increase the scriptPubKey to > 0xFF, imagine I have this:-
Code:
01000000014665a822ecf6c9741c6646b244e571ba305f18f3665f707ef5aea0f29d78fa99010000000100ffffffff01107a070000000000 //boring transaction stuff
0301 //(0x07 + 0xff - 0x03) bytes script, 0x0103, bytes reversed to 0x0301.
4c //0x4c states "next byte defines how many bytes I should push to the stack"
ff //0xff bytes
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa //Those 0xff bytes, a bunch of 0xAA
76 //OP_DUP
88 //OP_EQUALVERIFY
00000000 //More boring transaction stuff (locktime)

Results in:-
Code:
{
    "hash": "a530ba3415952af7ed24f297fea7570219f401046fb50ac01d4c773bd2101bd0",
    "ver": 1,
    "vin_sz": 1,
    "vout_sz": 1,
    "lock_time": 2863311530,
    "size": 64,
    "in": [
        {
            "prev_out": {
                "hash": "99fa789df2a0aef57e705f66f3185f30ba71e544b246661c74c9f6ec22a86546",
                "n": 1
            },
            "scriptSig": "OP_FALSE",
            "sequence": 4294967295
        }
    ],
    "out": [
        {
            "value": "0.00490000",
            "scriptPubKey": "4c "
        }
    ]
}

If I don't switch the bytes around for byte script length:-
Code:
01000000014665a822ecf6c9741c6646b244e571ba305f18f3665f707ef5aea0f29d78fa99010000000100ffffffff01107a070000000000 //boring transaction stuff
0103 //(0x07 + 0xff - 0x03) bytes script, 0x0103, bytes reversed to 0x0301.
4c //0x4c states "next byte defines how many bytes I should push to the stack"
ff //0xff bytes
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa //Those 0xff bytes, a bunch of 0xAA
76 //OP_DUP
88 //OP_EQUALVERIFY
00000000 //More boring transaction stuff (locktime)

Equals:-
Code:
{
    "hash": "68ceb346c7711a74f31b8a285014ee08a58050480f69c5ee97cc75e803cf1c2e",
    "ver": 1,
    "vin_sz": 1,
    "vout_sz": 1,
    "lock_time": 2863333196,
    "size": 62,
    "in": [
        {
            "prev_out": {
                "hash": "99fa789df2a0aef57e705f66f3185f30ba71e544b246661c74c9f6ec22a86546",
                "n": 1
            },
            "scriptSig": "OP_FALSE",
            "sequence": 4294967295
        }
    ],
    "out": [
        {
            "value": "0.00490000",
            "scriptPubKey": ""
        }
    ]
}

Any help on making scripts > 0xFF? All I'm currently getting is it overflowing into lockTime.
Jump to: