truebitfoundation / dispute-resolution-layer Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] Generic dispute resolution layer for Truebit verification games
License: MIT License
[DEPRECATED] Generic dispute resolution layer for Truebit verification games
License: MIT License
Create test where it tests the steps 0 and 1, and then calls performStepVerification
The client needs to be able to be used as a module by other client software (think big picture Truebit client).
Simply JS code that interacts with the deployed VerificationGame contracts + tests
BasicVerificationGame should implement IDisputeResolutionLayer explicitly
SimpleAdderVM should implement IComputationLayer explicitly
@mrsmkl had the suggestion to do
Add methods to do batch queries responses
function query(bytes32 gameId, uint[] steps)
function respond(bytes32 gameId, uint[] steps, bytes32[] hashes)
Then a mini verification game takes place here
Summary - Standard for interfacing with Truebit Verification Games.
Rationale - Truebit will serve as critical infrastructure for a wide variety of dapps. Internally in Truebit we are already seeing different ideas and implementations being developed. At the core of these services is the verification game. We currently have two implementations of verification games that don't use a common interface. Defining a standard interface for verification games will make it easier to test, upgrade, and develop these different Truebit implementations.
Core Functionality -
Initial Spec -
newGame(uint task_id, address solver, address challenger, bytes input, bytes32 outputHash, uint numSteps) returns(uint game_id)
query(uint game_id, uint stepNumber)
respond(uint game_id, bytes32 hash)
timeout(uint game_id)
performFinalVerification(uint sessionId, uint claimId, bytes preValue, bytes postValue, bytes proof)
Rationale for name performFinalVerification:
Current Verification Game Implementations -
scrypt-interactive: https://github.com/TrueBitFoundation/scrypt-interactive/blob/master/contracts/Verifier.sol
webasm-solidity: https://github.com/TrueBitFoundation/webasm-solidity/blob/master/contracts/interactive2.sol
The above specification works cleanly with the scrypt-interactive repo mostly because that was inspiration for the spec. webasm-solidity could mostly work with some name changes. The biggest challenge with integrating is with the respond (postPhases) portion. As it passes an array of 13 32 byte values, instead of a single bytes32. However, it is not impossible to integrate with the above spec:
TODO:
PR with tests and example of interface
See basic_verification_game.js query to highStep for an example of this. Solution would be to able to run the test without using the second query.
The issue is because performStepVerification needs lowStep + 1 == highStep. If one doesn't query again, then lowStep doesn't get set.
highStep, lowStep get changed by query/response.
So the fix will belong in the logic in the query method
The client needs to be able to gracefully handle a block reorg
Solutions delay client by a couple blocks (blockstream)
Right now it uses a linked list approach, need a more complex data structure for better performance
Do test case where game ends on some step between (initialStep+1..finalStep-1)
Right now computation layer specifies a 3 element array, this should be changed to a dynamic array. However, these are new Solidity features
The goal of this is to have a formal standard that can interop with as many Truebit use cases as possible
Example use cases:
Client needs a caching solution that can also be used to quickly restart a client after a shutdown
The query/response mechanism seems like a good place for the use of state channels. However, the current issue is the data availability problem around the timeout mechanism.
Ex: Using a state channel verifier makes a query, solver sends a response. Verifier claims solver never sent a response within the time frame (5 blocks). Solver has chance to prove they are indeed still playing. This fraud proof mechanism happens on-chain. Incentives dictate verifier pulls this trick every single query/response round because they want to see the solver lose. Then each round ends up being on-chain anyways.
Summary - In order to use state channels for query/response need to solve timeout fraud problem.
There are multiple ways to merklize a list of bytes, the branches can use different patterns. These patterns have different characteristics.
The most important characteristic is the length of the proof (basically search properties). We need to be able to always submit short proofs (Olog(n))
Need to setup travis so I stop pushing buggy code
The test in basic_verification_game.js where it calls performStepVerification fails because the postState is not merklizing properly.
Simple substitute the addition operation with keccak256.
This could be useful for verifying arbitrary merkle root computations
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.