pyth_lazer_transaction.proto 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. syntax = "proto3";
  2. package pyth_lazer;
  3. import "publisher_update.proto";
  4. import "governance_instruction.proto";
  5. // if any fields marked as [required] are missing, transaction will be rejected
  6. // if signature does not match payload bytes, transaction will be rejected
  7. // Signed transaction for lazer
  8. // Payload should be created on the publisher side and encoded as bytes.
  9. // Resulting bytes should then be signed with the signature scheme specified.
  10. // The signed lazer transaction is encoded as bytes and sent to Pyth Lazer Relayer.
  11. message SignedLazerTransaction {
  12. // [required] signature with public key
  13. optional SignatureData signature_data = 1;
  14. // [required] lazer transaction payload encoded as bytes.
  15. //
  16. // If the signature data is a Ed25519SignatureData, the payload is the encoded
  17. // LazerTransaction protobuf message.
  18. //
  19. // If the signature data is a WormholeMultiSigData, the payload is the encoded
  20. // Wormhole VAA body. The Wormhole VAA can be any of the following:
  21. // 1. A governance message from Pyth that updates Lazer state (e.g. a new feed) which
  22. // is an ecoded GovernancePayload according to xc-admin spec which contains the
  23. // encoded GovernanceInstruction protobuf message.
  24. // 2. A governance message from Wormhole that updates Wormhole guardian set which follows
  25. // the Wormhole specification.
  26. optional bytes payload = 2;
  27. }
  28. // Signature for encoded payload along with the relevant public keys to verify against it
  29. // Public key should successfully verify payload
  30. // Pyth Lazer will maintain a list of valid public keys
  31. // Passed public key should be present in publisher's list of valid keys
  32. message SignatureData {
  33. // [required] type of signature, which determines included data needed for verifying
  34. oneof data {
  35. Ed25519SignatureData ed25519 = 1;
  36. WormholeMultiSigData wormholeMultiSig = 2;
  37. };
  38. }
  39. // Wormhole multisig data which is the proto encoding of the VAA
  40. // header taken from the following wire format:
  41. // https://github.com/wormhole-foundation/wormhole/blob/main/whitepapers/0001_generic_message_passing.md
  42. message WormholeMultiSigData {
  43. // [required] Protocol version of the entire VAA.
  44. optional int32 version = 1;
  45. // [required] GuardianSetIndex is the index of the guardian set that signed
  46. // this VAA. Signatures are verified against the public keys in the
  47. // guardian set.
  48. optional int32 guardianSetIndex = 2;
  49. // Signatures contain a list of signatures made by the guardian set.
  50. repeated WormholeGuardianSignature signatures = 3;
  51. }
  52. // Wormhole multisig signature
  53. message WormholeGuardianSignature {
  54. // [required] Index of the guardian that signed the transaction
  55. optional int32 index = 1;
  56. // [required] 65 byte eccdsa signature
  57. optional bytes signature = 2;
  58. }
  59. // ED25519 style signature. Should include a single signature and a single public key
  60. // Signature will be verified using public key after determining public key is valid
  61. message Ed25519SignatureData {
  62. // [required] 64 byte signature
  63. optional bytes signature = 1;
  64. // [required] 32 byte public key
  65. optional bytes public_key = 2;
  66. }
  67. // Transaction contianing one of the valid Lazer Transactions
  68. message LazerTransaction {
  69. // [required] valid transaction types supported by pyth lazer
  70. oneof payload {
  71. // Expected transaction sent by Publishers
  72. // May contain many individual updates to various feeds
  73. PublisherUpdate publisher_update = 1;
  74. // Sent by governance.
  75. GovernanceInstruction governance_instruction = 2;
  76. }
  77. }