SilentShard

sealed interface SilentShard

SilentShard - Main entry point for three-party MPC (Multi-Party Computation) operations.

SilentShard provides secure threshold signature scheme implementations for ECDSA and EdDSA with three-party computation. Enables distributed key generation, signing, pre-signing, and recovery between three parties without ever reconstructing the complete private key.

Available Implementations

Quick Start Example

// 1. Implement your secure key provider
class MySecureKeyProvider : MessageSigner {
override val verifyingKey: ByteArray
get() = loadPublicKeyFromSecureStorage()

override val masterSigningKeyType = MasterSigningKeyType.ECDSA

override fun sign(data: ByteArray): ByteArray {
return signWithSecureHardware(data) // e.g., Android Keystore, iOS Secure Enclave
}
}

// 2. Create a TrioSession for ECDSA
val session = SilentShard.ECDSA.createTrioSession(
messageSigner = MySecureKeyProvider(),
cloudVerifyingKey = "server_verifying_key_hex",
websocketConfig = WebsocketConfig(url = "wss://your-server.com/mpc"),
storageClient = yourStorageImplementation
)

// 3. Generate a distributed key
val keyshareResult = session.keygen()
val keyshare = keyshareResult.getOrThrow()

// 4. Get the public key
val publicKey = SilentShard.ECDSA.getKeysharePublicKey(keyshare).getOrThrow()

// 5. Sign a message
val signature = session.signature(
keyshare = keyshare,
message = "transaction_hash_hex",
derivationPath = "m/44'/60'/0'/0/0"
).getOrThrow()

Three-Party vs Two-Party

Trio (3-party) provides additional features over Duo (2-party):

  • Pre-signatures: Generate signatures in advance, faster signing when needed

  • Recovery: Recover lost keyshares using the other two parties

  • Enhanced Security: No single point of failure, requires 2-of-3 parties

Core Operations

All MPC operations are performed through TrioSession:

  • keygen() - Generate a new distributed key share (3-party)

  • signature() - Sign messages with distributed key

  • preSignature() - Generate pre-signature for faster signing later

  • preSignatureFinal() - Finalize pre-signature with actual message

  • keyRefresh() - Refresh existing key shares for enhanced security

  • reconcileKeyshare() - Synchronize key shares between parties

  • import() - Import existing private keys into distributed format

  • export() - Export key shares for backup

  • recovery() - Recover lost keyshare using other two parties

Master Key Provider Implementation

You must provide your own secure implementation of MessageSigner. See MessageSigner documentation for platform-specific examples:

  • Android: Keystore with biometric authentication

  • iOS: Secure Enclave integration

  • Hardware Wallets: Ledger, Trezor integration

  • Cloud: AWS KMS, Google Cloud KMS

  • Desktop: OS Keychain integration

Note: For testing purposes only, you can use the internal test provider. Never use test providers in production!

See also

for detailed operation documentation

for secure key provider implementation

Inheritors

Types

Link copied to clipboard

ECDSA implementation for secp256k1 curve signatures with three-party computation.

Link copied to clipboard

EdDSA implementation for Ed25519 curve signatures with three-party computation.

Properties

Link copied to clipboard
abstract val tss: TSS

Functions

Link copied to clipboard
open fun createTrioSession(messageSigner: MessageSigner, cloudVerifyingKey: String, networkClient: SilentShardWebsocketClient<TrioNetworkAction>, storageClient: StorageClient): TrioSession

open fun createTrioSession(messageSigner: MessageSigner, cloudVerifyingKey: String, websocketConfig: WebsocketConfig, storageClient: StorageClient): TrioSession

Creates a TrioSession using the default SilentShard websocket implementation.

open fun createTrioSession(messageSigner: MessageSigner, cloudVerifyingKey: String, storageClient: StorageClient, networkClient: NetworkClient, trioNetworkActionProvider: TrioNetworkActionProvider): TrioSession

Creates a TrioSession with custom network client and action provider.

Link copied to clipboard
open suspend fun deriveChildPublicKey(keyshare: ByteArray, derivationPath: String): Result<ByteArray>

Derives a child public key using BIP32 hierarchical deterministic derivation.

Link copied to clipboard

Generates a keypair for encrypting/decrypting keyshare backups.

Link copied to clipboard
open suspend fun getKeyshareKeyId(keyshare: ByteArray): Result<ByteArray>

Retrieves the unique identifier for a keyshare.

Link copied to clipboard
open suspend fun getKeysharePublicKey(keyshare: ByteArray): Result<ByteArray>

Extracts the public key from a keyshare.