Giter Club home page Giter Club logo

chronos-protocol's People

Contributors

adibas03 avatar gitter-badger avatar josipbagaric avatar kosecki123 avatar lsaether avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chronos-protocol's Issues

Transaction encoding

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

Security concerns

As I'm working on building up this repo using the bytes encoding I will use this GH issue to document possible security concerns that occur to me.

  1. Pre-image attack. Since we now use the hash of the encoded transaction bytes, it is possible for many ScheduledTransactions to be deployed pointing to the same data represented by IPFS hash. We may then get an attacker who attempts to break the system by scheduling the same transaction n times. We must build timenodes which are resilient to this kind of attack.

Returning arbitrary length bytes instead of bytes32

As a means of generalizing the conditional execution object to something nicely usable by other projects in the community such as state channels or Plasma contracts, or perhaps within future extensions of this project, it would be nice if callWithData returned bytes using returndatasize.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.