A complete guide to building XinFin DApps with XinPay

XinFin isn’t a store of value like Bitcoin; it’s a decentralized, distributed computational network, running on a set of public masternodes. Frontend developers can think of it like a public, distributed database they can access using an API.

You can build fully functional frontend web applications with integrated signon, lambda functions, and storage, just by using the XinFin Hybrid Blockchain as your backend! It’s like a public, distributed version of AWS or Google Cloud. The most popular API for working with XinFin today is provided by XinPay, a browser extension.

We will be covering the following topics:

  • What is XinPay?
  • How to get XinPay
  • Funding XinPay with XDC
  • What is Blockchain?
  • What is the XinFin Hybrid Blockchain?
  • Decentralized Applications (DApps)
  • XinFin Hybrid Blockchain Ecosystem
  • XDC3 — XinFin Javascript API

What is XinPay?

XinPay is a browser extension that allows web applications to interact with the XinFin blockchain. For users, it works as a XinFin wallet, allowing them to store and send any standard XinFin-compatible tokens (so-called XRC-20 Tokens).

For developers, it allows you to design and run XinFin DApps right in your browser without running a full XinFin masternode (which is what developers had to do before XinPay was available). XinPay talks to the XinFin blockchain for your web application.

XinPay includes a secure sign-on process, providing a user interface to manage your identities on different sites and sign blockchain transactions. It is easy to use.

Getting XinPay

To use XinPay, you will need to install it in your browser. In our case, we will be using the Google Chrome browser. As a first step, we need to go to the Chrome extension web store and download the XinPay extension. Once you are at the Chrome web store, just click on “Add to Chrome ” to add the XinPay extension into your browser. Then click on “Add Extension” and immediately you will see the icon of XinPay on the right part of the navbar navigation of your Chrome browser.

Figure 1. XinPay on Chrome.

When XinPayis installed in your browser, you will see an icon at the same level of the address bar on your browser. You should select the icon and proceed with login:

Figure 2. XinPay icon will appear on the right side of the address bar.

Before Logging in you should accept Terms of use, Privacy notice, and Phishing Warning. Scroll inside the panel in order to have the accept button available. When you accept each one, the XinPay login will appear.

Figure 3. Accept Terms of use, Privacy notice, and Phishing Warning.
Figure 4. Insert a password and save the 12 words in a safe place.

Funding XinPay with XDC

Now, we will learn how we can get some test XDCfor our XinPay. Real XDC cost money and have to be purchased from an exchange but test XDC are available for free. First, you need to log in to your XinPay account and then you should change your Network by clicking on “Main Network” that is located on the left side of the panel, and finally select “Apothem Test Network”.

Figure 5. On the top-right side of the panel, you will see a dropdown to change Network.

Be sure to Verify that you are on the correct Network. Next click on the “BUY” button. A panel will appear called “BUY XDC”, finally click on the “XinFin Apothem TestNet Test Faucet ” button.

Figure 6. Buying XDC. Click on the “Buy” button, then click on the “Apothem test Faucet” button.

When you click on “XinFin Apothem TestNet Test Faucet ”, you will be redirected to https://faucet.apothem.network There, you will have to paste your xdc address and click on the blue button to “request 1000 xdc from the faucet”, wait for a few seconds and you will receive an address transaction, which is actually a confirmation.

Figure 7. XinFin XDC Faucet view

And you will receive 1000 xdc for testing purpose of you DApp or smart contract.

What is Blockchain?

There are several definitions regarding “Blockchain”. We’ll share just one:

Blockchain technology’ means distributed ledger technology that uses a distributed, decentralized, shared, and replicated ledger, which may be public or private, permissioned or permissionless, or driven by tokenized crypto economics or tokenless. The data on the ledger is protected with cryptography, is immutable and auditable and provides an uncensored truth”

On a blockchain, the data is decentralized; it’s distributed across every device connected to the blockchain. It’s a peer for which anyone can set up a node that replicates the necessary data for all nodes to reach an agreement and be compensated by users and app developers. This allows for user data to remain private and apps to be decentralized.

