lorenzb / libsubmarine

Implementation of a novel practical scheme for submarine commitments
https://libsubmarine.org
Other
224 stars 31 forks source link

Session Indexing #25

Closed thegostep closed 5 years ago

thegostep commented 5 years ago

As we have it, sessionId is the hash of the unlock transaction. This is only used in the challenge to reconstruct the submarine address unless #13 in implemented.

What is the benefit of doing this? Could we use the submarine address itself as a sessionId?

thegostep commented 5 years ago

Related: is bytes _unsignedCommitTx the rlp encoded unlock transaction before being hased into sessionId?

relyt29 commented 5 years ago

unsigned commit TX is the commit tx that we are claiming is invalid with all of the typical params of a tx in it except the ECDSA signature. See https://github.com/lorenzb/proveth/blob/master/onchain/ProvethVerifier.sol#L24

relyt29 commented 5 years ago

What is the benefit of doing this? Could we use the submarine address itself as a sessionId?

My understanding is that this is a cheap hack to store all the data for the unlock transaction in the contract without actually doing so. This way, if you want to check if your unlock tx is already revealed / whatever, you go compute the session ID and then check if its hash is stored in the contract.

I suppose that we could use the submarine address itself (better, maybe a tuple of the submarine address and the witness data) as a sessionID, but the amount of data for that would be a keccak256 so its not as if there are any particular storage savings by doing so, and this way it's more explicit imo

happy to hear others' opinions

relyt29czechimposter commented 5 years ago

can we close this ? not sure if this is an issue anymore?