Spark is a Bitcoin Layer 2 network that uses an identity key system for on-chain addressing. Turnkey supports Spark address derivation and signing via plain BIP-340 Schnorr signatures. The supported address formats are:Documentation Index
Fetch the complete documentation index at: https://turnkey-0e7c1f5b-omkar-spark-phase2-docs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
| Network | Address Format | HRP |
|---|---|---|
| Mainnet | ADDRESS_FORMAT_SPARK_MAINNET | spark |
| Regtest | ADDRESS_FORMAT_SPARK_REGTEST | sparkrt |
BIP-32 derivation path
Spark uses a unique BIP-32 purpose number (8797555) rather than the standard BIP-44 coin type system. The default derivation path for the identity key is:
ADDRESS_FORMAT_SPARK_MAINNET or ADDRESS_FORMAT_SPARK_REGTEST and the path will be set automatically.
Only
secp256k1 keys are supported for Spark. Attempting to use an ed25519 key will result in an error.Schnorr signing
Spark transactions are signed using plain BIP-340 Schnorr — specifically, without the Taproot key tweak described here that Bitcoin P2TR addresses require. This is an important distinction: passing a Spark address as thesignWith parameter to SIGN_RAW_PAYLOAD triggers plain Schnorr signing, while passing a Bitcoin Taproot (P2TR) address triggers tweaked Schnorr signing per BIP-341.
Use the SIGN_RAW_PAYLOAD or SIGN_RAW_PAYLOAD_V2 activity to sign Spark payloads. The hashFunction field should match how the payload was prepared (e.g. HASH_FUNCTION_NO_OP if you are passing a pre-hashed payload).
The returned signature will always have V = "00" since Schnorr signatures do not use a recovery ID.
Signing scheme selection
Turnkey automatically selects the correct signing scheme based on the address format associated with your key:| Address type | Signing scheme |
|---|---|
| Bitcoin P2TR | Tweaked Schnorr (BIP-341) |
| Spark Mainnet/Regtest | Plain Schnorr (BIP-340) |
| All others | ECDSA |
Networks supported
- Spark Mainnet —
ADDRESS_FORMAT_SPARK_MAINNET - Spark Regtest —
ADDRESS_FORMAT_SPARK_REGTEST
Key features
- secp256k1 signing: Turnkey fully supports the secp256k1 curve used by Spark
- Plain BIP-340 Schnorr: Distinct from the tweaked Schnorr used for Bitcoin Taproot — no key tweak is applied
- Bech32m addressing: Spark identity key addresses are Bech32m-encoded canonical protobuf payloads
- Spark-specific BIP-32 purpose: Derivation path uses purpose
8797555per the Spark protocol spec
Spark-specific API activities
In addition toSIGN_RAW_PAYLOAD, Turnkey exposes four Spark-specific activities for enclave-protected FROST signing, key transfers, and Lightning receives. All private key material and secret shares remain inside the Turnkey enclave throughout.
| Activity | Description |
|---|---|
SPARK_SIGN_FROST | Generate a FROST partial signature for one or more Bitcoin transaction sighashes. Supports batching — branch + exit at deposit time, or up to 6 refund transactions per transfer. |
SPARK_PREPARE_TRANSFER | Compute key tweaks, Feldman-split them for Spark Operators, ECIES-encrypt the receiver’s new leaf key, and ECDSA-sign the transfer payload. |
SPARK_CLAIM_TRANSFER | Verify the sender’s signature, ECIES-decrypt the leaf key ciphertext, derive the receiver’s new HD leaf key, and produce encrypted claim packages for Spark Operators. |
SPARK_PREPARE_LIGHTNING_RECEIVE | Generate a random payment preimage inside the enclave, Feldman-split it for Spark Operators, and return only the paymentHash for BOLT11 invoice construction. |
CREATE_WALLET_ACCOUNTS activity with Spark-specific BIP-32 paths.
Flows
For step-by-step details on every Turnkey-integrated Spark operation — including which activities to call, what parameters to pass, and what the enclave does at each step — see the Spark flows reference:- Deposit: Bitcoin L1 → Spark
- Cooperative Withdrawal: Spark → Bitcoin L1
- Unilateral Exit (Emergency)
- Initiate Transfer: Spark → Spark
- Claim Transfer: Spark → Spark
- Lightning Receive
- Static Deposit: Bitcoin L1 → Spark
- Static Deposit Claim
SDK Example
examples/with-spark-schnorr: demonstrates wallet initialization, SO authentication and token minting + sending on Spark using Turnkey!