What are Decentralized Applications (DApps)?

  • Decentralized applications are similar to conventional web applications but run on the blockchain. While front-end web applications use APIs to interact with servers and databases, Dapps use Smart Contract interfaces to interact with the blockchain.
  • The code of a Dapp is client-side code (usually Javascript), running in a browser.
  • The backend of a Dapp is one or more Smart Contracts deployed on a blockchain.
  • Typically, to use a Smart Contract, you pay with cryptographic tokens like XDC rather than (for example) AWS or Google Cloud Credits.

XinFin Ecosystem

  • A decentralized platform that runs smart contracts.
  • Provides developers with a foundational layer: a blockchain with a built-in Turing-complete programming language.
  • Works on peer-to-peer network protocols where each blockchain database is maintained and managed by multiple master nodes.

XDC 3 — XinFin Javascript API

  • A collection of libraries that allow you to interact with a local or remote XinFin Masternode, using an HTTP or IPC connection.
  • Use it to communicate with a XinFin Masternode or transact with a smart contract deployed on the blockchain from inside a JavaScript or web application.
  • The XinPay extension exposes the XDC3 API by an injected XDC3 object which you can access via JavaScript and does not support most synchronous XDC3 API methods.

Conclusion

As more people are becoming familiar with the technology, the creative potential for DApps continues to snowball.

XinPay is one tool making the development of this technology more accessible, and they are updating with new features all the time.

XinPay is a bridge that allows you to visit the distributed web of tomorrow in your browser today. It allows you to run XinFin dApps right in your browser without running a full XinFin Master node.

Among other things, XinPay is developing new ways to prevent possible attacks. To stay up-to-date with all the features they are working on.

If you have questions about building DApps with XinPay or have suggestions for the DApps please let me know in the comments

About XinFin Hybrid Blockchain

XinFin Hybrid Blockchain is an open-source enterprise-ready Hybrid Blockchain for Global Trade and Finance. It combines the power of public and private Blockchains with interoperable smart contracts. XinFin is fully EVM compatible. For more information on XinFin, please visit www.xinfin.org or learn more about XinFin in this video.

Reference articles and video on XinFin Network

XinFin Hybrid Blockchain useful Tools:

  1. XDC Mobile Wallet: Mobile-based wallet to Send/Receive Stable coin Tokens
  2. XINPAY: Web-based Wallet to Send/Receive Stable coin Tokens
  3. XDC Remix: XDC Remix is a powerful, open-source tool that helps you write Solidity contracts straight from the browser.

Medium:-

https://ruslanwing100.medium.com/xinfins-xdc-hybrid-blockchain-smart-contract-theory-behind-e1aa6001d6e8

https://medium.com/@ruslanwing100/chainlink-partners-with-xinfin-xdc-network-to-deploy-decentralized-oracles-using-mycontract-co-f243fe82f73e

https://medium.com/@Turingresearch/the-xdc-network-f18795251171

https://medium.com/xinfin/deploy-smart-contract-on-xinfin-testnet-through-xinfin-remix-and-xinpay-dfbbf9dcc3f7

https://medium.com/xinfin/get-started-with-xinpay-crypto-asset-bbd817e1ed46

https://medium.com/xinfin/xinfin-remix-develop-smart-contracts-for-the-xinfin-blockchain-b3c330727528

https://medium.com/@ruslanwing100/xinfin-vs-ethereum-whats-the-better-alternative-425a4e27b9d8

https://medium.com/@ruslanwing100/what-is-xinfin-network-the-complete-xinfin-network-review-28241c670f7c

https://medium.com/@ruslanwing100/xinpay-a-simple-way-to-use-xinfin-hybrid-blockchain-69ae4e2ebeaf

https://medium.com/@ruslanwing100/why-should-developers-migrate-their-dapps-from-ethereum-to-xinfin-network-8f62575863aa

Video:-

https://www.youtube.com/playlist?list=PL102yMxSbEHDsuFUF_hxIAiTxhnUEyBtC

https://www.youtube.com/watch?v=QUi2_kfv1Ko

https://www.youtube.com/watch?v=XvzxHs6_EOQ

Follow XinFin on:

Twitter: ( @ ) XinFin_Official

LinkedIn: https://www.linkedin.com/company/xinfin/

Telegram: https://t.me/xinfintalk

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store