relab / hotstuff

MIT License
166 stars 52 forks source link

Sign hash instead of block #84

Open leandernikolaus opened 1 year ago

leandernikolaus commented 1 year ago

In quorum certificates, we sign the block (encoded). Why do we not just sign the hash of the block? By just signing the hash, we could verify certificates without having to retrieve the block. This makes it easier to parallelize such verifications.

func (c crypto) CreatePartialCert(block *hotstuff.Block) (cert hotstuff.PartialCert, err error) {
    sig, err := c.Sign(block.ToBytes())
    if err != nil {
        return hotstuff.PartialCert{}, err
    }
    return hotstuff.NewPartialCert(sig, block.Hash()), nil
}

From here: https://github.com/relab/hotstuff/blob/5196107d449a52e240ab4eddf7ded7cf96a755e3/crypto/crypto.go#L36

meling commented 4 months ago

Add a benchmark and tests (if not already sufficiently tested) and try it.