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 server for Phase 2 of FROST for Zcash demos #120

Closed
8 tasks
mpguerra opened this issue Jan 23, 2024 · 0 comments · Fixed by #124, #125, #149 or #147
Closed
8 tasks

Implement server for Phase 2 of FROST for Zcash demos #120

mpguerra opened this issue Jan 23, 2024 · 0 comments · Fixed by #124, #125, #149 or #147
Assignees

Comments

@mpguerra
Copy link
Contributor

mpguerra commented Jan 23, 2024

Motivation

During the first set of demos we implemented socket based communications between the coordinator and participants with the coordinator demo acting as a server. In real world usage, the coordinator will not always be the server. Even in a restricted scenario like a single user using multiple devices, it’s unlikely that one device will be able to act as a server and the others will be able to connect to it. Thus, it makes sense to decouple the server from the coordinator.

Image

Specifications

The server will need to implement the following operations:

  • CreateNewSession
    • Input: signers identifiers
    • Output: session ID
  • SendCommitment
    • Input: session ID, identifier, SigningCommitments
    • Output: acknowledgement
  • GetSessionState
    • Input: session ID
    • Output: session state (WaitingForCommitments, CommitmentsReady, WaitingForSignatureShares, SignatureSharesReady)
  • GetCommitments
    • Input: session ID
    • Output: list of commitments
  • SendSigningPackage
    • Input: session ID, SigningPackage
    • Output: acknowledgement
  • GetSigningPackage
    • Input: session ID
    • Output: SigningPackage
  • SendSignatureShare
    • Input: session ID, identifier, SignatureShare
    • Output: acknowledgement
  • GetSignatureShares
    • Input: session ID
    • Output: list of signature shares

The server will behave as follows:

  • On CreateNewSession, generate random session ID, insert a new state into a map keyed by it.
    • State = WaitingForCommitments
  • On SendCommitment, add commitment into list.
    • If list is complete, set State = CommitmentsReady
  • On GetCommitments, send commitment list
  • On SendSigningPackage, cache the package into the state
    • set State = WaitingForSignatureShares
  • On GetSigningPackage, send the cached package
  • On SendSignatureShare, add signature share into list.
    • If list is complete, set State = SignatureSharesReady
  • On GetSignatureShares, send signature share list. Destroy session.

Implementation

The server can be an HTTP server which should make it easy for clients to integrate with.
Hyper could be used but it’s more low-level, it recommends axum or warp. Axum seems a bit easier and it integrates with tower which we use on Zebra.

@mpguerra mpguerra added this to FROST Jan 23, 2024
@mpguerra mpguerra moved this to In Progress in FROST Jan 23, 2024
@mpguerra mpguerra changed the title Implement server for FROST for Zcash Implement server for Phase 2 of FROST for Zcash demos Jan 23, 2024
@mpguerra mpguerra moved this from In Progress to Review/QA in FROST Jan 30, 2024
@mpguerra mpguerra linked a pull request Jan 31, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from Review/QA to Done in FROST Feb 12, 2024
@mpguerra mpguerra reopened this Feb 13, 2024
@mpguerra mpguerra moved this from Done to In Progress in FROST Feb 13, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in FROST Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment