This document explains the specs for the client implementation of distributed key generation (DKG) for the threshold signature scheme (TSS). This logic is mostly abstracted away by the TssKeyGen class in bitcore-wallet-client/lib/tsskey.ts.
If the DKG ceremony is executed asynchronously (meaning all parties are not 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. See the exportSession() and restoreSession() methods in bitcore-wallet-client/lib/tsskey.ts for a reference.
POST /v1/tss/keygen/:id
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.
{
message: object, // Message object from the TSS keygen initJoin() or nextRound() methods
n?: number, // Number of participants. Only provided by party 0 when initiating the session
password?: string // Optional join password set by party 0 when initiating the session
}NoneGET /v1/tss/keygen/:id/:round
None{
messages?: Array, // Array of P2P or Broadcast messages ready to be given to the TSS keygen nextRound() method. Only given if ALL other-party messages are posted
publicKey?: string, // The resulting public key at the end of the session
hasKeyBackup?: boolean // Indicates if this party's encrypted key share has been backed up to the server
}POST /v1/tss/keygen/:id/store
{
publicKey?: string, // The resulting public key
encryptedKeyChain?: string, // Your encrypted key share
}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.
None
This document explains the specs for the client implementation of distributed signature generation (DSG) for the threshold signature scheme (TSS). This logic is mostly abstracted away by the TssSign class in bitcore-wallet-client/lib/tsssign.ts.
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.
POST /v1/tss/sign/:id
{
message: object // Message object from the TSS sign initJoin() or nextRound() methods
}NoneGET /v1/tss/sign/:id/:round
None{
messages?: Array, // Array of P2P or Broadcast messages ready to be given to the TSS keygen nextRound() method. Only given if ALL other-party messages are posted
signature?: // The resulting signature at the end of the session. The existence indicates the session has ended
}
