ethereum / go-verkle

A go implementation of Verkle trees
The Unlicense
209 stars 63 forks source link

[wip] SSZ-optimize proof (type 1) #441

Open gballet opened 2 months ago

gballet commented 2 months ago

This is the first suggestion by Péter, it replaces the proposed suffix diff format with:

type StemStateDiff struct {
    Stem     [StemSize]byte `json:"stem"`
    SuffixDiffs SuffixStateDiffs `json:"suffixDiffs"`
    Suffixes []byte         `json:"suffixes"`
    Current  [][]byte       `json:"current"`
    New      [][]byte       `json:"new"`
}

The size improvement compared to the currently proposed method, is significant:

image

The comparison is a bit unfair, since the library doesn't support optionals and so the encoding for the default method is greatly inflated. But one could argue that if optionals can not be implemented, then this is the correct size of the witness.