generateStealthMetaAddress()
SIP Protocol API Reference v0.7.0
SIP Protocol API Reference / generateStealthMetaAddress
Function: generateStealthMetaAddress()
Section titled “Function: generateStealthMetaAddress()”generateStealthMetaAddress(
chain,label?):object
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:1333
Generate a new stealth meta-address keypair for receiving private payments
Creates a reusable meta-address that senders can use to derive one-time stealth addresses. The recipient publishes the meta-address publicly, and senders generate unique payment addresses from it.
Security: Private keys must be stored securely and never shared. The meta-address (containing only public keys) can be safely published.
Algorithm: Uses secp256k1 elliptic curve (EIP-5564 style) for:
- Ethereum, Polygon, Arbitrum, Optimism, Base, Bitcoin, Zcash
For Solana/NEAR/Aptos/Sui chains, use generateEd25519StealthMetaAddress instead.
Parameters
Section titled “Parameters”Target blockchain network (determines address format)
label?
Section titled “label?”string
Optional human-readable label for identification
Returns
Section titled “Returns”object
Object containing:
metaAddress: Public keys to share with sendersspendingPrivateKey: Secret key for claiming funds (keep secure!)viewingPrivateKey: Secret key for scanning incoming payments (keep secure!)
metaAddress
Section titled “metaAddress”metaAddress:
StealthMetaAddress
spendingPrivateKey
Section titled “spendingPrivateKey”spendingPrivateKey:
`0x${string}`
viewingPrivateKey
Section titled “viewingPrivateKey”viewingPrivateKey:
`0x${string}`
Throws
Section titled “Throws”If chain is invalid or not supported
Examples
Section titled “Examples”import { generateStealthMetaAddress, encodeStealthMetaAddress } from '@sip-protocol/sdk'
// Generate keysconst { metaAddress, spendingPrivateKey, viewingPrivateKey } = generateStealthMetaAddress('ethereum', 'My Privacy Wallet')
// Encode for sharing (QR code, website, etc.)const encoded = encodeStealthMetaAddress(metaAddress)console.log('Share this:', encoded)// Output: "sip:ethereum:0x02abc...123:0x03def...456"
// Store private keys securely (e.g., encrypted keystore)secureStorage.save({ spendingPrivateKey, viewingPrivateKey,})// Generate different stealth keys for each chainconst ethKeys = generateStealthMetaAddress('ethereum', 'ETH Privacy')const zkKeys = generateStealthMetaAddress('zcash', 'ZEC Privacy')
// Publish meta-addressespublishToProfile({ ethereum: encodeStealthMetaAddress(ethKeys.metaAddress), zcash: encodeStealthMetaAddress(zkKeys.metaAddress),})- generateStealthAddress to generate payment addresses as a sender
- encodeStealthMetaAddress to encode for sharing
- deriveStealthPrivateKey to claim funds as a recipient
- generateEd25519StealthMetaAddress for Solana/NEAR chains