Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Near2EthProver #36

Closed
maxzaver opened this issue May 5, 2020 · 8 comments
Closed

Near2EthProver #36

maxzaver opened this issue May 5, 2020 · 8 comments
Assignees

Comments

@maxzaver
Copy link
Contributor

maxzaver commented May 5, 2020

We need to write a contract that verifies the merkle proofs towards certain transaction outcomes. The specific design of the proofs is discussed here: near/nearcore#2632

@bowenwang1996
Copy link
Contributor

Maybe I misunderstand what code you are talking about, but I don't think Misha wrote any of that code. It would be unfair to attribute potential suboptimalities to him.

@maxzaver
Copy link
Contributor Author

maxzaver commented May 5, 2020

@mikhailOK used to own nearcore/core/storage/state code between Autumn'19 and Spring'20. This code implements Merkle Patricia Trie and he is very familiar with it. NearProver would need to work with the paths in generated by that code.

@bowenwang1996
Copy link
Contributor

I see. But proofs for transaction outcomes is not stored in state. Maybe you mean something else.

@maxzaver
Copy link
Contributor Author

maxzaver commented May 5, 2020

I see. But proofs for transaction outcomes is not stored in state. Maybe you mean something else.

Correct. We have two different architectures for proving "events" in Near:

  • Proving certain transaction outcome;
  • Proving certain state.

For the former we need someone who wrote or worked with merkelization code https://github.com/nearprotocol/nearcore/blob/4713f5f88a7a57d6b5a13ed1057289858d63f134/core/primitives/src/merkle.rs#L28 I guess it is you? So you might be right that @k06a would need to be asking your help instead of @mikhailOK 's.

@k06a
Copy link
Contributor

k06a commented May 5, 2020

Could we generate proofs by building Tree/Trie for all outcomes?

@maxzaver
Copy link
Contributor Author

maxzaver commented May 5, 2020

Could we generate proofs by building Tree/Trie for all outcomes?

I think that would be the best way to do it. Really easy, just read borsh-serialized transaction outcomes and merkelize them, the code is all there.

@bowenwang1996
Copy link
Contributor

@nearmax

Proving certain state.

I think we don't have this exposed properly. See near/nearcore#2076. It might require some effort.

@maxzaver
Copy link
Contributor Author

maxzaver commented May 6, 2020

Yup, we don't have it exposed. That's why we are going with the transaction outcome.

@maxzaver maxzaver changed the title NearProver Near2EthProver May 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants