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

Ease of use signature update #260

Closed
mafintosh opened this issue May 13, 2020 · 2 comments
Closed

Ease of use signature update #260

mafintosh opened this issue May 13, 2020 · 2 comments

Comments

@mafintosh
Copy link
Contributor

mafintosh commented May 13, 2020

As part of v9 we are tweaking the data that is signed to explicitly contain the feed.length.
This is a bit redundant as the signature already signs a hash of the merkle state which implicitly verifies the feed length through the merkle peak indexes.

However having it explicitly in the signature data has a couple of benefits:

  • If you share a tuple of (treeHash, feedLength, signature) you can easily verify this independently without having to replicate any extra merkle data. This is important for "strong links" where you want to strongly link against a hypercore's history.
  • Having an extra step of small metadata to sign opens up for adding a potential fork resolution vector clock in the future.

For downsides... well we sign 8 extra bytes so not too bad but obviously this is a breaking change.
To avoid too much disruption Hypercore v9 ships with a compat mode so it can still verify the old signatures, whilst signing new ones with the updated scheme.

This means Hypercore 9 can speak with Hypercore 8, storage format wise, but Hypercore 8 cannot speak with Hypercore 9's format if an append was made with 9.

For implementers the update means this:

Before we signed treeHash, now we sign concat(treeHash, uint64be(feed.length))

@mafintosh
Copy link
Contributor Author

cc @Frando, relevant for rust impl

@mafintosh
Copy link
Contributor Author

fixed in v9

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

1 participant