Skip to content
create-bsv-app
2 / 9

Your identity key

Once a wallet connects, your app knows the user's identity key: a public key, 66 hex characters starting 02 or 03. It's stable per wallet, it can't be forged, and it's safe to show. It's the closest thing BSV apps have to a user ID.

useWallet() from client/src/bsv/WalletContext.tsx gives any component the connection:

ts
const { status, identityKey, wallet, connect } = useWallet()

Your task#

In client/src/App.tsx, get identityKey from useWallet() and show the whole key once it's there (it's null until the wallet connects). Then connect in the preview.

Your task

  • Show the full identity key in your app