1

I am developing a social-media-like application based on ethereum blockchain and some use cases are controlled by smart contracts. so to communicate with smart contract I have to deal with web3.

the question is if I have to implement web3 services at the frontend level (angular) because this will need transaction cofirmation and wallet access (exmpl metamask) and keep off-chain business in backend (nodejs), or I can impelement all services in nodejs.

0

It really depends on what UX you want to provide. There are generally 3 approaches:

  1. Fully decentralized: Stand-alone Javascript app which retrieves all data from decentralized services, like Ethereum, Swarm and IPFS.
  2. Semi decentralized approach: Your users have manage their own wallets and use Metamask or other TX signers with javascript based web3 interaction. You May also have a Server Wallet, signing TX server sided.
  3. You may manage a Ethereum Wallet for your users, providing them with traditional login. So your whole (non-decentralized) blockchain app could be server sided.

In any case you might use node.js as a backend technology or just use it as part of a micro service based Backend architecture.

Just keep in mind, that as soon as you host a wallet for your user, your might turn your server into a hacker honeypot.

  • Ok, let's say that I will use metmask to manage wallets. have I implement web3 at the frontend level. and keep other off-chain business in a nodejs server ? – maroodb Apr 22 '18 at 16:33
  • That sounds right to me. All actions between the user and the blockchain should be initiated by front-end javascript, and completed by the user through metamask. – Shawn Tabrizi Apr 22 '18 at 19:22
  • You may also check if your favorite backend technology has a well maintained Ethereum implementation. github.com/ethereum/web3.js#other-implementations – digitaldonkey Apr 23 '18 at 0:21

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