An NFT marketplace developer on Solana faces a critical technical decision at the architecture stage: how to request wallet permissions without overreaching, verify user intent accurately, and ensure that the dApp integration pattern does not create authorization vulnerabilities. The wallet extension becomes the security perimeter between the marketplace smart contracts and the user’s private keys. If permissions are designed carelessly—requesting blanket approval for all token transfers, failing to scope transaction signing, or mishandling session management—the wallet may become a vector for unauthorized actions, phishing attacks, or token drains. The browser extension design of Solflare positions it as a common integration point, but that integration quality depends almost entirely on how the marketplace developer structures requests and interprets responses.

Building a secure NFT marketplace on Solana requires understanding the distinction between wallet capability and wallet authorization. A user connecting their Solflare wallet extension to a marketplace gains the ability to sign transactions, but they should never grant blanket authority to move tokens or approve transfers without explicit consent on each action. The best developers treat the wallet as a signature provider with strict permission boundaries, not as a trust-once-then-delegate infrastructure. This distinction separates a marketplace that users can audit in real time from one that creates surprise transaction fees, unexpected token transfers, or compromised private key material through a single malicious interaction.

Solflare wallet extension interface showing transaction approval with permission scoping details

Wallet discovery and connection establishment

The Solana wallet ecosystem uses the standard Wallet Adapter protocol, which allows browser-based dApps to discover available wallets through a window object. When a user clicks “Connect Wallet” on an NFT marketplace, the application queries for connected Solflare and other wallet implementations. The Solflare wallet extension exposes itself through the window.solflare interface, providing methods to request account information and signatures. This discovery pattern means the wallet does not initiate the connection; the marketplace does, and the user approves through the extension popup.

Proper connection establishment requires the marketplace to await user consent before requesting any sensitive information. A common developer mistake is to call getBalance, fetchTokenAccounts, or other state queries immediately after connection without first confirming that the user has intentionally selected the wallet. Better practice is to trigger connection through an explicit user interaction—a button click—and then listen for the wallet’s response. If the user dismisses the Solflare connection popup, the promise should reject, and the marketplace should gracefully handle the disconnected state without retrying silently or requesting the connection again without a new click.

The connection object should be treated as an active session, not a permanent authorization. If a user closes the browser tab or switches to a different wallet, the previous connection state should be cleared. For NFT marketplaces where users return across sessions, implementers sometimes cache connection state in localStorage. This is acceptable for remembering which wallet was last used, but it should not store active session tokens or authenticated credentials. Instead, each page load should re-establish the connection through the standard popup flow, allowing the user to see that reconnection is occurring and giving them the opportunity to deny it.

Testing connection stability is essential before marketplace launch. Use the browser’s developer tools to simulate wallet disconnections, observe how the marketplace handles stale references, and verify that reconnection does not trigger duplicate API calls or leave the UI in an ambiguous state. Documentation from the sites.google.com/solflare-wallet.com/solflare-wallet-extension page provides reference examples for these patterns.

Transaction signing and permission scoping

Once connected, the marketplace can request signatures on transactions. The critical principle is that each transaction should contain only the instructions necessary for a single user action. If a user is minting an NFT, the transaction should include the mint instruction and related system program calls, nothing else. If the user is listing an NFT for sale, the transaction should update the listing account and transfer the NFT to escrow, but not approve additional token transfers or execute hidden instructions. Batch transaction support exists for legitimate use cases—a user may want to mint multiple NFTs or close multiple orders in one submission—but batching should be explicit and previewed in the transaction approval screen.

The Solflare dApp integration model requires that the marketplace construct transactions and send them to the wallet for signing. The wallet does not execute transactions; it cryptographically signs them with the user’s private key, which remains in the extension storage. This means the marketplace is responsible for instruction construction, fee estimation, and sending to the Solana RPC endpoint. A developer should never construct a transaction, ask the user to sign it, then modify it afterward. Solana transactions include a recent blockhash as an anti-replay measure, and any modification invalidates the signature. If the marketplace must attach additional instructions—such as a collected fee instruction—that instruction should be visible in the transaction preview shown by Solflare before the user approves.

Permission scoping applies to both read operations and write operations. A marketplace should request the public key and network information it needs to display account balances and NFT collections, but it should not request access to seed phrase information, private keys, or encrypted backup data. The wallet extension stores these materials, but the dApp connection protocol does not expose them; this is correct security design. For write operations, request specific transaction signatures, never blanket approval to “perform any action on behalf of this wallet.”

Solana’s instruction model provides natural scoping boundaries. Each instruction specifies which accounts it touches, which are signers, and which have write authority. When a Solflare user approves a transaction, they are approving a specific list of instructions with specific accounts. If the marketplace later submits a different transaction with the same blockhash and different accounts, the signature will be invalid. This immutability is a feature, not a limitation; it prevents the marketplace from substituting a different transaction after the user has signed.

Associated Token Account management and SPL token handling

