diff --git a/protobufs/stacks/signer/v1/requests.proto b/protobufs/stacks/signer/v1/requests.proto index b223d3ce..8dbe553e 100644 --- a/protobufs/stacks/signer/v1/requests.proto +++ b/protobufs/stacks/signer/v1/requests.proto @@ -18,19 +18,29 @@ message BitcoinTransactionSignRequest { message StacksTransactionSignRequest { // The aggregate public key that will sign the transaction. crypto.PublicKey aggregate_key = 1; - // The contract call transaction to sign. - // pub contract_call: ContractCall, // The nonce to use for the transaction. - uint64 nonce = 3; + uint64 nonce = 2; // The transaction fee in microSTX. - uint64 tx_fee = 4; - // The expected digest of the transaction than needs to be signed. - // It's essentially a hash of the contract call struct, the nonce, the - // tx_fee and a few other things. - crypto.Uint256 digest = 5; + uint64 tx_fee = 3; + // The expected digest of the transaction than needs to be signed. It's + // essentially a hash of the contract call struct, the nonce, the tx_fee + // and a few other things. + crypto.Uint256 digest = 4; + // The contract call transaction to sign. + oneof contract_call { + // The `complete-deposit` contract call + CompleteDeposit complete_deposit = 5; + // The `accept-withdrawal-request` contract call + AcceptWithdrawal accept_withdrawal = 6; + // The `reject-withdrawal-request` contract call + RejectWithdrawal reject_withdrawal = 7; + // The `rotate-keys-wrapper` contract call + RotateKeys rotate_keys = 8; + } } -// A complete-deposit contract call on Stacks. +// For making a `complete-deposit` contract call in the sbtc-deposit +// smart contract. message CompleteDeposit { // The outpoint of the bitcoin UTXO that was spent as a deposit for // sBTC. @@ -54,7 +64,8 @@ message CompleteDeposit { uint64 sweep_block_height = 7; } -// The `accept-withdrawal-request` contract call on the stacks blockchain. +// For making a `accept-withdrawal-request` contract call in the +// sbtc-withdrawal smart contract. message AcceptWithdrawal { // The ID of the withdrawal request generated by the // `initiate-withdrawal-request` function in the sbtc-withdrawal smart @@ -66,9 +77,9 @@ message AcceptWithdrawal { // The fee that was spent to the bitcoin miner when fulfilling the // withdrawal request. uint64 tx_fee = 3; - // A bitmap of how the signers voted. This structure supports up to - // 128 distinct signers. Here, we assume that a 1 (or true) implies - // that the signer voted *against* the transaction. + // A bitmap of how the signers voted. The length of the list must be less + // than or equal to 128. Here, we assume that a true implies that the + // associated signer voted *against* the withdrawal. repeated bool signer_bitmap = 4; // The address that deployed the contract. stacks.StacksAddress deployer = 5; @@ -78,3 +89,32 @@ message AcceptWithdrawal { // The block height associated with the above bitcoin block hash. uint64 sweep_block_height = 7; } + +// For making a `reject-withdrawal-request` contract call in the +// sbtc-withdrawal smart contract. +message RejectWithdrawal { + // The ID of the withdrawal request generated by the + // `initiate-withdrawal-request` function in the sbtc-withdrawal smart + // contract. + uint64 request_id = 1; + // A bitmap of how the signers voted. The length of the list must be less + // than or equal to 128. Here, we assume that a true implies that the + // associated signer voted *against* the withdrawal. + repeated bool signer_bitmap = 2; + // The address that deployed the smart contract. + stacks.StacksAddress deployer = 3; +} + +// For making a `rotate-keys-wrapper` contract call in the +// `sbtc-bootstrap-signers` smart contract. +message RotateKeys { + // The new set of public keys for all known signers during this + // PoX cycle. + repeated crypto.PublicKey new_keys = 1; + // The aggregate key created by combining the above public keys. + crypto.PublicKey aggregate_key = 2; + // The address that deployed the contract. + stacks.StacksAddress deployer = 3; + // The number of signatures required for the multi-sig wallet. + uint32 signatures_required = 4; +} diff --git a/signer/src/proto/generated/stacks.signer.v1.rs b/signer/src/proto/generated/stacks.signer.v1.rs index 6d179c79..d0549b52 100644 --- a/signer/src/proto/generated/stacks.signer.v1.rs +++ b/signer/src/proto/generated/stacks.signer.v1.rs @@ -72,21 +72,48 @@ pub struct StacksTransactionSignRequest { /// The aggregate public key that will sign the transaction. #[prost(message, optional, tag = "1")] pub aggregate_key: ::core::option::Option, - /// The contract call transaction to sign. - /// pub contract_call: ContractCall, /// The nonce to use for the transaction. - #[prost(uint64, tag = "3")] + #[prost(uint64, tag = "2")] pub nonce: u64, /// The transaction fee in microSTX. - #[prost(uint64, tag = "4")] + #[prost(uint64, tag = "3")] pub tx_fee: u64, - /// The expected digest of the transaction than needs to be signed. - /// It's essentially a hash of the contract call struct, the nonce, the - /// tx_fee and a few other things. - #[prost(message, optional, tag = "5")] + /// The expected digest of the transaction than needs to be signed. It's + /// essentially a hash of the contract call struct, the nonce, the tx_fee + /// and a few other things. + #[prost(message, optional, tag = "4")] pub digest: ::core::option::Option, + /// The contract call transaction to sign. + #[prost( + oneof = "stacks_transaction_sign_request::ContractCall", + tags = "5, 6, 7, 8" + )] + pub contract_call: ::core::option::Option< + stacks_transaction_sign_request::ContractCall, + >, } -/// A complete-deposit contract call on Stacks. +/// Nested message and enum types in `StacksTransactionSignRequest`. +pub mod stacks_transaction_sign_request { + /// The contract call transaction to sign. + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum ContractCall { + /// The `complete-deposit` contract call + #[prost(message, tag = "5")] + CompleteDeposit(super::CompleteDeposit), + /// The `accept-withdrawal-request` contract call + #[prost(message, tag = "6")] + AcceptWithdrawal(super::AcceptWithdrawal), + /// The `reject-withdrawal-request` contract call + #[prost(message, tag = "7")] + RejectWithdrawal(super::RejectWithdrawal), + /// The `rotate-keys-wrapper` contract call + #[prost(message, tag = "8")] + RotateKeys(super::RotateKeys), + } +} +/// For making a `complete-deposit` contract call in the sbtc-deposit +/// smart contract. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CompleteDeposit { @@ -120,7 +147,8 @@ pub struct CompleteDeposit { #[prost(uint64, tag = "7")] pub sweep_block_height: u64, } -/// The `accept-withdrawal-request` contract call on the stacks blockchain. +/// For making a `accept-withdrawal-request` contract call in the +/// sbtc-withdrawal smart contract. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AcceptWithdrawal { @@ -137,9 +165,9 @@ pub struct AcceptWithdrawal { /// withdrawal request. #[prost(uint64, tag = "3")] pub tx_fee: u64, - /// A bitmap of how the signers voted. This structure supports up to - /// 128 distinct signers. Here, we assume that a 1 (or true) implies - /// that the signer voted *against* the transaction. + /// A bitmap of how the signers voted. The length of the list must be less + /// than or equal to 128. Here, we assume that a true implies that the + /// associated signer voted *against* the withdrawal. #[prost(bool, repeated, tag = "4")] pub signer_bitmap: ::prost::alloc::vec::Vec, /// The address that deployed the contract. @@ -155,3 +183,41 @@ pub struct AcceptWithdrawal { #[prost(uint64, tag = "7")] pub sweep_block_height: u64, } +/// For making a `reject-withdrawal-request` contract call in the +/// sbtc-withdrawal smart contract. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RejectWithdrawal { + /// The ID of the withdrawal request generated by the + /// `initiate-withdrawal-request` function in the sbtc-withdrawal smart + /// contract. + #[prost(uint64, tag = "1")] + pub request_id: u64, + /// A bitmap of how the signers voted. The length of the list must be less + /// than or equal to 128. Here, we assume that a true implies that the + /// associated signer voted *against* the withdrawal. + #[prost(bool, repeated, tag = "2")] + pub signer_bitmap: ::prost::alloc::vec::Vec, + /// The address that deployed the smart contract. + #[prost(message, optional, tag = "3")] + pub deployer: ::core::option::Option, +} +/// For making a `rotate-keys-wrapper` contract call in the +/// `sbtc-bootstrap-signers` smart contract. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct RotateKeys { + /// The new set of public keys for all known signers during this + /// PoX cycle. + #[prost(message, repeated, tag = "1")] + pub new_keys: ::prost::alloc::vec::Vec, + /// The aggregate key created by combining the above public keys. + #[prost(message, optional, tag = "2")] + pub aggregate_key: ::core::option::Option, + /// The address that deployed the contract. + #[prost(message, optional, tag = "3")] + pub deployer: ::core::option::Option, + /// The number of signatures required for the multi-sig wallet. + #[prost(uint32, tag = "4")] + pub signatures_required: u32, +} diff --git a/signer/src/proto/mod.rs b/signer/src/proto/mod.rs index 36411cfa..8ee2b970 100644 --- a/signer/src/proto/mod.rs +++ b/signer/src/proto/mod.rs @@ -2,6 +2,7 @@ mod generated; pub use generated::crypto::*; +pub use generated::stacks::signer::v1::stacks_transaction_sign_request::*; pub use generated::stacks::signer::v1::*; pub use generated::stacks::signer::*; pub use generated::stacks::*;