Exportable Ed25519
ExportableEd25519 scheme implementation providing functionality for a variant of the FROST MPC protocol.
This class handles cryptographic operations using Ed25519 keys with enhanced exportability features, including:
Key generation via multi-party computation (MPC)
Distributed signing of messages
Secret share refreshing
Key resharing
Key import/export
Unlike the regular Ed25519 implementation, ExportableEd25519 provides functions specifically designed for exportability scenarios, with two distinct methods for key generation: sampleKey for the party initiating the key generation, and receiveKey for parties receiving the key.
Example Usage
// Server side creates a room for 3 parties using API_KEY
val numParties = 3
val threshold = 2
val apiKey = "MY_API_KEY"
val keygenRoomUuid = createRoom(numParties, apiKey)
// All parties call initKeygen to get key generation IDs
val keygenInitResult = initKeygen()
// All parties receive keygenIds from other parties
val keygenIds = listOf("keygenId1", "keygenId2")
// The party initiating the key generation calls sampleKey
val keygenResultInitiator = sampleKey(
keygenRoomUuid,
numParties,
threshold,
keygenInitResult.keygenSecret,
keygenIds
)
// Other parties call receiveKey
val keygenResultReceiver = receiveKey(
keygenRoomUuid,
numParties,
threshold,
keygenInitResult.keygenSecret,
keygenIds
)
// To sign a message, create a signing room on the server side
val signingRoomUuid = createRoom(threshold, apiKey)
val message = "Hello, world!".toByteArray()
// Threshold parties join the signing room
val signature = sign(signingRoomUuid, keygenResult.secretShare, message)Functions
Creates a room for multi-party computation.
Exports a full exportable Ed25519 private key.
Gets an export ID from an exportable Ed25519 secret share.
Gets the public key from an exportable Ed25519 secret share.
Imports an exportable Ed25519 private key (importer).
Imports an exportable Ed25519 private key (recipient).
Initializes key generation for MPC protocols.
This is the main key generation function used in the Scheme interface. For ExportableEd25519, it's recommended to use sampleKey and receiveKey directly instead, as they better represent the asymmetric nature of the protocol.
Exports a full exportable Ed25519 private key offline.
Generates exportable Ed25519 keys using multi-party computation (for key receivers).
Refreshes the exportable Ed25519 secret share.
Reshares an exportable Ed25519 key for a new party.
Reshares an exportable Ed25519 key for a remaining party.
Generates exportable Ed25519 keys using multi-party computation (for key initiator).
Signs a message using exportable Ed25519 and multi-party computation.