SilentShard

sealed interface SilentShard

Entry point for three-party threshold signatures.

SilentShard constructs TrioSessions and exposes the stateless helpers that operate on a keyshare's bytes. Choose the curve family through its objects:

  • ECDSA — secp256k1 signatures (Bitcoin, Ethereum, EVM chains).

  • EdDSA — Ed25519 signatures (Solana, Stellar, and similar).

The three-party (2-of-3) protocol adds capabilities over the two-party one — pre-signatures, keyshare recovery from the other two parties, and hardened child-key derivation — all exposed on TrioSession.

Constructing a session

Create the initiating side with trioInitiator on ECDSA or EdDSA. You supply a MessageSigner (your hardware-backed identity key), the peer's verifying key, a transport, and a StorageClient the SDK uses to persist keyshares.

val session = SilentShard.ECDSA.trioInitiator(
messageSigner = myMessageSigner,
cloudVerifyingKey = peerVerifyingKeyHex,
websocketConfig = WebsocketConfig(url = "wss://your-server.example.com"),
storageClient = myStorageClient,
)
val keyId = session.keygen().getOrThrow()

Session operations vs. stateless helpers

TrioSession operations are addressed by keyId and never expose keyshare bytes. The helpers here are the deliberate exception: getKeyshareKeyId, getKeysharePublicKey, and deriveChildPublicKey take the keyshare bytes you read from your own StorageClient, and run locally with no network I/O.

See also

for the operations available on a session.

for the identity-key contract you implement.

Inheritors

Types

Link copied to clipboard

Three-party ECDSA over secp256k1 — Bitcoin, Ethereum, and other EVM chains.

Link copied to clipboard

Three-party EdDSA over Ed25519 — Solana, Stellar, and other Ed25519 chains.

Properties

Link copied to clipboard
abstract val tss: TSS

The process-shared TSS instance backing the stateless helpers (getKeyshareKeyId, getKeysharePublicKey, deriveChildPublicKey, generateEncryptionDecryptionKeyPair). Sessions get their own instance via newSessionTss.

Functions

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

Derives a child public key via BIP32 hierarchical-deterministic derivation, producing many addresses from one keyshare. Runs locally.

Link copied to clipboard

Generates a keypair used to encrypt keyshare-backup material.

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

Computes the keyId of a keyshare — a deterministic identifier derived from its public key. This is the same value TrioSession.keygen and TrioSession.import return. Runs locally.

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

Extracts the public key from a keyshare, for deriving addresses or verifying signatures. Runs locally.

Link copied to clipboard
abstract fun newSessionTss(): TSS

Construct a fresh per-session TSS instance — used by the trioInitiator(...) factories so each session owns its own native-handle tracking list. The process-singleton tss is kept for stateless utilities (getKeyshareKeyId etc.); sharing it for sessions would mean the library's allocation list grows monotonically and concurrent sessions race on it.

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

Creates an initiating TrioSession over the default WebSocket transport, reusing a SilentShardWebsocketClient you construct and own — for example to share one client across sessions and com.silencelaboratories.silentshard.network.NetworkClient.close it yourself.

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

Creates a TrioSession as the initiating party, over the default WebSocket transport. The recommended entry point for most integrations.

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

Creates an initiating TrioSession over a custom transport.