Auth Modal
Bitcoin Wallet

Bitcoin Wallet

Bitcoin-first social wallet for the BTC community. Social login via Web3Auth (key export) → derive Taproot / SegWit / Legacy / Nested SegWit → balance, PSBT, Ordinals, BRC-20, Runes.

@web5nexus/authmodal-bitcoin@0.1.2

Why a solo Bitcoin package?

Connect Modal can optionally derive BTC after EVM login. The solo package is for Bitcoin-native products: dedicated modal, selectable address types, and protocol hooks without an EVM-first UX.

Requires Web3Auth dashboard key export enabled. Other Auth Modal adapters do not export keys for BTC derivation.

Install

npm install @web5nexus/authmodal-bitcoin @web5nexus/authmodal-core
import '@web5nexus/authmodal-web3auth/polyfill' // before other imports
import {
  bitcoinOptimizeDeps,
  bitcoinProcessPolyfillPlugin,
  bitcoinViteAliases,
} from '@web5nexus/authmodal-bitcoin/vite'
import '@web5nexus/authmodal-bitcoin/styles.css'

Headless

import { bitcoinAuth } from '@web5nexus/authmodal-bitcoin'
 
const btc = bitcoinAuth({
  clientId: process.env.W3A_CLIENT_ID!,
  bitcoinNetwork: 'mainnet',
  addressTypes: ['taproot', 'segwit', 'legacy', 'nested-segwit'],
  prefer: 'taproot',
})
 
const session = await btc.connect({ method: 'google' })
console.log(session.addresses.primary) // bc1p…
const balance = await btc.getBalance() // sats

More patterns (email OTP, React hooks without the Bitcoin modal): Headless / custom UI.

React + solo modal

import '@web5nexus/authmodal-bitcoin/styles.css'
import {
  BitcoinWalletProvider,
  BitcoinConnectButton,
  useBitcoinModal,
  useBitcoinWallet,
  usePsbt,
} from '@web5nexus/authmodal-bitcoin/react'
 
export default function App() {
  return (
    <BitcoinWalletProvider
      clientId={process.env.NEXT_PUBLIC_W3A_CLIENT_ID!}
      bitcoinNetwork="testnet"
      addressTypes={['taproot', 'segwit']}
      prefer="taproot"
      theme={{
        mode: 'dark',
        appName: 'Web5 Bitcoin',
        subtitle: 'Bitcoin Social Login',
        accentColor: '#f7931a',
        accentTextColor: '#1a1208',
      }}
    >
      <BitcoinConnectButton />
      {/* or: useBitcoinModal().openModal() */}
    </BitcoinWalletProvider>
  )
}

Theme

FieldDefault
modedark (light / dark / auto)
appNameBitcoin Wallet
appLogoWeb5 Nexus logo
subtitleBitcoin Social Login
accentColor#f7931a
surfaceColor / textColor / …Mode defaults

Footer always shows Powered by Web5 Nexus (with logo).

Hooks

HookRole
useBitcoinWalletsession, addresses, connect, balance, export WIF
useBitcoinModalopenModal / closeModal
usePsbtbuild, sign, broadcast
useOrdinals / useBrc20 / useRunesProtocol helpers via @web5nexus/bitcoin-core

Address types

IdScriptPrefix
taprootP2TRbc1p…
segwitP2WPKHbc1q…
legacyP2PKH1…
nested-segwitP2SH-P2WPKH3…

Same secp256k1 key from social login; types are encodings, not separate wallets.

Security

  • Private keys stay in memory only for the session
  • Prefer usePsbt over exporting keys in production UIs
  • Explicit exportWif() / exportPrivateKey() — never persisted by the SDK

Try it

Loading Bitcoin lab…