Derives the secp256k1 private key of an EVM account from a PRF output. The PRF output is the entropy of a BIP-39 phrase, and the key sits at the BIP-44 path m/44'/60'/0'/0/{accountIndex} of the phrase’s BIP-32 key tree.
Derives the private key of an EVM account from a PRF output.
@param ― options - PRF output and account index.
@returns ― A 32-byte secp256k1 private key.
@remarks ―
The PRF output is the entropy of a 24-word BIP-39 phrase from the English
wordlist, and the phrase's seed uses an empty passphrase. The key is the
BIP-32 key at m/44'/60'/0'/0/{accountIndex} under that seed. Wallet apps
such as MetaMask use the same path, so importing the phrase into one shows
the same accounts.
The phrase exists as a JavaScript string, which cannot be zeroed, and
@scure/bip32 leaves the intermediate keys and chain codes unzeroed.
Derives the private key of an EVM account from a PRF output.
@param ― options - PRF output and account index.
@returns ― A 32-byte secp256k1 private key.
@remarks ―
The PRF output is the entropy of a 24-word BIP-39 phrase from the English
wordlist, and the phrase's seed uses an empty passphrase. The key is the
BIP-32 key at m/44'/60'/0'/0/{accountIndex} under that seed. Wallet apps
such as MetaMask use the same path, so importing the phrase into one shows
the same accounts.
The phrase exists as a JavaScript string, which cannot be zeroed, and
@scure/bip32 leaves the intermediate keys and chain codes unzeroed.
Requests a passkey PRF evaluation and returns the first output.
@param ― options - Passkey PRF request inputs.
@returns ― The selected credential ID and first WebAuthn PRF output.
@remarks ―
Runs one assertion ceremony and shows one user-verification prompt.
With immediate, Chrome 148 and later (as of 2026-10) and the React Native
client show nothing when the device holds no passkey for rpId. Browsers
without immediate mode ignore the option and show their usual prompt.
Without a user gesture, or in Incognito, Chrome rejects an immediate request
with the same error even when a passkey exists.
The WebAuthn challenge is generated internally.
The default salt is sha256("mera.prf.salt.v1") and will not change across
library versions. The PRF output is a deterministic function of the
credential, rpId, and salt; a different salt yields an unrelated output.
The assertion requires user verification, and the requirement is not
configurable. User verification is the authenticator's local check; the
gesture depends on the platform (a biometric, a device PIN, or a password).
Authenticators built on CTAP's hmac-secret keep two PRFs per credential,
one for user-verified requests and one for the rest; WebAuthn exposes only
the user-verified PRF and overrides a weaker userVerification setting
when evaluating it, so a configurable setting could neither change the PRF
output nor skip the check.
@throws ― MeraError with code PRF_UNAVAILABLE when the authenticator does not return a usable 32-byte PRF output.
@throws ― MeraError with code INPUT_INVALID when an explicit prfSalt is not 32 bytes, credential.credentialId is empty or not canonical base64url, or immediate is combined with credential.
@throws ― MeraError with code CRYPTO_UNAVAILABLE when crypto.getRandomValues is unavailable.
@throws ― MeraError with code PASSKEY_CANCELLED when the person dismisses the prompt, it times out, or no passkey answers, including an immediate request that finds none.
@throws ― MeraError with code PASSKEY_OPERATION_FAILED when WebAuthn is unavailable, fails for another reason, or returns an unexpected credential.
Requests a passkey PRF evaluation and returns the first output.
@param ― options - Passkey PRF request inputs.
@returns ― The selected credential ID and first WebAuthn PRF output.
@remarks ―
Runs one assertion ceremony and shows one user-verification prompt.
With immediate, Chrome 148 and later (as of 2026-10) and the React Native
client show nothing when the device holds no passkey for rpId. Browsers
without immediate mode ignore the option and show their usual prompt.
Without a user gesture, or in Incognito, Chrome rejects an immediate request
with the same error even when a passkey exists.
The WebAuthn challenge is generated internally.
The default salt is sha256("mera.prf.salt.v1") and will not change across
library versions. The PRF output is a deterministic function of the
credential, rpId, and salt; a different salt yields an unrelated output.
The assertion requires user verification, and the requirement is not
configurable. User verification is the authenticator's local check; the
gesture depends on the platform (a biometric, a device PIN, or a password).
Authenticators built on CTAP's hmac-secret keep two PRFs per credential,
one for user-verified requests and one for the rest; WebAuthn exposes only
the user-verified PRF and overrides a weaker userVerification setting
when evaluating it, so a configurable setting could neither change the PRF
output nor skip the check.
@throws ― MeraError with code PRF_UNAVAILABLE when the authenticator does not return a usable 32-byte PRF output.
@throws ― MeraError with code INPUT_INVALID when an explicit prfSalt is not 32 bytes, credential.credentialId is empty or not canonical base64url, or immediate is combined with credential.
@throws ― MeraError with code CRYPTO_UNAVAILABLE when crypto.getRandomValues is unavailable.
@throws ― MeraError with code PASSKEY_CANCELLED when the person dismisses the prompt, it times out, or no passkey answers, including an immediate request that finds none.
@throws ― MeraError with code PASSKEY_OPERATION_FAILED when WebAuthn is unavailable, fails for another reason, or returns an unexpected credential.
Derives the private key of an EVM account from a PRF output.
@param ― options - PRF output and account index.
@returns ― A 32-byte secp256k1 private key.
@remarks ―
The PRF output is the entropy of a 24-word BIP-39 phrase from the English
wordlist, and the phrase's seed uses an empty passphrase. The key is the
BIP-32 key at m/44'/60'/0'/0/{accountIndex} under that seed. Wallet apps
such as MetaMask use the same path, so importing the phrase into one shows
the same accounts.
The phrase exists as a JavaScript string, which cannot be zeroed, and
@scure/bip32 leaves the intermediate keys and chain codes unzeroed.
A typed array of 8-bit unsigned integer values. The contents are initialized to 0. If the
requested number of bytes could not be allocated an exception is raised.
Uint8Array<
interface ArrayBuffer
Represents a raw buffer of binary data, which is used to store data for the
different typed arrays. ArrayBuffers cannot be read from or written to directly,
but can be passed to a typed array or DataView Object to interpret the raw
buffer as needed.
The phrase uses the English wordlist, and its seed uses an empty passphrase. Wallet apps such as MetaMask derive EVM accounts from the same path, so importing the phrase into one shows the same accounts.
mera derives the key with @scure/bip39 and @scure/bip32, as HDKey.fromMasterSeed(mnemonicToSeedSync(entropyToMnemonic(prfOutput, wordlist))).derive(path).privateKey. The phrase exists as a JavaScript string, which cannot be zeroed, and @scure/bip32 leaves the intermediate keys and chain codes unzeroed.