An exit format allows one to specify how assets locked up and redistributed in an L2 should be paid out in L1. We present a general standard, along with coders and helpers written in Typescript, Solidity, and Cairo which will aid L2 interoperability and support arbitrary tokens.
(This description is nicer on the eyes in the project's readme: https://github.com/statechannels/exit-format/blob/62a7c6/README.md) The idea behind this library is to standardise the data structures used in exiting a layer 2 system: whether that is a Celer, Connext, or Nitro state channel or a rollup such as Arbitrum or Optimism. An exit format allows one to specify how assets locked up and redistributed in an L2 should be paid out in L1. Standard utilities, built against a standard format, can undergo a higher concentration of scrutiny from the community and auditors — a major benefit. We hope to receive feedback from as many layer 2 projects as possible, to help towards writing a standards track EIP. Adoption of this standard improves interoperability between L2s, and enables the sharing of L2 entrance & exit utilities, such as exit meta transactions. We have concentrated so far on a format that works for Nitro state channels. The new format enables us to streamline our virtual channel construction, simplifying the protocol while lowering the gas costs for channel disputes. Find out more at https://www.notion.so/statechannels/Streamlining-Virtual-Channels-8a8650ba849d4221b7e93c125a794ecf. The standard is extensible enough to support future token standards and even to describe cross-chain assets. As another bonus, we have also built the beginnings of a zero-knowledge proof mechanism, which will allow Nitro state channels to scale even farther beyond their current limit and bring gas costs down even further. This work-in-progress currently takes the form of some Cairo code that we successfully submitted to the Starkware shared prover. **Disclosures:** - Web3Torrent, mentioned in our video and Streamlining Virtual Channels, is **not** part of the hackathon submission. It is a previous project completed by the statechannels.org team. - The Nitro protocol, including the virtual funding protocol and an existing implementation of it, is not new. The optimisation, using the proposed exit format, is new.
How it's made
We only have two dependencies: `ethers-js` for BigNumber types and ABI encoding and `openzeppelin/contracts` for token interfaces. We used `hardhat` for our development environment. The zk work uses the `cairo` language. The main content is the definition of an exit format, with some exit-transformations implemented in Typescript, Solidity & Cairo. One notable transformation, `claim`, streamlines Nitro's virtual channel protocol.Technologies used