I have recently started learning blockchain development. I have been watching tutorials on Truffle and React. I am seeing most tutorials make transactions directly from React by connecting to Metamask and using compiled solidity code that is placed in the frontend itself. Is that how it is mostly done?

Me as a software developer who deals mostly with REST APIs was expecting interactions to be done with the blockchain from the backend, something like an express server. Maybe I am seeing it in wrong way or maybe both the scenarios have their own usecases.

I would really appreciate if anyone could shed some light on this for me. Thanks.

1 Answer 1


There are two general approaches in how to do blockchain interactions:

  1. Through the frontend, utilizing the user's browser wallet. This way the user can sign transactions and interact with the blockchain directly.

  2. Through the backend. Often it uses a service provider which provides an RPC endpoint to access their shared nodes. This way the user can't sign transactions, so all of the interaction is either read-only or the backend signs transactions.

Both have their advantages. If you need users to see blockchain data (for example token prices) in the website without connecting their wallet (they don't even need a wallet), use a backend connection. But if you need the users to be able to sign transactions (for example to transfer tokens), you need a frontend connection which uses the user's browser wallet.

  • Thank you for clarifying that for me. Your explanation makes sense. Commented Dec 25, 2021 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.