Expand description
Services for handling JSON-RPC requests.
Some methods send notifications to connected clients, see the method’s documentation for more details.
Notifications sent to connected clients are sent as a tuple
of String
event name followed by an arbitrary JSON Value
payload for the event.
§Methods
These are the JSON-RPC methods clients may call; some methods will broadcast events to connected clients, see the documentation for each method for more information.
§Group.create
label
: Human-friendlyString
label for the group.parameters
: Parameters for key generation and signing.
Create a new group; the client that calls this method automatically joins the group.
Returns the UUID for the group.
§Group.join
group_id
: TheString
UUID for the group.
Register the calling client as a member of the group.
Returns the group object.
§Session.create
group_id
: TheString
UUID for the group.kind
: TheString
kind of session (eitherkeygen
orsign
).
Create a new session.
Returns the session object.
§Session.join
group_id
: TheString
UUID for the group.session_id
: TheString
UUID for the session.kind
: TheString
kind of session (eitherkeygen
orsign
).
Join an existing session.
Returns the session object.
§Session.signup
group_id
: TheString
UUID for the group.session_id
: TheString
UUID for the session.kind
: TheString
kind of session (eitherkeygen
orsign
).
Register as a co-operating party for a session.
When the required number of parties have signed up to a session a sessionSignup
event is emitted to all the clients in the session. For key generation there must be parties
clients in the session and for signing there must be threshold + 1
clients registered for the session.
Returns the party signup number.
§Session.load
group_id
: TheString
UUID for the group.session_id
: TheString
UUID for the session.kind
: TheString
kind of session (must bekeygen
).number
: Theu16
party signup number.
Load a client into a given slot (party signup number). This is used to allow the party signup numbers allocated to saved key shares to be assigned and validated in the context of a session.
The given number
must be in range and must be an available slot.
When the required number of parties
have been allocated to a session a sessionLoad
event is emitted to all the clients in the session.
Returns the party signup number.
§Session.participant
group_id
: TheString
UUID for the group.session_id
: TheString
UUID for the session.index
: Theu16
party index.number
: Theu16
party signup number.
Provide a mapping between receiver indices for a signing session so that the server can locate the connection identifier when relaying peer to peer messages.
When signing clients must provide an array of the indices used during DKG, the party index is the index (plus one) of each client’s local key index in that array. This is the value that the server sees as the receiver when relaying peer to peer messages but the server has no knowledge of this index so client’s must register a mapping from the party index to the server-issued party number so that the correct connection id can be resolved.
Returns an empty response to the caller.
§Session.message
group_id
: TheString
UUID for the group.session_id
: TheString
UUID for the session.kind
: TheString
kind of session (eitherkeygen
orsign
).message
: The message to broadcast or send peer to peer.
Relay a message to all the other peers in the session (broadcast) or send directly to another peer.
A message
is treated as peer to peer when the receiver
field is present which should be the party signup number
for the peer for a keygen session or the party index for a signing session.
This method is a notification and does not return anything to the caller.
§Session.finish
group_id
: TheString
UUID for the group.session_id
: TheString
UUID for the session.number
: Theu16
party signup number.
Indicate the session has been finished for the calling client.
When all the clients in a session have called this method the server will emit a sessionClosed
event to all the clients in the session.
This method is a notification and does not return anything to the caller.
Structs§
- Service
Handler - Service for replying to client requests.
Enums§
- Service
Error - Error thrown by the JSON-RPC services.
Constants§
- CLOSE_
CONNECTION - Error data indicating the connection should be closed.
- GROUP_
CREATE - Method to create a group.
- GROUP_
JOIN - Method to join a group.
- SESSION_
CLOSED_ EVENT - Notification sent when a session has been marked as finished by all participating clients.
- SESSION_
CREATE - Method to create a session.
- SESSION_
CREATE_ EVENT - Notification sent when a session has been created.
- SESSION_
FINISH - Method to indicate a session is finished.
- SESSION_
JOIN - Method to join a session.
- SESSION_
LOAD - Method to load a party number into a session.
- SESSION_
LOAD_ EVENT - Notification sent when all parties have loaded a party signup number into a session.
- SESSION_
MESSAGE - Method to broadcast or relay a message peer to peer.
- SESSION_
MESSAGE_ EVENT - Notification sent to clients with broadcast or peer to peer messages.
- SESSION_
PARTICIPANT - Register a participant lookup for a signing session.
- SESSION_
SIGNUP - Method to signup a session.
- SESSION_
SIGNUP_ EVENT - Notification sent when all expected parties have signed up to a session.