How Does Payment Work in Web3?
The growing dominance of centralized entities over the internet and users’ personal data has resulted in the need for the internet’s decentralization. Although the concept of web3 has been around for almost a decade, it’s now that people have started to realize the importance of a decentralized web ecosystem. Web3, heralded as the next and a better iteration of the internet stands to resolve issues associated with today’s dominantly centralized web. Over the past few decades, payment processing giants like Mastercard or Visa have actively explored web3 opportunities. Both companies announced partnerships with cryptocurrency wallets and exchanges. The Q4 2021 quarter saw $2.5 billion in payments made with crypto-connected Visa cards, compared to $47.6 trillion in total Visa payments. Mastercard announced in April 2022 that it launched its first crypto-backed credit card.
Even in its current developmental stage, web3, by virtue of decentralization, ensures that payments are safer, simpler and smarter. Web3 payments are peer-to-peer, borderless and support multiple tokens and blockchains. This article discusses how web3 payments work in the web3 ecosystem.
- What is decentralized finance?
- How does decentralized finance work?
- Difference between web2 and web3 payment
- Features of web3 payments
- How to make payments in web3?
- What is a QR code in web3?
- What is FIAT Payment On-Ramping/Off-Ramping in web3 payments?
What is decentralized finance?
Before exploring web3 payments, let us familiarize ourselves with the premise within which these payments work, which is decentralized finance (DeFi). DeFi’s main objective is to revolutionize traditional lending and banking. DeFi allows its users to earn interest on cryptocurrency tokens, which borrow funds and secure insurance without any involvement of a third party. The blockchain is decentralized, which means it can work efficiently without the involvement of an intermediary. An intermediary could be an individual, developer, bank or other entity. DeFi’s key benefit is its ability to allow trustless financial transactions within the ecosystem. Users can access DeFi through software called decentralized apps (dApps). In this case, users do not need to apply to open an account with a bank like traditional centralized financing.
DeFi can be accessed for the following means:
- Users can lend their crypto to earn interest and rewards every 60 seconds.
- It is now easy to get a loan. To get a loan, users don’t need to submit paperwork. They can avail of short-term “flash loans,” which are not usually offered by traditional financial institutions.
- Peer-to-peer trading is possible with certain crypto assets. It is possible to buy and sell stocks directly without any brokerage.
- User can also deposit their crypto in a savings account to earn interest. The interest earned from crypto will be more than what people typically get from banks.
- Also, we can place long or short bets against certain crypto assets while still considering their stock options or future contracts.
How does decentralized finance work?
DeFi makes financial services available using smart contracts and cryptocurrency. This eliminates the need to have intermediaries like guarantors. These services include lending, where users can lend their cryptocurrency and earn interest in a matter of minutes, receive a loan immediately, trade without a broker and save cryptocurrency. Users also have the option to buy derivatives like stock options or future contracts.
Users use dApps to facilitate peer-to-peer business transactions. Most of these dApps can be found on Ethereum. Among the most used dApps and DeFi services are coins such as Ether, Solana, Polkadot, and Stablecoins. They also include tokens, digital wallets such as Coinbase and MetaMask, as well as decentralized DeFi mining, yield farming, liquidity mining, staking and trading.
DeFi is open-source means that DeFi protocols and apps can theoretically open for users to inspect and adapt. Users can combine and match protocols to create unique combinations of possibilities by creating their own dApps.
Difference between web2 and web3 payments
Web2 allows for peer-to-peer transactions worldwide. It also involves an intermediary who acts as a trusted middleman between two people who don’t trust or know each other. The intermediaries also dictate the rules of transactions. In comparison to the web2 payments, decentralized web3 payments are free from anyone having the power to block transactions. Blockchain technology offers anonymity. Web3 is also powered by high-processing computers all over the globe. So, even if one node goes down, another one takes its place, eliminating single points of failure.
The new peer-to-peer web3 payment infrastructure makes deploying apps to production much easier and quicker. There is blockchain bureaucracy. As a result, it will allow people to send money to others without registering for financial services. Web3 data is encrypted so buyers can send money online without registering for financial services or giving permission for companies to access their personal and financial information.
As there is no bureaucracy in web3, its payments are also much faster. Web2 payments can take days to settle, whereas web3 payments on the blockchain settle in minutes or seconds. Besides, a web3 payment system simplifies international transfers, eliminating the need to convert complex currencies and pay high remittance fees.
Embark on your web3 journey with our future-ready web3 solutions.
Launch your Web3 project with LeewayHertz
Features of web3 payments
- Today’s payment system is more complicated than ever. There are high processing fees and long settlement times. Web3 offers fast translation speeds, high security, censorship-resistant, and adequate rewards as an alternative to the broken fiat payment system.
- Web3 payments work offers a truly decentralized and permissionless protocol that allows for dApps to be built on it. This makes them immune from financial censorship. These products and services are available to anyone around the globe, provided they have an internet connection.
- Web3 payment infrastructure is also trustless. Participants can communicate publicly and privately with each other without the need for a third party. There is no intermediary but rather smart contracts that are self-executable and run only when certain conditions are met.
- Interoperability, another important principle on which web3 infrastructure is built, allows for mobility and connectivity between different platforms and applications. It is also a key stepping stone to accelerate the adoption of web3.
How to make payments in web3?
Web3 payments can be performed in the following ways:
Wallets and Web3 SDK for making payments through dApps
Web3 wallets are digital wallets that can store digital assets, from fungible to non-fungible (NFTs) tokens and allows you to interact with dApps on various blockchains.
The Web3 wallets are available for various blockchains as:
- Browser wallets
- Browser Extension
- Mobile wallets (Android and iOS dApps)
Users can create their accounts in web3 wallets to store their digital assets. A web3 wallet account has a pair of public and private keys. The public key of an account is the address of that account, using which anyone can send/transfer tokens and various other assets to that account. It can be shared among others without a threat to security. At the same time, the Private key is like a password that is required to make any transaction within its associated wallet. It’s a code that must be kept safe from others to avoid any security breach. The same private key is used to import new accounts (which are already created) into a web3 wallet. A user can create and manage his multiple accounts within any web3 wallet. Browser Extension is the most common and popular form of web3 wallets being used with the web dApps.
Payment using web3 wallets as browser extensions
The user needs to execute the following steps:
- Downloading and activating the browser extension.
- Then the user needs to create an account if he wants to have a new one, or he can import his existing account using its private key.
- First, he will set up the wallet’s password for creating a new account. This will be different from the private key.
- The wallet displays a seed phrase that the user must store in a safe place as it will help the user restore his account and recover his funds if required.
- The wallet can switch the blockchain networks for an account, e.g., Mainnet, Testnet, Devnet etc. It also allows adding custom networks along with the localhost.
- For making a transaction using a dApp, a screen pops up in the wallet showing the estimated gas fee for that transaction to make changes to the blockchain according to it. This gas fee amount is deducted from the native token balance (e.g., ETH for Ethereum) of the blockchain to which that wallet is associated.
Connecting to a web3 wallet browser extension from a JavaScript dApp and making the transaction
- The dApp can be connected to the wallet extension using the ‘window’ object for various blockchains.
- The window object captures the objects for the various web3 wallet extensions activated in the browser and showcases the details. For eg: For ethereum – “window.ethereum”, For Solana – “window.phantom” (for phantom wallet), For Klaytn – “window.caver” etc.
- The web3.js library is used for interacting with the blockchains and the wallets.
- For various ethereum wallets, we can also set the current Provider by writing:
window.web3 = new Web3(window.ethereum);
Here, “window. ethereum” can be replaced by any other blockchain object inside the “window” object for which you may want to use the “web3.js” library only and which has no separate library to be used. If a separate library like caver.js has been used for the Klaytn blockchain, then there’s no need to embed the klaytn object into “window.web3”; it can be directly used as “window. caver”.
5. The “window.web3” object for ethereum might look like this:
{ bzz: e.exports {_requestManager: s, blockNetworkRead: ƒ, syncEnabled: ƒ, swapEnabled: ƒ, download: ƒ, …} currentProvider: MetamaskInpageProvider {_events: {…}, _eventsCount: 0, _maxListeners: 100, mux: ObjectMultiplex, publicConfigStore: ObservableStore, …} db: e.exports {_requestManager: s, putString: ƒ, getString: ƒ, putHex: ƒ, getHex: ƒ} eth: r {_requestManager: s, getBalance: ƒ, getStorageAt: ƒ, getCode: ƒ, getBlock: ƒ, …} net: e.exports {_requestManager: s, getListening: ƒ, getPeerCount: ƒ} personal: e.exports {_requestManager: s, newAccount: ƒ, importRawKey: ƒ, unlockAccount: ƒ, ecRecover: ƒ, …} providers: {HttpProvider: ƒ, IpcProvider: ƒ} setProvider: ƒ () settings: e.exports {defaultBlock: 'latest', defaultAccount: undefined} shh: a {_requestManager: s, version: ƒ, info: ƒ, setMaxMessageSize: ƒ, setMinPoW: ƒ, …} version: {api: '0.20.3', getNode: ƒ, getNetwork: ƒ, …} _extend: ƒ (e) _requestManager: s {provider: MetamaskInpageProvider, polls: {…}, timeout: null} [[Prototype]]: Object [[IsRevoked]]: false }
6. The window objects for other web3 wallets also might look similar to the above object.
7. The “currentProvider” key in the above object is an object that contains the account details from the current concerned wallet. It has the details like account address (public key), network name, and network version/chain id of the network and provides a function named “enable” to open the extension from the dapp so that the user can log in to the wallet and connect the wallet to the dApp.
8. While making a transaction using web3, the user needs to pass a transaction object in some form that would look similar to the following (some more keys can be added to it as per the requirements):
let transaction = { from: senderAccountAddress, gas: GAS_VALUE, gasPrice: gasPrice, data: byteCode, };
where senderAccountAddress is the public key of the user’s web3 account on the concerning blockchain, GAS_VALUE is the amount of gas provided to the transaction (the exact amount is calculated as per the transaction when it is processed), gas price is the unit gas price for the concerning blockchain.
What is a QR code in web3?
QR code in web3 can be used for implementing various functionalities, from storing a link to the details of the blockchain account on the explorer of that blockchain to facilitating making payments or sending funds or assets to the other accounts. In Metamask, a QR code is maintained for each account which can be scanned to send funds/assets/ether to another account. The QR code generally contains the account’s public key and might include other required details. In this case, it is an alternative for transferring funds to an account using its public key.
What is FIAT Payment On-Ramping/Off-Ramping in web3 payments?
On-Ramping
On-Ramping in Web3 is a process by which a user can buy cryptocurrencies in exchange for any fiat currency. On-Ramping is vital in helping users get the cryptocurrency who want to use any blockchain applications or dApps. While using a blockchain application, the user requires a certain cryptocurrency in order to pay the gas fee for the various transactions they might have to make while using the application.
The users who are new to blockchain and crypto and are looking to do things on the blockchain might not have required crypto in their wallets when they start. Without easy onramps, a user would have to arrange for the required crypto funds to use the application while the wallet he is using is waiting for the user to come back with some funds and start using the application. But, to make the user experience seamless, less time-consuming, and successful, most of the wallets provide the feature of on-ramping the fiat currency for the required crypto.
Users can use their credit or debit cards to easily convert their fiat currencies (USD, INR, etc.) to the cryptocurrency in their wallets themselves.
Payment services like MoonPay, Transak, etc. are used in the wallets like Metamask to facilitate the users with the ability to buy crypto in exchange for their fiat currency using debit cards, credit cards and several other payment methods.
Embark on your web3 journey with our future-ready web3 solutions.
Launch your Web3 project with LeewayHertz
Off-Ramping
Off-Ramping in Web3 refers to the process by which a user can sell his crypto assets in return for the fiat currency. While on-ramping is extremely important for decentralized finance to spread worldwide, as much as users require crypto to get well-versed with its usage and applications, the off-ramp of the crypto is always very important. It should not be the case that once a user onboards his fiat money to buy crypto assets and then can never get off the board to get his fiat back, this will become a limitation of the Decentralized Finance (DeFi).
Off-Ramping allows a user to sell his crypto/digital assets on platforms and get the fiat back. This, in turn, attracts users worldwide to crypto and blockchain.
Fiat to the crypto gateway: Fiat currency to crypto payment gateway facilitates the on-ramping of fiat currencies by enabling a company accepting fiat currency for payment. Users can use withdraw funds in their preferred cryptocurrency and vice versa.
The Cryptocurrency acceptance process works in the following way:
- Clients select the items and add them to the cart.
- Make a payment.
- Fill in the blank with the payment details by the fiat money.
- The money will be proceeded thanks to fiat to crypto payment processor* and then be collected back to the merchant’s wallet.
- Real-time exchange into designated cryptocurrency.
- Merchants can withdraw or store the money in crypto.
Fiat to the crypto payment processor is a third-party payment company that receives fiat payment checkout information from the payment gateway, proceeds the transmitted details in a security check system, and converts to cryptocurrency in real-time exchange values.
Fiat onramps and off-ramps also provide a way of transferring funds from one person to another. A person can send fiat currency like USD to another person. Instead of transferring the fiat currency as it is to the receiver, the central financial authority, like the bank, onramp the fiat into crypto and then off-ramp the crypto to fiat back before depositing it into the receiver’s account.
Custodian
Custodian is an entity in centralized/decentralized financial authorities which implements the on-ramping and off-ramping of fiat currencies in a transaction.
End note
Web3 payments offer a way for businesses to stay in touch with the latest technological advances and satisfy modern customers. However, implementing web3 payment processes takes a lot of experience and patience. Web3 payments can also increase the number of currencies people can exchange and keep opening up new financial opportunities beyond just fiat currencies. The ability to easily pay in crypto and other currencies will make investing and accessing the financial market easier.
If you are planning to build a web3 payment solution, our web3 experts can help you from consulting to building the solution. Contact the LeewayHertz team and explore the future-ready web3 solutions.
Start a conversation by filling the form
All information will be kept confidential.
Insights
Stellar-vs-EVM-Based-Blockchains
Stellar and EVM-based blockchains are decentralized, open-source platforms designed to develop smart contracts and decentralized applications.
A deeper look into liquidity pools and how they are vital to the DeFi ecosystem
A liquidity pool is a group of digital assets gathered to facilitate automated and permissionless trading on the decentralized exchange platform.
What are Soulbound Tokens, and How do they Work?
Soulbound tokens, or SBTs, are digital identity tokens representing a person or entity’s features, traits and achievements. Learn more about SBTs.