Most NFT marketplaces need to interact with user token accounts, particularly for NFT escrow, payment tokens, and marketplace-native tokens. On Solana, users do not have one token account per token; instead, they have Associated Token Accounts (ATAs) stored at a deterministic address derived from their wallet address and the token mint. This architecture has implications for marketplace design. When a user lists an NFT, the marketplace typically needs to transfer the NFT to an escrow account. If the escrow account does not exist, the transaction will fail unless it includes an instruction to create it.

NFT management wallet functionality in Solflare handles ATA creation transparently from the user’s perspective, but the marketplace developer must request it explicitly. The standard pattern is to include a createAssociatedTokenAccountIdempotent instruction in any transaction that touches an ATA that may not exist. This instruction is safe to include even if the account exists; it simply fails silently if the account is already created. The fee cost is minimal (around 0.002 SOL), and it prevents transaction failures that confuse users.

For NFT listings, consider whether the marketplace should hold NFTs in escrow directly or keep them in the user’s wallet while marking them as listed. Each approach has trade-offs. Escrow transfers make the listing visible on-chain and prevent the user from accidentally selling or transferring the NFT elsewhere; however, they require the user to sign a transaction to list and another to delist. Wallet-based listings with on-chain metadata are cheaper and faster for the user, but they require marketplace smart contracts to verify ownership at sale time, adding complexity.

Payment token handling follows the same ATA pattern. If a user is buying an NFT with a payment token that Solflare does not display natively in the wallet interface, the marketplace should handle ATA creation, token approval, and transfer as part of the purchase transaction. Token approval on Solana is different from Ethereum; instead of an approve function, the marketplace issues a token instruction that transfers the exact amount needed. This means the user is approving a specific transfer amount to a specific recipient, not an unlimited allowance. The transaction preview in Solflare will show this transfer clearly.

Preventing phishing and malicious marketplace instances

A Solflare user can connect to any website that follows the wallet adapter protocol. If a user types a phishing domain that mimics a legitimate marketplace, they will see the familiar Solflare popup, and if they approve a transaction, the wallet will sign it. The wallet extension cannot verify that the requesting dApp is the authentic marketplace; that responsibility falls on the user and the marketplace operator. However, developers can implement several protections to reduce the attack surface.

First, use HTTPS exclusively and register the domain through a registrar with DNSSEC support. A user who trusts your domain should be able to type it into the browser and reach the correct site. Second, display the connected wallet address prominently in the marketplace UI, and encourage users to verify it matches their expectations. A legitimate NFT marketplace will show the user’s public key in the top corner, so the user can confirm they are connected to the correct wallet.

Third, for high-value transactions, implement a preview screen that displays the transaction details in human-readable format before requesting the Solflare signature. Show the NFT being listed or purchased, the price, the recipient address (if it is not the user), and any fees. This doubles the verification opportunity; the user sees the details in the marketplace, and then again in the Solflare popup. If they do not match, the user should cancel and contact support.

Fourth, avoid requesting permissions that appear to authorize future transactions. Solana does not have approve functions like Ethereum, so this is less of an issue, but frameworks sometimes add unofficial patterns. If a marketplace asks the user to “approve the marketplace to trade your tokens” through a custom smart contract pattern, the user should be skeptical. The safest approach is: each transaction that moves funds should include an explicit instruction that the user can see and verify.

RPC node configuration and custom infrastructure considerations

Solflare allows users to configure custom RPC endpoints instead of using the default public RPC. For NFT marketplaces, this creates an important consideration: the marketplace should allow users to specify their preferred node, but it should not force them to use a node controlled by the marketplace. If a marketplace offers a “fast checkout with our RPC,” it is asking users to send all their transaction data—including which NFTs they are interested in and which wallets own them—to the marketplace’s infrastructure.

For most use cases, this is acceptable if disclosed transparently. A marketplace RPC is faster because it is dedicated and optimized, and if users understand the trade-off, they can consent. However, for privacy-conscious users or those trading sensitive NFT collections, the ability to fall back to a public RPC or their own node is important. Solflare’s custom RPC configuration in the extension settings lets users make this choice independently.

As a marketplace developer, ensure that your dApp works correctly whether the user has selected the default public RPC or a custom endpoint. Test transaction submission, account queries, and NFT metadata retrieval against multiple RPC providers. Public RPC endpoints can experience rate limiting, so also verify that your marketplace handles timeout errors and retries gracefully without spamming signatures requests to Solflare.

If the marketplace operates its own RPC infrastructure, use it for read operations such as fetching NFT metadata and account balances, but route signature requests through the user’s configured RPC or a neutral public endpoint. This separation reduces the marketplace’s visibility into which users are signing which transactions.

Batch transactions and complex user flows

Some NFT marketplaces benefit from batch transaction support, where a user can submit multiple related instructions in one transaction. Examples include minting a series of NFTs, swapping NFTs across multiple listings, or closing multiple orders simultaneously. Solana transactions can include many instructions as long as the total transaction size remains under 1,232 bytes and the compute budget does not exceed 1.4 million units. Batch operations can save fees and confirm atomically; either all instructions succeed or none do.

