Skip to main content
reworded question to be more concise, used a more direct link to docs
Source Link
1owk3y
  • 121
  • 4

Using https://docs.phantom.app/solana/integrating-phantomWhen I havebuild a working Solana Phantom Wallet Extensionwallet integration (onusing localhost/devnetthese docs)

It is working in that I have a localhost site which can request 0.1 SOL from the user to be sent to on a fixed wallet address and (as long aspage, it doesn't include the user acceptsbackend in the whole transaction) funds get sent and it completes with no issue at all.

But.. howHow does the backend hear about that transaction?

Obviously I could just send the user's "processing" transaction hash to the server, store them in a list behind the scenes, periodically check that list for hashes which have cleared on Block Explorer etc etc

But lets say The back of house is not signing and sending the page crashes immediately after Phantom transaction submits, or the internet cuts out, or the user tampers with the outgoing network packet.. the transaction hashfront is now lost/untrustworthy.

The user has 'spent money' and our backend has no system to reconcile ifSo the payment ever even happenedfrontend would have to send signatures to.. my backend?

What is the proper approach for a server to recieve a transaction hash. DoHow could I use an RPC node to babysit a wallet, and watchtrust the users packet? What if it for correctly-sized paymentsfails to deliver?

It would be nice What if @solana/web3.js would knock on a backdoor onthe user spams my server with false signatures to let me know that these transactions were coming through. Does itvalidate?

I feel like I am missing a piece of the puzzle here..

Using https://docs.phantom.app/solana/integrating-phantom I have a working Solana Phantom Wallet Extension integration (on localhost/devnet)

It is working in that I have a localhost site which can request 0.1 SOL from the user to be sent to a fixed wallet address and (as long as the user accepts the whole transaction) funds get sent and it completes with no issue.

But.. how does the backend hear about that transaction?

Obviously I could just send the user's "processing" transaction hash to the server, store them in a list behind the scenes, periodically check that list for hashes which have cleared on Block Explorer etc etc

But lets say the page crashes immediately after Phantom transaction submits, or the internet cuts out, or the user tampers with the outgoing network packet.. the transaction hash is now lost/untrustworthy.

The user has 'spent money' and our backend has no system to reconcile if the payment ever even happened.

What is the proper approach for a server to recieve a transaction hash. Do I use an RPC node to babysit a wallet, and watch it for correctly-sized payments?

It would be nice if @solana/web3.js would knock on a backdoor on my server to let me know that these transactions were coming through. Does it?

I feel like I am missing a piece of the puzzle here..

When I build a Phantom wallet integration (using these docs) on a page, it doesn't include the backend in the transaction at all.

How does the backend hear about that transaction? The back of house is not signing and sending the transaction, the front is.

So the frontend would have to send signatures to.. my backend?

How could I trust the users packet? What if it fails to deliver? What if the user spams my server with false signatures to validate?

Source Link
1owk3y
  • 121
  • 4

How is backend supposed to capture a frontend wallet transaction?

Using https://docs.phantom.app/solana/integrating-phantom I have a working Solana Phantom Wallet Extension integration (on localhost/devnet)

It is working in that I have a localhost site which can request 0.1 SOL from the user to be sent to a fixed wallet address and (as long as the user accepts the whole transaction) funds get sent and it completes with no issue.

But.. how does the backend hear about that transaction?

Obviously I could just send the user's "processing" transaction hash to the server, store them in a list behind the scenes, periodically check that list for hashes which have cleared on Block Explorer etc etc

But lets say the page crashes immediately after Phantom transaction submits, or the internet cuts out, or the user tampers with the outgoing network packet.. the transaction hash is now lost/untrustworthy.

The user has 'spent money' and our backend has no system to reconcile if the payment ever even happened.

What is the proper approach for a server to recieve a transaction hash. Do I use an RPC node to babysit a wallet, and watch it for correctly-sized payments?

It would be nice if @solana/web3.js would knock on a backdoor on my server to let me know that these transactions were coming through. Does it?

I feel like I am missing a piece of the puzzle here..