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.2Why 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-coreimport '@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() // satsMore 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
| Field | Default |
|---|---|
mode | dark (light / dark / auto) |
appName | Bitcoin Wallet |
appLogo | Web5 Nexus logo |
subtitle | Bitcoin Social Login |
accentColor | #f7931a |
surfaceColor / textColor / … | Mode defaults |
Footer always shows Powered by Web5 Nexus (with logo).
Hooks
| Hook | Role |
|---|---|
useBitcoinWallet | session, addresses, connect, balance, export WIF |
useBitcoinModal | openModal / closeModal |
usePsbt | build, sign, broadcast |
useOrdinals / useBrc20 / useRunes | Protocol helpers via @web5nexus/bitcoin-core |
Address types
| Id | Script | Prefix |
|---|---|---|
taproot | P2TR | bc1p… |
segwit | P2WPKH | bc1q… |
legacy | P2PKH | 1… |
nested-segwit | P2SH-P2WPKH | 3… |
Same secp256k1 key from social login; types are encodings, not separate wallets.
Security
- Private keys stay in memory only for the session
- Prefer
usePsbtover exporting keys in production UIs - Explicit
exportWif()/exportPrivateKey()— never persisted by the SDK
Try it
Loading Bitcoin lab…