Skip to content

Commit cf61e90

Browse files
authored
feat(pyth-lazer-publisher-sdk): Add Public key to Transactions (#2700)
* add public key and support more types of signatures * add comments * rename some fields * rename signature type to be more explicit * bump version
1 parent 0295874 commit cf61e90

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

lazer/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lazer/publisher_sdk/proto/pyth_lazer_transaction.proto

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,32 @@ import "governance_instruction.proto";
1212
// Resulting bytes should then be signed with the signature scheme specified.
1313
// The signed lazer transaction is encoded as bytes and sent to Pyth Lazer Relayer.
1414
message SignedLazerTransaction {
15-
// [required] specifies the type of signature used to sign the payload
16-
optional TransactionSignatureType signature_type = 1;
17-
18-
// [required] signature derived from signing payload bytes
19-
optional bytes signature = 2;
15+
// [required] signature with public key
16+
optional SignatureData signature_data = 1;
2017

2118
// [required] lazer transaction encoded as bytes through protobuf
22-
optional bytes payload = 3;
19+
optional bytes payload = 2;
20+
}
2321

24-
// TODO: Add public key
22+
// Signature for encoded payload along with the relevant public keys to verify against it
23+
// Public key should successfully verify payload
24+
// Pyth Lazer will maintain a list of valid public keys
25+
// Passed public key should be present in publisher's list of valid keys
26+
message SignatureData {
27+
// [required] type of signature, which determines included data needed for verifying
28+
oneof data {
29+
Ed25519SignatureData ed25519 = 1;
30+
};
2531
}
2632

27-
// Types of signatures supported by Pyth Lazer
28-
enum TransactionSignatureType {
29-
// signature is 64 bytes long
30-
ed25519 = 0;
33+
// ED25519 style signature. Should include a single signature and a single public key
34+
// Signature will be verified using public key after determining public key is valid
35+
message Ed25519SignatureData {
36+
// [required] 64 byte signature
37+
optional bytes signature = 1;
38+
39+
// [required] 32 byte public key
40+
optional bytes public_key = 2;
3141
}
3242

3343
// Transaction contianing one of the valid Lazer Transactions

lazer/publisher_sdk/rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "pyth-lazer-publisher-sdk"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
edition = "2021"
55
description = "Pyth Lazer Publisher SDK types."
66
license = "Apache-2.0"

0 commit comments

Comments
 (0)