What Is Injected Provider API (Signet)?
The OKX Injected Providers API (Signet) is a JavaScript model embedded by OKX into websites, enabling DApps to:
- Request account details
- Read blockchain data
- Facilitate message/transaction signing
Note: BTC Signet requires OKX Extension v2.82.32 or higher.
Core Functions
1. Connect Wallet
okxwallet.bitcoinSignet.connect()Returns:
address(string): Active account addresspublicKey(string): Account public key
Example Use Case:
Initialize wallet access before transaction signing.
2. Sign Messages
okxwallet.bitcoinSignet.signMessage(signStr[, type])Parameters:
signStr: Data to signtype(optional):"ecdsa"(default) or"bip322-simple"
Returns:
- Signature string (Promise)
Best Practice: Use BIP-322 for Taproot compatibility.
3. Sign PSBT Transactions
okxwallet.bitcoinSignet.signPsbt(psbtHex[, options])Key Parameters:
psbtHex: Hex string of PSBToptions:autoFinalized: Auto-finalize PSBT (default:true)toSignInputs: Specify inputs to sign (index + address/publicKey)
Note: Include publicKey for Taproot inputs.
Returns:
- Signed PSBT hex (Promise)
4. Batch Sign PSBTs
okxwallet.bitcoinSignet.signPsbts(psbtHexs[, options])Parameters:
psbtHexs: Array of PSBT hex stringsoptions: Per-PSBT signing rules (same assignPsbt)
Returns:
- Array of signed PSBT hex strings (Promise)
FAQ
Q1: Which OKX versions support BTC Signet?
A: Extension v2.82.32 or newer.
Q2: How to handle Taproot address signing?
A: Always include publicKey in PSBT inputs.
Q3: Can I disable auto-finalization?
A: Yes, set autoFinalized: false in options.
Q4: What’s the default message signing method?
A: ECDSA (override with "bip322-simple" for advanced use).
SEO Keywords
- Bitcoin Signet API
- PSBT signing
- OKX wallet integration
- DApp development
- Taproot transactions
- Blockchain provider
- BTC Signet