← Back to home

Utilities for Vyper

Python

Convenient on-chain state compression via secure hashes and compiler-verified proofs

Screenshots

Utilities for Vyper screenshot 1
Utilities for Vyper screenshot 2
Utilities for Vyper screenshot 3

Problem Statement

https://github.com/vyperlang/vyper/issues/2892 Build support into the compiler (vyper) for storing a secure hash of arbitrary data (e.g. a struct), and then "unpacking" (validating) the data back from a user-provided "proof" in calldata. Smart contract developers can conveniently compress (hash) their data and re-hydrate it with the "proofs".

Solution

We used the Vyper compiler (Python3). Charles (on the vyper team) helped us get started by copying/modifying compiler primitives for arrays and abi.encode. From there, we modified the type details to make this work on arbitrary structs/type. So you can have Witness[MyStruct] or Proof[MyStruct]. Our team was brand new to EVM compilers, and we got the parsing working really quickly!

Hackathon

ETHNewYork 2022

2022

Contributors