SmartAccountUtils

Utility functions for Smart Account operations.

Provides cryptographic utilities for WebAuthn signature processing, public key extraction, and contract address derivation.

Functions

Link copied to clipboard
suspend fun deriveContractAddress(credentialId: ByteArray, deployerPublicKey: String, networkPassphrase: String): String

Derives the smart account contract address from a credential ID and deployer.

Link copied to clipboard
fun extractPublicKeyFromRegistration(publicKey: ByteArray? = null, authenticatorData: ByteArray? = null, attestationObject: ByteArray? = null): ByteArray

Extracts the secp256r1 public key from a WebAuthn registration response using multiple fallback strategies.

Link copied to clipboard
suspend fun getContractSalt(credentialId: ByteArray): ByteArray

Computes the contract salt from a WebAuthn credential ID.

Link copied to clipboard

Normalizes a DER-encoded secp256r1 signature to compact format with low-S normalization.