@stellar/freighter-api.
Flow
- Frontend detects Freighter.
- Frontend requests a challenge from the backend.
- Backend creates a one-time message with wallet, nonce, domain, network, and expiration.
- Worker signs the message with Freighter
signMessage. - Frontend submits challenge ID, wallet address, and signature.
- Backend verifies the signature with SEP-53 message hashing and returns a bearer session.
Request Challenge
Verify Challenge
Security Rules
- Challenges expire quickly.
- Nonces are one-time use.
- Signatures are never logged.
- Challenge messages include network passphrase.
- Backend verification hashes
Stellar Signed Message:\nplus the challenge message before checking the Ed25519 signature. - Sessions should be revocable before production use.