type PeerId = [ed25519.PublicKeySize]byte type Record struct { id ID // globally unique content addressed SHA256 hash of current Record author PeerId // creator of current Record sign []byte // signature used by an author used for Record verification deps []ID // dependencies: IDs of parents of this Record data []byte // user data } func NewRecord(pub ed25519.PublicKey, priv ed25519.PrivateKey, deps []ID, data []byte) *Record { p := &Record{ data: data, parents: deps, author: NewPeerId(pub), } p.id = p.hash() p.sign = ed25519.Sign(priv, p.data) return p } // Returns a content addressable hash of a given Record func (r *Record) hash() ID { h := sha256.New() for _, d := range r.deps { h.Write(d[:]) } h.Write(r.data) h.Write(r.author[:]) return NewID(h.Sum(nil)) } func (log *POLog)…