Skip to content

Add bitcore-tss to BWC #3855

@kajoseph

Description

@kajoseph
Collaborator

DKG

This document explains the specs for the client implementation of distributed key generation (DKG) for the threshold signature scheme (TSS).

Asynchronous DKG

If the DKG ceremony is executed asynchronously (meaning all parties are not required to be online at the same time during the DKG), the keyGen.export() function should be used between each step to export the local session state. The session state should be securely stored and used with KeyGen.restore() for following steps.

Flow Diagram

DKG Flow

API Spec

POST /v1/tss/keygen

Initialize the KeyGen class with a seed that is the derived private key.

E.g.: given your HD master key, derive an Ethereum key along the Ethereum standard path m/44'/60'/0'/<index>. The resulting private key will be the seed for the KeyGen class.

If you are creating a session, your partyId should be 0.

If you are joining a session, the join code should have your partyId.

Request body:

{
  sessionId: string,
  message: {
    partyId: number,
    publicKey: string,
    broadcastMessages: Array<string>
  }
}

Response body:

{
  error?: string,
  result?: {
    sessionId: string
  }
}
GET /v1/tss/keygen/:id/:round

Request body:

None

Response body:

{
  error?: string,
  result?: {
    sessionId: string,
    round: number,
    messages: Array<{
      partyId: number,
      publicKey: string,
      p2pMessages: Array<string>,
      broadcastMessages: Array<string>
    }>,
  }
}
POST /v1/tss/keygen/:id

Request body:

{
  message?: { // provided during rounds
    round: number,
    partyId: number,
    publicKey: string,
    p2pMessages: Array<string>,
    broadcastMessages: Array<string>
  },
  address?: string, // provided after the final round
}

Response body:

{
  error?: string,
}
POST /v1/tss/keygen/:id/store

THIS IS A SUB-OPTIMAL ENDPOINT. We do NOT want users to be dependent on our servers for recovering their funds. However, this is a stop-gap until we have DKG recovery implemented.

Request body:

{
  keychain?: string, // keychain encrypted with seed (or perhaps a derivation of seed?)
}

Response body:

{
  error?: string,
}

DSG

Asynchronous DSG

If the DSG ceremony is executed asynchronously (meaning all signing parties are not required to be online at the same time during the DSG), the sign.export() function should be used between each step to export the local session state. The session state should be securely stored and used with Sign.restore() for following steps.

Flow Diagram

DKG Flow

API Spec

POST /v1/tss/sign

Request body:

{
  sessionId: string,
  message: {
    partyId: number,
    publicKey: string,
    broadcastMessages: Array<string>
  }
}

Response body:

{
  error?: string,
  result?: {
    sessionId: string
  }
}
GET /v1/tss/sign/:id/:round

Request body:

None

Response body:

{
  error?: string,
  result?: {
    sessionId: string,
    round: number,
    messages: Array<{
      partyId: number,
      publicKey: string,
      p2pMessages: Array<string>,
      broadcastMessages: Array<string>
    }>,
  }
}
POST /v1/tss/sign/:id

Request body:

{
  message?: { // provided during rounds
    round: number,
    partyId: number,
    publicKey: string,
    p2pMessages: Array<string>,
    broadcastMessages: Array<string>
  },
  signature?: string, // provided after the final round
}

Response body:

{
  error?: string,
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @kajoseph

      Issue actions

        Add bitcore-tss to BWC · Issue #3855 · bitpay/bitcore