The key to safe batching is transparency. When a user initiates a batch action, the marketplace should construct all instructions, combine them into a single transaction, and present the full transaction to Solflare for signing. The wallet extension will show each instruction to the user, so they can verify the batch contains what they intended. A marketplace should not construct a batch silently on the backend and present it as a single “confirm” button without showing the instructions involved.

For complex flows like NFT swaps where user A sends an NFT to user B and user B sends an NFT to user A, the marketplace should handle this atomically through a smart contract that accepts both conditions simultaneously, or through a protocol where the marketplace acts as a trusted intermediary for a brief moment. A marketplace should never ask user A to sign a transaction that sends the NFT without confirmation that user B’s NFT has been received. If the swap fails partway through, the user’s asset is lost.

Testing batch transactions involves simulating network failures at different stages. If the first four instructions succeed but the fifth fails, what state is the user’s account in? Will a retry attempt create duplicate entries? Can the user cancel a pending batch transaction if they change their mind? These questions should be answered before the marketplace goes live.

Handling staking, governance, and advanced Solana features

Some NFT marketplaces integrate Solana staking, where users can delegate SOL to validators while keeping their NFTs. Others add governance token voting tied to NFT ownership. These features require additional transactions and introduce longer timeframes than simple transfers. If a user stakes SOL, that SOL is locked for some period; the marketplace should clearly explain the lock-up duration and provide a way to unstake or redelegate later.

When constructing staking transactions, use the proper system program calls for stake account creation and delegation. The user should see that they are creating a stake account with a specific amount of SOL and delegating to a specific validator. If the marketplace has a recommendation or partnership with a validator, that preference should be optional, not default. Allow users to choose a validator from a list of active validators or input a validator pubkey manually.

For governance voting, tie it to NFT ownership through a proof-of-ownership mechanism. A user should prove they hold a specific NFT at the time of voting, not simply approve the marketplace to vote on their behalf. Solana programs can check NFT ownership directly during transaction execution, so the user does not need to grant a separate voting approval to the marketplace.

Offline transaction signing for air-gapped security is available if users connect a Ledger hardware wallet through Solflare. For these users, every transaction requires physical confirmation on the hardware device. Marketplaces should acknowledge that hardware wallet users may experience slower interactions and provide clear feedback about where the transaction is in the approval process. A user waiting for hardware confirmation should see a message explaining that Solflare is awaiting the hardware device, not a generic “loading” spinner.

Monitoring, error handling, and user support

Once transactions are signed and submitted to the network, they enter a queue waiting for confirmation. A marketplace should track transaction status and provide feedback to the user. Solana transactions can fail for several reasons: insufficient SOL for fees, expired blockhash, instruction errors, or account state changes. If a transaction fails, the user should receive a clear error message explaining what went wrong and how to resolve it.

Common errors include attempting to list an NFT already listed, transferring an NFT that no longer exists, or submitting a transaction after the blockhash has expired (typically after 30 seconds). The marketplace should re-submit with a fresh blockhash if the user wants to retry. If the user does not retry within a minute, clear the pending transaction from the UI and require the user to initiate the action again.

Maintain logs of transaction submissions, signatures, and confirmations for support purposes. If a user claims a transaction was lost or funds disappeared, you can verify the transaction signature on-chain using a block explorer like Solscan. Never promise to reverse transactions or refund users for mistakes like sending NFTs to the wrong address; Solana is immutable. Instead, focus on preventing mistakes through clear UI, transaction previews, and address validation.

For users experiencing wallet connection issues, provide a troubleshooting guide covering browser compatibility, extension installation verification, and switching between wallets. Solflare supports Chrome and Firefox; if users report issues on other browsers, note that support is limited. If the extension stops responding, the user can reinstall it without losing funds as long as they have the seed phrase or hardware wallet backup.

Frequently asked questions

Should my NFT marketplace request blanket approval from Solflare to execute transactions?

No. Each transaction should be explicit and scoped to a single user action. The marketplace constructs the transaction, presents it to Solflare, and the user approves that specific transaction with that specific list of instructions. Never implement a pattern that asks the user to “approve the marketplace” once and then performs actions without explicit approval each time.

How do I safely handle NFT transfers to escrow accounts that may not exist yet?

Include a createAssociatedTokenAccountIdempotent instruction in the transaction before any transfer instruction. This instruction creates the account if it does not exist and fails silently if it already does, all at minimal cost. The user will see this instruction in the Solflare transaction preview and can verify it is intended.

What happens if a user rejects a transaction in Solflare?

The promise returned by the signing request will reject with an error indicating the user cancelled. The marketplace should catch this error, clear any pending UI state, and allow the user to retry the action. Do not re-submit or retry without explicit user action, and do not show a generic error message; explain that the user rejected the transaction in the wallet.

author avatar
xristos tsigiannis