Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
NEP-364: Efficient signature verification host functions #364
NEP-364: Efficient signature verification host functions #364
Changes from 1 commit
34a9391
1d4dc44
56d08f0
0129422
8962147
67ac13b
055bd09
70265a5
d6c0771
a7789b3
1d2777f
479edff
5ed5b18
1e8d3df
80ac231
f3b5c39
e3af2cb
ba8a3d3
bdf64d0
59257ca
d25d8f8
3dac4ea
73e0290
003493e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matklad Do you think it is a good direction to go with extending
HostError
type or should we keep the scope of potential errors minimal?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this doesn't matter much: from the protocol perspective, how exactly
HostError
looks is unobservable. Implementation wise, adding a new variant there is OK.But this actually points to the problem with wording of this NEP: what is written here is how the function would look inside
logic.rs
, but that's an impl detail which is completely irrelevant from the specification point of view.NEPs should say how the WASM import looks, not how it is implemented. For the time being, I'd rephrase this section as:
== Specification
The following host function is added
That is:
We could perhaps consider using proper wasm for the spec here
but I feel that Rust-syntax to experss that is more accessible, and better matches what we've been doing historically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abacabadabacaba Can you maybe help to identify how to state this requirement in a crate-agnostic way, so we don't get tied to the exact implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frol It is difficult to describe the specific behavior concisely without referring to a specific implementation. This blog post describes the various ways in which the existing Ed25519 implementations differ in practice. The behavior that we are using, which is shared by Go
crypto/ed25519
, Rusted25519-dalek
(usingverify
function withlegacy_compatibility
feature turned off) and several others, makes the following decisions:While the above hopefully describes the behavior that we seek in an unambiguous manner, we may still want to point to a specific implementation to refer to in case of an ambiguity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abacabadabacaba Thank you!
@blasrodri Please, include the proposed details into the NEP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@frol updated it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blasrodri Probably Security Implications is not the most appropriate place for this, this should probably rather go just above this thread. Also, whenever the
ed25519-dalek
crate is mentioned, it should be specified thatverify
function should be used. This is because there are other verification functions in this crate (verify_strict
,verify_batch
) that behave differently.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence now seems redundant, given that the expected behavior is described below more thoroughly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed