Skip to content

Export Bitcoin Gateway functions #388

@fadeev

Description

@fadeev

Existing Bitcoin wallets DO provide signer interfaces, but they're inconsistent and incomplete. Here's the current state:

Unisat :

window.unisat = {
  getPublicKey: () => Promise<string>,
  signMessage: (message: string) => Promise<string>,
  signPsbt: (psbt: string) => Promise<string>, // :white_check_mark: PSBT support
  signTx: (tx: any) => Promise<string>
}

Xverse:

window.xverse.BitcoinProvider = {
  connect: () => Promise<{ addresses: Array<{ address: string, publicKey: string }> }>,
  signTransaction: (tx: any) => Promise<string>, // :x: No PSBT support
  signMessage: (message: string) => Promise<string>
}

Leather:

window.LeatherProvider = {
  request: (method: string, params?: any) => Promise<any> // Generic RPC
}

Current Pain Points:

  • Inconsistent PSBT Support: Only Unisat has native signPsbt() - others require workarounds
  • Public Key Access: Some wallets expose public keys, others don't
  • Network Detection: No standardized way to detect mainnet/testnet
  • Address Derivation: Each wallet handles address formats differently
    What I'm Proposing is a standardized interface that normalizes these differences.
    So, I think this isn't a new standard - it's a compatibility layer that:
  • Wraps existing wallet APIs
  • Provides consistent PSBT signing across all wallets
  • Ensures public key access is always available
  • Normalizes network detection

Benefits for ZetaChain:

  • Single interface works with Unisat, Xverse, Leather, and future wallets
  • No need to handle wallet-specific quirks in your core logic
  • Consistent PSBT signing for your TSS gateway integration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions