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

correct magic bytes values in readme #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nicolasochem
Copy link
Collaborator

No description provided.

README.md Outdated
@@ -18,7 +18,7 @@ Note that we have only tested it on [AWS CloudHSM](https://aws.amazon.com/cloudh

Please note that this software does not provide any authentication or authorization. You will need to take care of that yourself. It simply returns the signature for valid payloads, after performing some checks:
* Is the message a valid payload?
* Does the message begin with a 0x01 or 0x02? Indicating it is a baking or endorsement, rather than a 0x03 transfer.
* Does the message begin with a 0x11, 0x12 or 0x13? Indicating it is a baking or endorsement, rather than a 0x03 transfer.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0x03 could also be votes now and not just transfers. The signer checks for that:

elif self.data[0] == 0x03: # Operation, for now, we only do ballots
self.chainid = None
self.type = "Unknown operation"
self.blockhash = self.data[1:32] # The block hash
if self.data[33] == 0x06: # 0x06 is a ballot
self.pkh_type = self.data[34] # Public Key Hash type
self.pkh = self.data[35:55] # Public Key Hash
self.period = self.data[55:59]
self.proposal = self.data[59:91]
if self.data[91] == 0x00:
self.type = "Ballot"
self.vote = "yay"
elif self.data[91] == 0x01:
self.type = "Ballot"
self.vote = "nay"
elif self.data[91] == 0x02:
self.type = "Ballot"
self.vote = "pass"

Also maybe add

Suggested change
* Does the message begin with a 0x11, 0x12 or 0x13? Indicating it is a baking or endorsement, rather than a 0x03 transfer.
* Does the message begin with a 0x11, 0x12 or 0x13? Indicating it is a baking, preendorsement, or endorsement, rather than a 0x03 transfer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually we should forbid any 0x03 operation. With a consensus key baker, you vote with the baker key, not the consensus key.

Copy link

@harryttd harryttd Apr 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's assuming all users would use a consensus key. But i don't think we need to restrict them to that. As far as i can tell, there is no issue with allowing votes. If we keep the voting we should add in that voting ops are accepted.

Co-authored-by: Aryeh Harris <harryttd@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

2 participants