omgnetwork/research

Fees withdrawal from plasma contract research

Closed this issue · 1 comments

Research for the operator to discover the possibility of withdrawing collected fees from the root-chain contract and any potential issues that may arise.

Did a POC with the following fee tx format on the contract side. In this format, fee transaction would point to the previous fee transaction. First fee tx would be with empty input.

The main thing to verify is can we have multiple output data structure for fee tx? If we are not aiming to exit by the fee tx type directly, which means we don't need a exit game implementation, potentially the old statement of "it is hard to have multiple data structure for outputs because of solidity limit" would not block us.

Branch: https://github.com/omisego/plasma-contracts/tree/poc_fee_chain_tx_multi_output_structure
Example commit: omgnetwork/plasma-contracts@7e6bf7a

Fee Transaction

{
    txType: uint256,
    inputs: [], // list of bytes32
    outputs: [], // list of 2 potential structs (2 output types)
}

Inputs

bytes32: outputId of the previous fee transaction

Outputs

  1. FeeOutput: the output that holds the Fee value
{
    outputType: uint256,
    amount: uint256,
    outputGuard: bytes20,
    token: address,
}
  1. FeeNonceOutput: the output that holds a nonce
{
    outputType: uint256,
    nonce: uint256,
}

PS. I don't think we need to chain txs together though, and we don't really gain anything with that. The nonce itself would be good enough. However, chch/watcher should probably check the nonce is unique or not.