Repository: input-output-hk/mithril (rust)

Issue:
Implement the mechanism for the signature registration
## Issue
Implement the mechanism for handling the signer registration (today a `SingleSignatures` entity exchanged via `/register-signature` route) by using a `RegisterSignature` message that will be associated to the existing entity `SingleSignatures`.

## Parent Issue
#688 

Pull request description:
[693] register signature message
## Content
This PR adds a `RegisterSingleSignature` message and adapter types.

## Pre-submit checklist

- Branch
  - [X] Tests are provided (if possible)
  - [ ] Crates versions are updated (if relevant)
  - [X] Commit sequence broadly makes sense
  - [X] Key commits have useful messages
- PR
  - [ ] No clippy warnings in the CI
  - [X] Self-reviewed the diff
  - [X] Useful pull request description
  - [ ] Reviewer requested
- Documentation
  - [ ] Update README file (if relevant)
  - [ ] Update documentation website (if relevant)
  - [ ] Add dev blog post (if relevant)

## Issue(s)
<!-- The issue(s) this PR relates to or closes -->
Closes #693 


Patch:
diff --git a/Cargo.lock b/Cargo.lock
index 43a0273f8..0ad33d555 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2001,7 +2001,7 @@ dependencies = [
 
 [[package]]
 name = "mithril-aggregator"
-version = "0.2.2"
+version = "0.2.3"
 dependencies = [
  "async-trait",
  "chrono",
@@ -2060,7 +2060,7 @@ dependencies = [
 
 [[package]]
 name = "mithril-common"
-version = "0.2.2"
+version = "0.2.3"
 dependencies = [
  "async-trait",
  "bech32",
@@ -2123,7 +2123,7 @@ dependencies = [
 
 [[package]]
 name = "mithril-signer"
-version = "0.2.2"
+version = "0.2.3"
 dependencies = [
  "async-trait",
  "clap 4.1.1",
diff --git a/mithril-aggregator/Cargo.toml b/mithril-aggregator/Cargo.toml
index 517ecc567..da00f269d 100644
--- a/mithril-aggregator/Cargo.toml
+++ b/mithril-aggregator/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "mithril-aggregator"
-version = "0.2.2"
+version = "0.2.3"
 description = "A Mithril Aggregator server"
 authors = { workspace = true }
 edition = { workspace = true }
diff --git a/mithril-aggregator/src/http_server/routes/signatures_routes.rs b/mithril-aggregator/src/http_server/routes/signatures_routes.rs
index e5b2381b6..4e7cdabdc 100644
--- a/mithril-aggregator/src/http_server/routes/signatures_routes.rs
+++ b/mithril-aggregator/src/http_server/routes/signatures_routes.rs
@@ -21,20 +21,23 @@ fn register_signatures(
 }
 
 mod handlers {
-    use crate::dependency::MultiSignerWrapper;
     use crate::http_server::routes::reply;
     use crate::ProtocolError;
-    use mithril_common::entities;
+    use crate::{
+        dependency::MultiSignerWrapper, message_adapters::FromRegisterSingleSignatureAdapter,
+    };
+    use mithril_common::messages::RegisterSignatureMessage;
     use slog_scope::{debug, warn};
     use std::convert::Infallible;
     use warp::http::StatusCode;
 
     /// Register Signatures
     pub async fn register_signatures(
-        signature: entities::SingleSignatures,
+        message: RegisterSignatureMessage,
         multi_signer: MultiSignerWrapper,
     ) -> Result<impl warp::Reply, Infallible> {
-        debug!("⇄ HTTP SERVER: register_signatures/{:?}", signature);
+        debug!("⇄ HTTP SERVER: register_signatures/{:?}", message);
+        let signature = FromRegisterSingleSignatureAdapter::adapt(message);
 
         let mut multi_signer = multi_signer.write().await;
         match multi_signer.register_single_signature(&signature).await {
@@ -56,8 +59,8 @@ mod tests {
     const API_SPEC_FILE: &str = "../openapi.yaml";
 
     use crate::http_server::SERVER_BASE_PATH;
+    use mithril_common::messages::RegisterSignatureMessage;
     use mithril_common::test_utils::apispec::APISpec;
-    use mithril_common::test_utils::fake_data;
     use tokio::sync::RwLock;
     use warp::http::Method;
     use warp::test::request;
@@ -91,7 +94,7 @@ mod tests {
         let (mut dependency_manager, _) = initialize_dependencies().await;
         dependency_manager.multi_signer = Arc::new(RwLock::new(mock_multi_signer));
 
-        let signatures = &fake_data::single_signatures(vec![1]);
+        let message = RegisterSignatureMessage::dummy();
 
         let method = Method::POST.as_str();
         let path = "/register-signatures";
@@ -99,14 +102,14 @@ mod tests {
         let response = request()
             .method(method)
             .path(&format!("/{}{}", SERVER_BASE_PATH, path))
-            .json(signatures)
+            .json(&message)
             .reply(&setup_router(Arc::new(dependency_manager)))
             .await;
 
         APISpec::from_file(API_SPEC_FILE)
             .method(method)
             .path(path)
-            .validate_request(&signatures)
+            .validate_request(&message)
             .unwrap()
             .validate_response(&response)
             .expect("OpenAPI error");
@@ -121,8 +124,8 @@ mod tests {
         let (mut dependency_manager, _) = initialize_dependencies().await;
         dependency_manager.multi_signer = Arc::new(RwLock::new(mock_multi_signer));
 
-        let mut signatures = fake_data::single_signatures(vec![1]);
-        signatures.signature = "invalid-signature".to_string();
+        let mut message = RegisterSignatureMessage::dummy();
+        message.signature = "invalid-signature".to_string();
 
         let method = Method::POST.as_str();
         let path = "/register-signatures";
@@ -130,14 +133,14 @@ mod tests {
         let response = request()
             .method(method)
             .path(&format!("/{}{}", SERVER_BASE_PATH, path))
-            .json(&signatures)
+            .json(&message)
             .reply(&setup_router(Arc::new(dependency_manager)))
             .await;
 
         APISpec::from_file(API_SPEC_FILE)
             .method(method)
             .path(path)
-            .validate_request(&signatures)
+            .validate_request(&message)
             .unwrap()
             .validate_response(&response)
             .expect("OpenAPI error");
@@ -145,8 +148,8 @@ mod tests {
 
     #[tokio::test]
     async fn test_register_signatures_post_ko_409() {
-        let signatures = fake_data::single_signatures(vec![1]);
-        let party_id = signatures.party_id.clone();
+        let message = RegisterSignatureMessage::dummy();
+        let party_id = message.party_id.clone();
         let mut mock_multi_signer = MockMultiSigner::new();
         mock_multi_signer
             .expect_update_current_message()
@@ -163,14 +166,14 @@ mod tests {
         let response = request()
             .method(method)
             .path(&format!("/{}{}", SERVER_BASE_PATH, path))
-            .json(&signatures)
+            .json(&message)
             .reply(&setup_router(Arc::new(dependency_manager)))
             .await;
 
         APISpec::from_file(API_SPEC_FILE)
             .method(method)
             .path(path)
-            .validate_request(&signatures)
+            .validate_request(&message)
             .unwrap()
             .validate_response(&response)
             .expect("OpenAPI error");
@@ -188,7 +191,7 @@ mod tests {
         let (mut dependency_manager, _) = initialize_dependencies().await;
         dependency_manager.multi_signer = Arc::new(RwLock::new(mock_multi_signer));
 
-        let signatures = &fake_data::single_signatures(vec![1]);
+        let message = RegisterSignatureMessage::dummy();
 
         let method = Method::POST.as_str();
         let path = "/register-signatures";
@@ -196,14 +199,14 @@ mod tests {
         let response = request()
             .method(method)
             .path(&format!("/{}{}", SERVER_BASE_PATH, path))
-            .json(signatures)
+            .json(&message)
             .reply(&setup_router(Arc::new(dependency_manager)))
             .await;
 
         APISpec::from_file(API_SPEC_FILE)
             .method(method)
             .path(path)
-            .validate_request(&signatures)
+            .validate_request(&message)
             .unwrap()
             .validate_response(&response)
             .expect("OpenAPI error");
diff --git a/mithril-aggregator/src/message_adapters/from_register_signature.rs b/mithril-aggregator/src/message_adapters/from_register_signature.rs
new file mode 100644
index 000000000..7f9bf946d
--- /dev/null
+++ b/mithril-aggregator/src/message_adapters/from_register_signature.rs
@@ -0,0 +1,26 @@
+use mithril_common::{entities::SingleSignatures, messages::RegisterSignatureMessage};
+
+pub struct FromRegisterSingleSignatureAdapter;
+
+impl FromRegisterSingleSignatureAdapter {
+    pub fn adapt(register_single_signature_message: RegisterSignatureMessage) -> SingleSignatures {
+        SingleSignatures {
+            party_id: register_single_signature_message.party_id,
+            signature: register_single_signature_message.signature,
+            won_indexes: register_single_signature_message.won_indexes,
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn test_simple_message() {
+        let message = RegisterSignatureMessage::dummy();
+        let signatures = FromRegisterSingleSignatureAdapter::adapt(message);
+
+        assert_eq!("party_id".to_string(), signatures.party_id);
+    }
+}
diff --git a/mithril-aggregator/src/message_adapters/mod.rs b/mithril-aggregator/src/message_adapters/mod.rs
index c4c89a793..001b1d27e 100644
--- a/mithril-aggregator/src/message_adapters/mod.rs
+++ b/mithril-aggregator/src/message_adapters/mod.rs
@@ -1,3 +1,5 @@
+mod from_register_signature;
 mod from_register_signer;
 
+pub use from_register_signature::FromRegisterSingleSignatureAdapter;
 pub use from_register_signer::FromRegisterSignerAdapter;
diff --git a/mithril-common/Cargo.toml b/mithril-common/Cargo.toml
index 93c99a47f..8602735b6 100644
--- a/mithril-common/Cargo.toml
+++ b/mithril-common/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "mithril-common"
-version = "0.2.2"
+version = "0.2.3"
 authors = { workspace = true }
 edition = { workspace = true }
 documentation = { workspace = true }
diff --git a/mithril-common/src/messages/mod.rs b/mithril-common/src/messages/mod.rs
index e11b46b34..1adb9cbc2 100644
--- a/mithril-common/src/messages/mod.rs
+++ b/mithril-common/src/messages/mod.rs
@@ -1,5 +1,7 @@
 //! Messages module
 //! This module aims at providing shared structures for API communications.
+mod register_signature;
 mod register_signer;
 
+pub use register_signature::RegisterSignatureMessage;
 pub use register_signer::RegisterSignerMessage;
diff --git a/mithril-common/src/messages/register_signature.rs b/mithril-common/src/messages/register_signature.rs
new file mode 100644
index 000000000..5975e981a
--- /dev/null
+++ b/mithril-common/src/messages/register_signature.rs
@@ -0,0 +1,57 @@
+use serde::{Deserialize, Serialize};
+
+use crate::entities::{HexEncodedSingleSignature, LotteryIndex, PartyId};
+
+/// Message structure to register single signature.
+#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
+pub struct RegisterSignatureMessage {
+    /// The unique identifier of the signer
+    pub party_id: PartyId,
+
+    /// The single signature of the digest
+    pub signature: HexEncodedSingleSignature,
+
+    /// The indexes of the won lotteries that lead to the single signatures
+    #[serde(rename = "indexes")]
+    pub won_indexes: Vec<LotteryIndex>,
+}
+
+impl RegisterSignatureMessage {
+    #[cfg(any(test, feature = "test_only"))]
+    /// Return a dummy test entity (test-only).
+    pub fn dummy() -> Self {
+        Self {
+            party_id: "party_id".to_string(),
+            signature: "7b227369676d61223a5b3137312c3139352c3234322c3235332c3137392c32352c3138372c3135312c3132322c3133302c3230372c3132322c38342c3132352c3134322c3132332c3233352c3134312c3230362c3136392c382c3136302c3138382c36382c35312c3232302c3232342c3231312c3137312c3230372c3231362c3139332c3230352c3139312c3233372c3131312c3232392c3132392c3131392c36362c3134342c3234382c3235322c39322c3234372c35382c37312c39355d2c22706b223a7b22766b223a5b3134332c3136312c3235352c34382c37382c35372c3230342c3232302c32352c3232312c3136342c3235322c3234382c31342c35362c3132362c3138362c3133352c3232382c3138382c3134352c3138312c35322c3230302c39372c39392c3231332c34362c302c3139392c3139332c38392c3138372c38382c32392c3133352c3137332c3234342c38362c33362c38332c35342c36372c3136342c362c3133372c39342c37322c362c3130352c3132382c3132382c39332c34382c3137362c31312c342c3234362c3133382c34382c3138302c3133332c39302c3134322c3139322c32342c3139332c3131312c3134322c33312c37362c3131312c3131302c3233342c3135332c39302c3230382c3139322c33312c3132342c39352c3130322c34392c3135382c39392c35322c3232302c3136352c39342c3235312c36382c36392c3132312c31362c3232342c3139345d2c22706f70223a5b3136382c35302c3233332c3139332c31352c3133362c36352c37322c3132332c3134382c3132392c3137362c33382c3139382c3230392c34372c32382c3230342c3137362c3134342c35372c3235312c34322c32382c36362c37362c38392c39372c3135382c36332c35342c3139382c3139342c3137362c3133352c3232312c31342c3138352c3139372c3232352c3230322c39382c3234332c37342c3233332c3232352c3134332c3135312c3134372c3137372c3137302c3131372c36362c3136352c36362c36322c33332c3231362c3233322c37352c36382c3131342c3139352c32322c3130302c36352c34342c3139382c342c3136362c3130322c3233332c3235332c3234302c35392c3137352c36302c3131372c3134322c3131342c3134302c3132322c31372c38372c3131302c3138372c312c31372c31302c3139352c3135342c31332c3234392c38362c35342c3232365d7d2c227061727479223a302c227374616b65223a3832362c22696e646578223a332c2270617468223a7b2276616c756573223a5b5b3235332c3135382c3135382c3232322c3233352c3137302c3137362c3139392c33332c3230302c36362c32362c3231312c3137392c3132362c3232362c35352c3234302c3138322c33302c3234362c3231352c37362c3135382c31362c3131342c342c3231392c36322c3131352c3235332c322c3139322c3231392c3135322c3137352c3131322c34352c36392c3131322c36382c3139352c31372c34342c3230352c3230342c37382c3233342c3130362c3234362c3230392c33312c3230302c3137312c3130382c32372c3136352c35382c3232392c37342c35382c3139312c3132352c3231385d2c5b3130382c39382c35322c3137372c3131332c3132392c3139342c37312c3133352c3137342c37342c3230352c38392c3137352c312c3230382c3234362c3136312c3132322c3233312c33302c3137382c32362c3234312c39382c35322c3133322c31342c33372c302c3138312c3232342c3130332c34362c3130312c3232322c3139392c36312c3231372c31322c39322c3231362c3139302c3131352c3233362c3134322c3138322c3235332c38312c32352c3138392c342c3235302c35382c34352c3234332c38302c37332c3130322c38332c32342c3130392c3131312c3138305d2c5b3138302c3230382c3234392c35312c3231362c3133352c34342c3134342c372c3132392c36302c36332c3234342c3130342c33362c3232392c34332c31312c3132332c38362c3131352c3131322c3138342c3230382c3135392c3138352c37332c31302c3136392c32372c39362c3231382c39392c3135322c3138312c36362c3230312c36302c3135342c31342c3231312c39342c3232392c3135382c3230382c3136362c3233302c37362c32332c3131382c3137382c3230382c38372c3131372c3233302c31392c3233312c32392c3230362c35382c3232352c32322c39352c3130335d5d2c22696e646578223a302c22686173686572223a6e756c6c7d7d".to_string(),
+            won_indexes: vec![1, 3],
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    fn golden_message() -> RegisterSignatureMessage {
+        RegisterSignatureMessage {
+            party_id: "party_id".to_string(),
+            signature: "7b227369676d61223a5b3137312c3139352c3234322c3235332c3137392c32352c3138372c3135312c3132322c3133302c3230372c3132322c38342c3132352c3134322c3132332c3233352c3134312c3230362c3136392c382c3136302c3138382c36382c35312c3232302c3232342c3231312c3137312c3230372c3231362c3139332c3230352c3139312c3233372c3131312c3232392c3132392c3131392c36362c3134342c3234382c3235322c39322c3234372c35382c37312c39355d2c22706b223a7b22766b223a5b3134332c3136312c3235352c34382c37382c35372c3230342c3232302c32352c3232312c3136342c3235322c3234382c31342c35362c3132362c3138362c3133352c3232382c3138382c3134352c3138312c35322c3230302c39372c39392c3231332c34362c302c3139392c3139332c38392c3138372c38382c32392c3133352c3137332c3234342c38362c33362c38332c35342c36372c3136342c362c3133372c39342c37322c362c3130352c3132382c3132382c39332c34382c3137362c31312c342c3234362c3133382c34382c3138302c3133332c39302c3134322c3139322c32342c3139332c3131312c3134322c33312c37362c3131312c3131302c3233342c3135332c39302c3230382c3139322c33312c3132342c39352c3130322c34392c3135382c39392c35322c3232302c3136352c39342c3235312c36382c36392c3132312c31362c3232342c3139345d2c22706f70223a5b3136382c35302c3233332c3139332c31352c3133362c36352c37322c3132332c3134382c3132392c3137362c33382c3139382c3230392c34372c32382c3230342c3137362c3134342c35372c3235312c34322c32382c36362c37362c38392c39372c3135382c36332c35342c3139382c3139342c3137362c3133352c3232312c31342c3138352c3139372c3232352c3230322c39382c3234332c37342c3233332c3232352c3134332c3135312c3134372c3137372c3137302c3131372c36362c3136352c36362c36322c33332c3231362c3233322c37352c36382c3131342c3139352c32322c3130302c36352c34342c3139382c342c3136362c3130322c3233332c3235332c3234302c35392c3137352c36302c3131372c3134322c3131342c3134302c3132322c31372c38372c3131302c3138372c312c31372c31302c3139352c3135342c31332c3234392c38362c35342c3232365d7d2c227061727479223a302c227374616b65223a3832362c22696e646578223a332c2270617468223a7b2276616c756573223a5b5b3235332c3135382c3135382c3232322c3233352c3137302c3137362c3139392c33332c3230302c36362c32362c3231312c3137392c3132362c3232362c35352c3234302c3138322c33302c3234362c3231352c37362c3135382c31362c3131342c342c3231392c36322c3131352c3235332c322c3139322c3231392c3135322c3137352c3131322c34352c36392c3131322c36382c3139352c31372c34342c3230352c3230342c37382c3233342c3130362c3234362c3230392c33312c3230302c3137312c3130382c32372c3136352c35382c3232392c37342c35382c3139312c3132352c3231385d2c5b3130382c39382c35322c3137372c3131332c3132392c3139342c37312c3133352c3137342c37342c3230352c38392c3137352c312c3230382c3234362c3136312c3132322c3233312c33302c3137382c32362c3234312c39382c35322c3133322c31342c33372c302c3138312c3232342c3130332c34362c3130312c3232322c3139392c36312c3231372c31322c39322c3231362c3139302c3131352c3233362c3134322c3138322c3235332c38312c32352c3138392c342c3235302c35382c34352c3234332c38302c37332c3130322c38332c32342c3130392c3131312c3138305d2c5b3138302c3230382c3234392c35312c3231362c3133352c34342c3134342c372c3132392c36302c36332c3234342c3130342c33362c3232392c34332c31312c3132332c38362c3131352c3131322c3138342c3230382c3135392c3138352c37332c31302c3136392c32372c39362c3231382c39392c3135322c3138312c36362c3230312c36302c3135342c31342c3231312c39342c3232392c3135382c3230382c3136362c3233302c37362c32332c3131382c3137382c3230382c38372c3131372c3233302c31392c3233312c32392c3230362c35382c3232352c32322c39352c3130335d5d2c22696e646578223a302c22686173686572223a6e756c6c7d7d".to_string(),
+            won_indexes: vec![1, 3],
+        }
+    }
+
+    // Test the retro compatibility with possible future upgrades.
+    #[test]
+    fn test_v1() {
+        let json = r#"{
+"party_id": "party_id",
+"signature":  "7b227369676d61223a5b3137312c3139352c3234322c3235332c3137392c32352c3138372c3135312c3132322c3133302c3230372c3132322c38342c3132352c3134322c3132332c3233352c3134312c3230362c3136392c382c3136302c3138382c36382c35312c3232302c3232342c3231312c3137312c3230372c3231362c3139332c3230352c3139312c3233372c3131312c3232392c3132392c3131392c36362c3134342c3234382c3235322c39322c3234372c35382c37312c39355d2c22706b223a7b22766b223a5b3134332c3136312c3235352c34382c37382c35372c3230342c3232302c32352c3232312c3136342c3235322c3234382c31342c35362c3132362c3138362c3133352c3232382c3138382c3134352c3138312c35322c3230302c39372c39392c3231332c34362c302c3139392c3139332c38392c3138372c38382c32392c3133352c3137332c3234342c38362c33362c38332c35342c36372c3136342c362c3133372c39342c37322c362c3130352c3132382c3132382c39332c34382c3137362c31312c342c3234362c3133382c34382c3138302c3133332c39302c3134322c3139322c32342c3139332c3131312c3134322c33312c37362c3131312c3131302c3233342c3135332c39302c3230382c3139322c33312c3132342c39352c3130322c34392c3135382c39392c35322c3232302c3136352c39342c3235312c36382c36392c3132312c31362c3232342c3139345d2c22706f70223a5b3136382c35302c3233332c3139332c31352c3133362c36352c37322c3132332c3134382c3132392c3137362c33382c3139382c3230392c34372c32382c3230342c3137362c3134342c35372c3235312c34322c32382c36362c37362c38392c39372c3135382c36332c35342c3139382c3139342c3137362c3133352c3232312c31342c3138352c3139372c3232352c3230322c39382c3234332c37342c3233332c3232352c3134332c3135312c3134372c3137372c3137302c3131372c36362c3136352c36362c36322c33332c3231362c3233322c37352c36382c3131342c3139352c32322c3130302c36352c34342c3139382c342c3136362c3130322c3233332c3235332c3234302c35392c3137352c36302c3131372c3134322c3131342c3134302c3132322c31372c38372c3131302c3138372c312c31372c31302c3139352c3135342c31332c3234392c38362c35342c3232365d7d2c227061727479223a302c227374616b65223a3832362c22696e646578223a332c2270617468223a7b2276616c756573223a5b5b3235332c3135382c3135382c3232322c3233352c3137302c3137362c3139392c33332c3230302c36362c32362c3231312c3137392c3132362c3232362c35352c3234302c3138322c33302c3234362c3231352c37362c3135382c31362c3131342c342c3231392c36322c3131352c3235332c322c3139322c3231392c3135322c3137352c3131322c34352c36392c3131322c36382c3139352c31372c34342c3230352c3230342c37382c3233342c3130362c3234362c3230392c33312c3230302c3137312c3130382c32372c3136352c35382c3232392c37342c35382c3139312c3132352c3231385d2c5b3130382c39382c35322c3137372c3131332c3132392c3139342c37312c3133352c3137342c37342c3230352c38392c3137352c312c3230382c3234362c3136312c3132322c3233312c33302c3137382c32362c3234312c39382c35322c3133322c31342c33372c302c3138312c3232342c3130332c34362c3130312c3232322c3139392c36312c3231372c31322c39322c3231362c3139302c3131352c3233362c3134322c3138322c3235332c38312c32352c3138392c342c3235302c35382c34352c3234332c38302c37332c3130322c38332c32342c3130392c3131312c3138305d2c5b3138302c3230382c3234392c35312c3231362c3133352c34342c3134342c372c3132392c36302c36332c3234342c3130342c33362c3232392c34332c31312c3132332c38362c3131352c3131322c3138342c3230382c3135392c3138352c37332c31302c3136392c32372c39362c3231382c39392c3135322c3138312c36362c3230312c36302c3135342c31342c3231312c39342c3232392c3135382c3230382c3136362c3233302c37362c32332c3131382c3137382c3230382c38372c3131372c3233302c31392c3233312c32392c3230362c35382c3232352c32322c39352c3130335d5d2c22696e646578223a302c22686173686572223a6e756c6c7d7d",
+"indexes": [1, 3]
+}"#;
+        let message: RegisterSignatureMessage = serde_json::from_str(json).expect(
+            "This JSON is expected to be succesfully parsed into a RegisterSignatureMessage instance.",
+        );
+
+        assert_eq!(golden_message(), message);
+    }
+}
diff --git a/mithril-signer/Cargo.toml b/mithril-signer/Cargo.toml
index 9a8e7e265..ad1e278a7 100644
--- a/mithril-signer/Cargo.toml
+++ b/mithril-signer/Cargo.toml
@@ -1,6 +1,6 @@
 [package]
 name = "mithril-signer"
-version = "0.2.2"
+version = "0.2.3"
 description = "A Mithril Signer"
 authors = { workspace = true }
 edition = { workspace = true }
diff --git a/mithril-signer/src/certificate_handler.rs b/mithril-signer/src/certificate_handler.rs
index 47214283f..7a178ca61 100644
--- a/mithril-signer/src/certificate_handler.rs
+++ b/mithril-signer/src/certificate_handler.rs
@@ -12,7 +12,7 @@ use mithril_common::{
 #[cfg(test)]
 use mockall::automock;
 
-use crate::ToRegisterSignerMessageAdapter;
+use crate::{message_adapters::ToRegisterSignatureMessageAdapter, ToRegisterSignerMessageAdapter};
 
 /// Error structure for the Certificate Handler.
 #[derive(Error, Debug)]
@@ -200,9 +200,11 @@ impl CertificateHandler for CertificateHandlerHTTPClient {
     ) -> Result<(), CertificateHandlerError> {
         debug!("Register signatures");
         let url = format!("{}/register-signatures", self.aggregator_endpoint);
+        let register_single_signature_message =
+            ToRegisterSignatureMessageAdapter::adapt(signatures.to_owned());
         let response = self
             .prepare_request_builder(Client::new().post(url.clone()))
-            .json(signatures)
+            .json(&register_single_signature_message)
             .send()
             .await;
 
diff --git a/mithril-signer/src/message_adapters/mod.rs b/mithril-signer/src/message_adapters/mod.rs
index 0c290e0c5..b01150b0d 100644
--- a/mithril-signer/src/message_adapters/mod.rs
+++ b/mithril-signer/src/message_adapters/mod.rs
@@ -1,3 +1,5 @@
+mod to_register_signature_message_adapter;
 mod to_register_signer_message_adapter;
 
+pub use to_register_signature_message_adapter::ToRegisterSignatureMessageAdapter;
 pub use to_register_signer_message_adapter::ToRegisterSignerMessageAdapter;
diff --git a/mithril-signer/src/message_adapters/to_register_signature_message_adapter.rs b/mithril-signer/src/message_adapters/to_register_signature_message_adapter.rs
new file mode 100644
index 000000000..e6984fb86
--- /dev/null
+++ b/mithril-signer/src/message_adapters/to_register_signature_message_adapter.rs
@@ -0,0 +1,29 @@
+use mithril_common::entities::SingleSignatures;
+use mithril_common::messages::RegisterSignatureMessage;
+
+pub struct ToRegisterSignatureMessageAdapter;
+
+impl ToRegisterSignatureMessageAdapter {
+    pub fn adapt(single_signature: SingleSignatures) -> RegisterSignatureMessage {
+        RegisterSignatureMessage {
+            party_id: single_signature.party_id,
+            signature: single_signature.signature,
+            won_indexes: single_signature.won_indexes,
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use mithril_common::test_utils::fake_data;
+
+    use super::*;
+
+    #[test]
+    fn adapt_ok() {
+        let single_signature = fake_data::single_signatures([1, 3].to_vec());
+        let message = ToRegisterSignatureMessageAdapter::adapt(single_signature);
+
+        assert_eq!("party_id".to_string(), message.party_id);
+    }
+}
diff --git a/openapi.yaml b/openapi.yaml
index 28d2bd3e3..9ec60f611 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -226,7 +226,7 @@ paths:
         content:
           application/json:
             schema:
-              $ref: "#/components/schemas/SingleSignatures"
+              $ref: "#/components/schemas/RegisterSingleSignatureMessage"
       responses:
         "201":
           description: signatures registration succeeded
@@ -404,10 +404,10 @@ components:
         - $ref: "#/components/schemas/Signer"
         - $ref: "#/components/schemas/Stake"
 
-    SingleSignatures:
+    RegisterSingleSignatureMessage:
       description: |
-        SingleSignatures represent single signatures originating from a participant in the network for a digest 
-        associated with the list of the won indexes in the lottery
+          This message holds a Signer Single Signature with the
+          list of won indexes in the lottery.
       type: object
       additionalProperties: false
       required:


Test patch:
diff --git a/mithril-test-lab/mithril-end-to-end/src/main.rs b/mithril-test-lab/mithril-end-to-end/src/main.rs
index bd3b605f4..f636e1545 100644
--- a/mithril-test-lab/mithril-end-to-end/src/main.rs
+++ b/mithril-test-lab/mithril-end-to-end/src/main.rs
@@ -43,7 +43,7 @@ pub struct Args {
     cardano_slot_length: f64,
 
     /// Length of a Cardano epoch in the devnet (in s)
-    #[clap(long, default_value_t = 45.0)]
+    #[clap(long, default_value_t = 60.0)]
     cardano_epoch_length: f64,
 }