Programmatic account transfer is currently available on the Privy iOS and Android native SDKs
only.
How it works
- Your app calls a
link(orlinkWithCode) method for email, SMS, OAuth, SIWE, or SIWS. - If that login method is already linked to a different Privy user who has no other login
methods, the call fails with a transfer conflict instead of a generic link error. The conflict
carries a one-time
nonceandConflictingUserMetadatadescribing the other account. - Your app shows a confirmation prompt (e.g. “Transfer this email from display name?”) using the metadata.
- If the user confirms, your app re-proves ownership of the login method (resubmit the OTP code,
redo the OAuth flow, or re-sign the SIWE/SIWS message) and calls the corresponding
transferWithCode/transferAccountmethod with thenonce. - On success, the login method moves to the current user, and the orphaned account is deleted.
Catching the transfer conflict
On iOS, a transfer conflict is thrown as a
PrivyError with errorCode
.authenticationFailure(.accountTransferRequired(nonce:conflictingUser:)):ConflictingUserMetadata
Use these fields only to render the confirmation prompt. They identify a different Privy user, so avoid logging, persisting, or sending them to analytics.Transferring by login method
Each method requires you to re-prove ownership of the login method before the transfer nonce is accepted — a stale OTP code or signature won’t work, so re-collect it after the user confirms.transferWithCode — the code from the original linkWithCode attempt won’t work.
SMS
The nonce is tied to a fresh OTP, so send a new code to the same phone number before callingtransferWithCode — the code from the original linkWithCode attempt won’t work.
OAuth
A fresh OAuth browser flow must run to produce new credentials before the transfer can complete.SIWE (Sign-In with Ethereum)
Generate a fresh SIWE message and signature — don’t reuse the one from the originallink call.
SIWS (Sign-In with Solana)
Generate a fresh SIWS message and signature — don’t reuse the one from the originallink call.

