Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Verifier Nonce Gen #343

Closed
7 tasks
Tracked by #337
ekrembal opened this issue Oct 16, 2024 · 1 comment
Closed
7 tasks
Tracked by #337

Implement Verifier Nonce Gen #343

ekrembal opened this issue Oct 16, 2024 · 1 comment
Assignees

Comments

@ekrembal
Copy link
Member

ekrembal commented Oct 16, 2024

Issue Description

We should store secret nonces in memory.

#[derive(Debug)]
pub struct NonceSession {
    pub private_key: secp256k1::SecretKey,
    pub nonces: Vec<(MuSigSecNonce, MuSigPubNonce)>,
}

#[derive(Debug)]
pub struct AllSessions {
    pub cur_id: u32,
    pub sessions: HashMap<u32, NonceSession>,
}

Add this to verifiers

    pub(crate) nonces:  Arc<Mutex<AllSessions>>

can be updated with

        let x = self.nonces;
        let mut y=  x.lock().await;
        let mut z = &mut *y;

        z.sessions.insert(z.cur_id, session);
        z.cur_id = z.cur_id + 1;

Tasks

Parts of the task:

  • Research: do we really need to store pubNonces
  • Add timestamp for nonce sessions
  • Delete nonce sessions older than 1 day when nonce_gen is called
  • generate secNonce pubNonce pairs
  • create a session with new private key
  • sign the public key with old private key
  • return the stream

Deadline of the Issue

25/10/2024

@ceyhunsen
Copy link
Member

Closed with #359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants