-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathinit.rs
More file actions
29 lines (24 loc) · 732 Bytes
/
init.rs
File metadata and controls
29 lines (24 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use serde::{Deserialize, Serialize};
use swafe_lib::crypto::vdrf::{VdrfPublicKey, VdrfSecretKeyShare};
use swafe_lib::encode::StrEncoded;
use swafe_lib::NodeId;
pub const PATH: &str = "/init";
#[derive(Serialize, Deserialize, Clone)]
pub struct OffchainSecret {
pub public_key: VdrfPublicKey,
pub secret_share: VdrfSecretKeyShare,
pub randomizer: [u8; 32],
}
impl swafe_lib::encode::Tagged for OffchainSecret {
const SEPARATOR: &'static str = "v0:offchain-secret";
}
#[derive(Serialize, Deserialize)]
pub struct Request {
pub node_id: StrEncoded<NodeId>,
pub secret: StrEncoded<OffchainSecret>,
}
#[derive(Serialize, Deserialize)]
pub struct Response {
pub success: bool,
pub message: String,
}