diff --git a/protobufs/stacks/signer/v1/messages.proto b/protobufs/stacks/signer/v1/messages.proto index 1cc46c798..35ef81a8d 100644 --- a/protobufs/stacks/signer/v1/messages.proto +++ b/protobufs/stacks/signer/v1/messages.proto @@ -62,14 +62,14 @@ message WstsMessage { oneof id { // If this WSTS message is related to a Bitcoin signing round, this field // will be set to the related Bitcoin transaction ID. - bitcoin.BitcoinTxid id_bitcoin_txid = 12; + bitcoin.BitcoinTxid sweep = 12; // If this WSTS message is related to a rotate-keys transaction, this field // will be set to the _new_ aggregate public key being verified. - crypto.PublicKey id_rotate_key = 13; + crypto.PublicKey dkg_verification = 13; // If this WSTS message is related to a DKG round, this field will be set // to the 32-byte id determined based on the coordinator public key and // block hash, set by the coordinator. - crypto.Uint256 id_dkg = 14; + crypto.Uint256 dkg = 14; } } diff --git a/signer/src/message.rs b/signer/src/message.rs index 7d3d4d21f..05f30f180 100644 --- a/signer/src/message.rs +++ b/signer/src/message.rs @@ -228,31 +228,31 @@ pub struct BitcoinPreSignAck; #[derive(Debug, Clone, Copy, PartialEq)] pub enum WstsMessageId { /// The WSTS message is related to a Bitcoin transaction signing round. - BitcoinTxid(bitcoin::Txid), + Sweep(bitcoin::Txid), /// The WSTS message is related to a rotate key verification operation. - RotateKey(PublicKey), + DkgVerification(PublicKey), /// The WSTS message is related to a DKG round. Dkg([u8; 32]), } impl From for WstsMessageId { fn from(txid: bitcoin::Txid) -> Self { - Self::BitcoinTxid(txid) + Self::Sweep(txid) } } impl From for WstsMessageId { fn from(txid: crate::storage::model::BitcoinTxId) -> Self { - Self::BitcoinTxid(txid.into()) + Self::Sweep(txid.into()) } } impl std::fmt::Display for WstsMessageId { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { - WstsMessageId::BitcoinTxid(txid) => write!(f, "bitcoin-txid({})", txid), - WstsMessageId::RotateKey(aggregate_key) => { - write!(f, "rotate-key({})", aggregate_key) + WstsMessageId::Sweep(txid) => write!(f, "sweep({})", txid), + WstsMessageId::DkgVerification(aggregate_key) => { + write!(f, "dkg-verification({})", aggregate_key) } WstsMessageId::Dkg(id) => { write!(f, "dkg({})", hex::encode(id)) diff --git a/signer/src/proto/convert.rs b/signer/src/proto/convert.rs index 4f64f87ec..48b7ea7ab 100644 --- a/signer/src/proto/convert.rs +++ b/signer/src/proto/convert.rs @@ -1096,13 +1096,13 @@ impl From for proto::WstsMessage { proto::WstsMessage { id: Some(match value.id { - WstsMessageId::BitcoinTxid(txid) => { - wsts_message::Id::IdBitcoinTxid(proto::BitcoinTxid { - txid: Some(proto::Uint256::from(BitcoinTxId::from(txid).into_bytes())), - }) + WstsMessageId::Sweep(txid) => wsts_message::Id::Sweep(proto::BitcoinTxid { + txid: Some(proto::Uint256::from(BitcoinTxId::from(txid).into_bytes())), + }), + WstsMessageId::DkgVerification(pubkey) => { + wsts_message::Id::DkgVerification(pubkey.into()) } - WstsMessageId::RotateKey(pubkey) => wsts_message::Id::IdRotateKey(pubkey.into()), - WstsMessageId::Dkg(id) => wsts_message::Id::IdDkg(id.into()), + WstsMessageId::Dkg(id) => wsts_message::Id::Dkg(id.into()), }), inner: Some(inner), } @@ -1149,13 +1149,13 @@ impl TryFrom for WstsMessage { #[allow(deprecated)] Ok(WstsMessage { id: match value.id.required()? { - wsts_message::Id::IdBitcoinTxid(txid) => { - WstsMessageId::BitcoinTxid(BitcoinTxId::try_from(txid)?.into()) + wsts_message::Id::Sweep(txid) => { + WstsMessageId::Sweep(BitcoinTxId::try_from(txid)?.into()) } - wsts_message::Id::IdRotateKey(pubkey) => { - WstsMessageId::RotateKey(PublicKey::try_from(pubkey)?) + wsts_message::Id::DkgVerification(pubkey) => { + WstsMessageId::DkgVerification(PublicKey::try_from(pubkey)?) } - wsts_message::Id::IdDkg(id) => WstsMessageId::Dkg(id.into()), + wsts_message::Id::Dkg(id) => WstsMessageId::Dkg(id.into()), }, inner, }) diff --git a/signer/src/proto/generated/stacks.signer.v1.rs b/signer/src/proto/generated/stacks.signer.v1.rs index 3738c920e..1bb154989 100644 --- a/signer/src/proto/generated/stacks.signer.v1.rs +++ b/signer/src/proto/generated/stacks.signer.v1.rs @@ -339,16 +339,16 @@ pub mod wsts_message { /// If this WSTS message is related to a Bitcoin signing round, this field /// will be set to the related Bitcoin transaction ID. #[prost(message, tag = "12")] - IdBitcoinTxid(super::super::super::super::bitcoin::BitcoinTxid), + Sweep(super::super::super::super::bitcoin::BitcoinTxid), /// If this WSTS message is related to a rotate-keys transaction, this field /// will be set to the _new_ aggregate public key being verified. #[prost(message, tag = "13")] - IdRotateKey(super::super::super::super::crypto::PublicKey), + DkgVerification(super::super::super::super::crypto::PublicKey), /// If this WSTS message is related to a DKG round, this field will be set /// to the 32-byte id determined based on the coordinator public key and /// block hash, set by the coordinator. #[prost(message, tag = "14")] - IdDkg(super::super::super::super::crypto::Uint256), + Dkg(super::super::super::super::crypto::Uint256), } } /// Wraps an inner type with a public key and a signature, diff --git a/signer/tests/integration/transaction_signer.rs b/signer/tests/integration/transaction_signer.rs index 5702c46ba..9f0eca013 100644 --- a/signer/tests/integration/transaction_signer.rs +++ b/signer/tests/integration/transaction_signer.rs @@ -340,7 +340,7 @@ async fn new_state_machine_per_valid_sighash() { // Now for the nonce request message let mut nonce_request_msg = WstsMessage { - id: WstsMessageId::BitcoinTxid(*txid), + id: WstsMessageId::Sweep(*txid), inner: wsts::net::Message::NonceRequest(NonceRequest { dkg_id: 1, sign_id: 1,