Skip to content

feat(pyth-lazer-publisher-sdk): Add Public key to Transactions #2700

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

Merged
merged 5 commits into from
May 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lazer/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 21 additions & 11 deletions lazer/publisher_sdk/proto/pyth_lazer_transaction.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,32 @@ 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 SignatureData signature_data = 1;

// [required] lazer transaction encoded as bytes through protobuf
optional bytes payload = 3;
optional bytes payload = 2;
Comment on lines -22 to +19
Copy link
Contributor

Choose a reason for hiding this comment

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

for my information, what is the side effect of changing these numbers?

Copy link
Contributor

Choose a reason for hiding this comment

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

It changes the wire format so once the protocol is in use we should never change it. While we're prototyping it doesn't really matter.

}

// TODO: Add public key
// 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 SignatureData {
// [required] type of signature, which determines included data needed for verifying
oneof data {
Ed25519SignatureData ed25519 = 1;
};
}

// Types of signatures supported by Pyth Lazer
enum TransactionSignatureType {
// signature is 64 bytes long
ed25519 = 0;
// 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 Ed25519SignatureData {
// [required] 64 byte signature
optional bytes signature = 1;

// [required] 32 byte public key
optional bytes public_key = 2;
}

// Transaction contianing one of the valid Lazer Transactions
Expand Down
2 changes: 1 addition & 1 deletion lazer/publisher_sdk/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Loading