Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction encoding #2

Open
lsaether opened this issue Mar 22, 2018 · 1 comment
Open

Transaction encoding #2

lsaether opened this issue Mar 22, 2018 · 1 comment

Comments

@lsaether
Copy link
Contributor

lsaether commented Mar 22, 2018

We define the transaction encoding to be

    byte    TemporalUnit           [1  byte ]
    address recipient              [32 bytes]
    uint256 value                  [32 bytes]
    uint256 callGas                [32 bytes]
    uint256 gasPrice               [32 bytes]
    uint256 executionWindowStart   [32 bytes]
    uint256 executionWindowLength  [32 bytes]
    uint256 bounty                 [32 bytes]
    uint256 fee                    [32 bytes]
    bytes   callData               [32+bytes]

where TemporalUnit is either 0x01 for block number based scheduling or 0x02 for unix timestamp based scheduling. Transaction parameters recipient, value, callGas, gasPrice, executionWindowStart, executionWindowLength, bounty, and fee are ABI encoded. The end of the string of bytes contains the callData.

Serialized this will look like this:

0x010000000000000000000000007ed1e469fcb3ee19c0366d829e291451be638e59000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000
00000000000000014000000000000000000000000000000000000000000000000000000000000001e000000000000000000000000000000000000000000000000000000000000002800000000000000000000000000000000
00000000000000000000000000000032000000000000000000000000000000000000000000000000000000000000003c0000000000000000000000000000000000000000000000000000000000000046
@lsaether
Copy link
Contributor Author

Regarding other types of encoding:

so thats the encoding I'm using right now for temporal scheduling. We could come up with another encoding type for conditional. Such as TemporalUnit byte would == 0x03, and executionwindowstart is now the event to watched

and some extra stuff at the end before the callData starts since callData is just [-n] bytes in the string where n is the beginning of callData and can be set to anything as long as its standardized and timenodes are aware of the standard encoding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant