SilentShard

sealed interface SilentShard

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

SilentShard provides secure threshold signature scheme implementations for ECDSA and EdDSA. It enables distributed key generation, signing, and key management between two parties without ever reconstructing the complete private key.

Available Implementations

Quick Start Example

// 1. Implement your secure key provider (example: Android Keystore)
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 DuoSession for ECDSA
val session = SilentShard.ECDSA.createDuoSession(
messageSigner = MySecureKeyProvider(),
cloudVerifyingKey = "peer_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()

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!

Core Operations

All MPC operations are performed through DuoSession:

  • keygen() - Generate a new distributed key share

  • signature() - Sign messages with distributed key

  • 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

  • verifyBackup() - Verify integrity of exported backups

See also

for detailed operation documentation

Inheritors

Types

Link copied to clipboard

ECDSA implementation for secp256k1 curve signatures.

Link copied to clipboard

EdDSA implementation for Ed25519 curve signatures.

Functions

Link copied to clipboard
abstract 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
abstract suspend fun getKeyshareKeyId(keyshare: ByteArray): Result<ByteArray>

Retrieves the unique identifier for a keyshare.

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

Extracts the public key from a keyshare.