From 37f6a6abc66413d19f4ab3220e399f705776d128 Mon Sep 17 00:00:00 2001 From: Darun Seethammagari Date: Thu, 15 May 2025 14:05:08 -0700 Subject: [PATCH 1/5] add public key and support more types of signatures --- .../proto/pyth_lazer_transaction.proto | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto b/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto index f10a8e6c6e..39c12ebf5e 100644 --- a/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto +++ b/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto @@ -12,22 +12,22 @@ import "governance_instruction.proto"; // Resulting bytes should then be signed with the signature scheme specified. // The signed lazer transaction is encoded as bytes and sent to Pyth Lazer Relayer. message SignedLazerTransaction { - // [required] specifies the type of signature used to sign the payload - optional TransactionSignatureType signature_type = 1; - - // [required] signature derived from signing payload bytes - optional bytes signature = 2; + // [required] signature with public key + optional SignatureWithPublicKey signature_with_public_key = 1; // [required] lazer transaction encoded as bytes through protobuf - optional bytes payload = 3; + optional bytes payload = 2; +} - // TODO: Add public key +message SignatureWithPublicKey { + oneof signing_type { + Ed25519 ed25519 = 1; + }; } -// Types of signatures supported by Pyth Lazer -enum TransactionSignatureType { - // signature is 64 bytes long - ed25519 = 0; +message Ed25519 { + optional bytes signature = 1; + optional bytes public_key = 2; } // Transaction contianing one of the valid Lazer Transactions From d006c1d9b262875ac6fb5b25c1ee84abe0db96a5 Mon Sep 17 00:00:00 2001 From: Darun Seethammagari Date: Thu, 15 May 2025 14:10:42 -0700 Subject: [PATCH 2/5] add comments --- lazer/publisher_sdk/proto/pyth_lazer_transaction.proto | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto b/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto index 39c12ebf5e..bb55ea91b8 100644 --- a/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto +++ b/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto @@ -19,14 +19,24 @@ message SignedLazerTransaction { optional bytes payload = 2; } +// Signature for encoded payload along with the relevant public keys to verify against it +// Public key should successfully verify payload +// Pyth Lazer will maintain a list of valid public keys +// Passed public key should be present in publisher's list of valid keys message SignatureWithPublicKey { + // [required] type of signature, which determines included data needed for verifying oneof signing_type { Ed25519 ed25519 = 1; }; } +// ED25519 style signature. Should include a single signature and a single public key +// Signature will be verified using public key after determining public key is valid message Ed25519 { + // [required] 64 byte signature optional bytes signature = 1; + + // [required] 32 byte public key optional bytes public_key = 2; } From bb0f4d7fee1cf5bd50de5d41534e106add64312d Mon Sep 17 00:00:00 2001 From: Darun Seethammagari Date: Thu, 15 May 2025 15:34:07 -0700 Subject: [PATCH 3/5] rename some fields --- lazer/publisher_sdk/proto/pyth_lazer_transaction.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto b/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto index bb55ea91b8..5d677b6bea 100644 --- a/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto +++ b/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto @@ -13,7 +13,7 @@ import "governance_instruction.proto"; // The signed lazer transaction is encoded as bytes and sent to Pyth Lazer Relayer. message SignedLazerTransaction { // [required] signature with public key - optional SignatureWithPublicKey signature_with_public_key = 1; + optional SignatureData signature_data = 1; // [required] lazer transaction encoded as bytes through protobuf optional bytes payload = 2; @@ -23,9 +23,9 @@ message SignedLazerTransaction { // Public key should successfully verify payload // Pyth Lazer will maintain a list of valid public keys // Passed public key should be present in publisher's list of valid keys -message SignatureWithPublicKey { +message SignatureData { // [required] type of signature, which determines included data needed for verifying - oneof signing_type { + oneof data { Ed25519 ed25519 = 1; }; } From 1b3922ee52866ee464f37e76678c43cf4dc8f1ff Mon Sep 17 00:00:00 2001 From: Darun Seethammagari Date: Thu, 15 May 2025 18:45:42 -0700 Subject: [PATCH 4/5] rename signature type to be more explicit --- lazer/publisher_sdk/proto/pyth_lazer_transaction.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto b/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto index 5d677b6bea..39798dcd46 100644 --- a/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto +++ b/lazer/publisher_sdk/proto/pyth_lazer_transaction.proto @@ -26,13 +26,13 @@ message SignedLazerTransaction { message SignatureData { // [required] type of signature, which determines included data needed for verifying oneof data { - Ed25519 ed25519 = 1; + Ed25519SignatureData ed25519 = 1; }; } // ED25519 style signature. Should include a single signature and a single public key // Signature will be verified using public key after determining public key is valid -message Ed25519 { +message Ed25519SignatureData { // [required] 64 byte signature optional bytes signature = 1; From d5e3b61381e9989990e45983861b7daa597b923f Mon Sep 17 00:00:00 2001 From: Darun Seethammagari Date: Fri, 16 May 2025 10:51:52 -0700 Subject: [PATCH 5/5] bump version --- lazer/Cargo.lock | 2 +- lazer/publisher_sdk/rust/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lazer/Cargo.lock b/lazer/Cargo.lock index 725f54488a..e7ab10911c 100644 --- a/lazer/Cargo.lock +++ b/lazer/Cargo.lock @@ -3882,7 +3882,7 @@ dependencies = [ [[package]] name = "pyth-lazer-publisher-sdk" -version = "0.1.2" +version = "0.1.3" dependencies = [ "anyhow", "fs-err", diff --git a/lazer/publisher_sdk/rust/Cargo.toml b/lazer/publisher_sdk/rust/Cargo.toml index bc8cfbb578..665a3c22d0 100644 --- a/lazer/publisher_sdk/rust/Cargo.toml +++ b/lazer/publisher_sdk/rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyth-lazer-publisher-sdk" -version = "0.1.2" +version = "0.1.3" edition = "2021" description = "Pyth Lazer Publisher SDK types." license = "Apache-2.0"