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

Introduce protobuf types under new pkg directory #56

Merged
merged 15 commits into from
Mar 27, 2018
Prev Previous commit
Next Next commit
Add EncryptedEnvelope, update GossipMsg doc.
An EncryptedEnvelope is a special envelope needed for certain phases of
DKG. Update document for the channel field in GossipMessage; note that
we use keccak as the has function, and that pub keys are specifically
StakingPubKeys.
Raghav Gulati committed Mar 26, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 8cc74d63aa202f4c2f653875821c7417e37ba011
17 changes: 15 additions & 2 deletions pkg/types/gossip/message.proto
Original file line number Diff line number Diff line change
@@ -5,6 +5,8 @@ package gossip;

// Envelope contains a marshalled Message as the payload
// and a signature over the payload as signature.
// It also contains the Identities of the sender and receiver.
// Optionally may contain an encrypted Envelope (in which case the payload will be empty).
message Envelope {
// A Marshaled GossipMessage
bytes payload = 1;
@@ -16,21 +18,32 @@ message Envelope {
// Signature of the message
bytes signature = 4;

EncryptedEnvelope encrypted_envelope = 5;
Copy link
Contributor

Choose a reason for hiding this comment

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

If the encrypted envelope is at the end, should the payload also be at the end? Seems like it will make it easier to see that these are related.

Copy link
Contributor

Choose a reason for hiding this comment

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

Reiterating this because I think it got collapsed incorrectly:

If the encrypted envelope is at the end, should the payload also be at the end? Seems like it will make it easier to see that these are related.


// TODO: this envelope needs an enum detailing which type of GossipMesssage it is.
}

// EncryptedEnvelope is a marshalled encrypted message.
message EncryptedEnvelope {
bytes payload = 1;
Copy link
Contributor Author

@rargulati rargulati Mar 22, 2018

Choose a reason for hiding this comment

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

Need to introduce message that will be stuffed into payload.

bytes signature = 4;
}

message Identity {
// TODO: consolidate and remove redundant
bytes public_key = 1;
bytes bls_id = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we're still aiming at deriving the public key from the BLS id or vice versa, so we may just want to include one of these? @mhluongo did you have any specific thoughts on relationship between BLS id, public key for participation in libp2p, and staking key?

I guess one question is whether the BLS id will be stable across groups... It could be, but it doesn't have to be, and if we're looking at anonymity and such for the future, it might be ideal to design with an independent BLS id. On the flip side… BLS ids are pretty big, so passing them around with all messages could be inefficient.

Copy link
Contributor

Choose a reason for hiding this comment

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

Punted the BLS ID discussion to #61.

bytes peer_id = 3;
}

message GossipMessage {
// Channel is isomorphic to the group name as well as the pubsub channel
// Channel names are HASH(PubKey1 || ... || PubKeyN) of all valid group members.
// Channel names are Keccak(StakingPubKey1 || ... || StakingPubKeyN) of
// all valid group members.
bytes channel = 1;

// Proof that the peer that sent this message knows the channel's name.
bytes channel_MAC = 2;

// TODO: define various messages this GossipMessage can be. Use oneof.
}
}