/Polkasend-APAC-Hackathon

Polkasend is a wallet and Point of Sale Superapp that combines TradFi with Web3, through Moonbeam and Polkadot's XCM services.

Primary LanguageJavaScriptMIT LicenseMIT

License: MIT

Polkasend-APAC-Hackathon

Polkasend is a wallet and Point of Sale Superapp that combines TradFi with Web3, through Moonbeam and Polkadot's XCM services.


Welcome, this is our project for Polkadot Hackathon: APAC Edition 2023

IMPORTANT!

Application:

Main App APK: LINK

POS App APK: LINK

Installation and Setup guide: LINK

Here is our main demo video:

Demo

Improvements and our thesis for this new Polkasend

The idea and project is vaguely based on a project that we developed last year that has participated in some hackathons. We just took the name it had, grabbed the idea to combine Traditional Finance and Web3 from it and that is basically it. For that project we used the Acala EVM and on the side of Traditional Finance we are using the Rapyd's sandbox (one of the biggest Fintech providers in the world).

This is that project: https://devpost.com/software/polkasend

Nevertheless almost everything, but the name and some visuals, is completely NEW.

And we decided on that vehemently for this hackathon: EVERYTHING from this new Polkasend is developed from scratch (it was previously a progressive Webapp). And you can attest to that if you compare screenshots and functionalities. Even the code for the incorporation of Rapyd is all new as they also updated their platform.

All this is new:

  • Moonbeam EVM instead of Acala.
  • Full Polkadot and Moonbeam EVM wallet with XCM services
  • Moonbeam's XC-20 tokens and their equivalent on the Polkadot parachains. [ACA, ASTR, aUSD, BNC, DOT, IBTC, INTR, PARA, PHA, RING, USDT]
  • Transfers from Moonbeam to Parachains through Moonbeam's X-Tokens Solidity Interface.
  • Contactless transfers through WalletConnect 2.0 services, EVM and Polkadot compatible.
  • From progressive Web app to Native application
  • Everything regarding the Point of Sale is new.

TLDR: Basically we just reused the name and some images.

Introduction and Problem

Industries being disrupted: ewallets, fintech and retail Point of Sale.

Banking the unbanked has always been a paradigm in the Web3 world.

Our team is based in Mexico, within a region with several challenges, an estimated 70% of economic transactions in Latin America are all cash. And just 50% have bank accounts. But, in contrast 78% has a cell phone with an internet connection.

These numbers are close and very similar to the APAC region. In Asia Pacific cash accounts for 57% of the transactions and just 76% has bank accounts. Of course in terms of mobile connections they boast much higher numbers reaching 98%!

Traditional Finance has proven itself unable to solve the great Chasm in both regions that comes from not having any kind of banking, and overusing cash not to mention a digital one. We think that both regions are set to jump this chasm and generate new economies based on these technologies, which they already are doing. Despite this the crypto world has seldom focused on these regions and not really reached the retail or final consumer, until now.

Of course, as the numbers show us that Digital Wallets are projected to overtake credit cards by 2024, we want to capitalize on that opportunity with Fintech and Web3 tools.

Our goal for this project is to actually enable and get crypto at the point of sale.

Solution

PolkaSend is a Mobile-First wallet, cash out ramp and Point of Sale Superapp. We combine TradFi through Rapyd with Web3 to improve Financial Inclusion in Mexico and LATAM

System's Architecture:

  • All Moonbeam transactions are controlled through web3.js and ethers.

  • All Polkadot and Parachain transactions are controlled by @polkadot/api and the connection to the blockchain is through the WsProvider module through RPC.

  • The connection of the Wallet and the POS Dapp is used WalletConnect 2.0 as Universal Provider to sign transactions wirelessly or by NFC.

  • Transaction history for Moonbeam EVM, Polkadot and Parachains is obtained by the Subscan API.

  • Through Rapyd's APIs we can manage users, checkout, swap and KYC of our app. (https://www.rapyd.net/)

Main App Screens:

  • Through Rapyd, Moonbeam, Polkadot and Parachains we can have total control of the movements and transactions of our account in both Crypto and Fiat.

  • Crypto Moonbeam

  • Crypto Polkadot

  • Fiat

Moonbeam -> Parachain - XCM-Transfer:

Through Moonbeam we can also make transfers XCM transfers with X-Tokens Solidity Interface.

  • First we must click on the pay button.

  • With this component we can scan either wallets to make direct transfers or a Wallet Connect QR for connectivity with dapp, in this case we will scan a WalletConnect 2.0 QR, to connect to our POS Dapp. In the case of a transfer by XCM, we will select in the POS the x-token that we are going to receive and the amount.

  • Once we accept the connection, the Connected to Dapp sign will appear and the same POS will send us the transaction request in a few seconds, which if it seems to be fine we will have to accept and sign like any other wallet.

  • Finally we wait for the confirmation of the payment and reviewing it in the explorer we confirm that it is correct.

  • The transaction carried out in this section is the following, you can check that the data is the same.

https://moonbeam.subscan.io/extrinsic/0xbb9d81e12609a30822c3b59156ee44c5424830fd0113006e4042e15a687f2e60

Moonbeam Direct Transfer:

Through Moonbeam we can also make transfers directly between Moonbeam Wallets.

  • First we must click on the pay button.

  • With this component we can scan either wallets to make direct transfers or a Wallet Connect QR for dapp connectivity, in this case we will scan a wallet.

  • In the case of a direct transfer, we will select the token that we are going to send and the amount. By pressing the Check button, the wallet will check that the transaction can be made with the balance we have at that time. If the transaction can be carried out, the button will change to Send and we will be able to carry out the transaction.

  • Once the Send button is pressed, a signature screen will appear for us to sign with our pin or biometrics. Going to a waiting screen until the transaction is in the blockchain and we can finally see it in the explorer.

  • The transaction carried out in this section is the following, you can check that the data is the same.

https://moonbeam.subscan.io/extrinsic/0xd7dbf6e856512d00e3e7583f0bd2e3b17b7192ccd323b6bb64449f8d2255fcab

Polkadot and Parachains Direct Transfer:

Through Polkadot API we can also make transfers directly between Polkadot and Parachains Wallets.

  • First we must click on the pay button.

  • With this component we can scan either wallets to make direct transfers or a Wallet Connect QR for dapp connectivity, in this case we will scan a wallet.

  • In the case of a direct transfer, we will select the token that we are going to send and the amount, internally the wallet selects the correct method to move the asset, since some parachains vary from API method. APPENDIX I.

  • By pressing the Check button, the wallet will check that the transaction can be made with the balance we have at that time. If the transaction can be carried out, the button will change to Send and we will be able to carry out the transaction.

  • Once the Send button is pressed, a signature screen will appear for us to sign with our pin or biometrics. Going to a waiting screen until the transaction is in the blockchain and we can finally see it in the explorer.

  • The transaction carried out in this section is the following, you can check that the data is the same.

https://phala.subscan.io/extrinsic/0x1b6c65538305ef1c3051a63cb3485ccc0e75bd8cf879f2ff9c7f7ec50e363eaf

Swap Transfers:

  • We carry out Moonbeam (GLMR) and Fiat transfers by coordinating the services of Moonbeam and Rapyd. Transferring the equivalent of Moonbeam or USD currency from PolkaSend Master accounts.

Fiat Services:

  • At the same time, we can obtain a virtual card from the Rapyd API to be able to spend the money from our Fiat account directly.

  • Additionally, we can make a Card Debit deposit from our Fiat account to a any debit cards.

  • This is a screenshot of our backend in Rapyd.

Rapyd KYC:

  • The KYC of our application is controlled by Rapyd and to confirm it, the documents must match the user's registration.

Point of Sale application:

  • The Point of Sale application is more focused on the simple reception of payments and an interface focused on generating payment orders through QR or NFC.

  • The POS allows us to see the Moonbeam EVM, Polkadot and Fiat balances received along with the list of transactions just like the Main App.

POS - WalletConnect 2.0 Payments:

  • One of the most important processes is being able to make payments at the POS through WalletConnect 2.0, being this the pillar of our device. Since this provides a payment experience similar to current contactless payments, in turn being able to make payments with any of the X-Tokens available in the moonbeam network, payments can be made either between the networks as a traditional transaction or cross chain using the XCM language, for example we will show how a transaction is made from moonbeam to a parachain.

  • When the reference is created by QR, it can be paid through any wallet compatible with WalletConnect 2.0, however our Main App also allows payment through NFC. According to the token selection, the POS will configure the transaction with the correct multilocation address Appendix II.

  • The section of code that configures the multilocation address is the following, it is extremely important that it is correct otherwise the funds could be lost.

      const multilocation = [
          1,
              [
                  parachainId,
                  '0x01' + decodePolkaAddress(polkaAccount) + '00',
              ],
          ];
    
  • Once the reference payment has been made, we will be able to see the confirmed and verified messages.

  • In addition, we provide a printed receipt with the URL where you can check your transaction.

  • Let's print!

Current state and what's next

This application is directed at those who cannot benefit directly from cryptocurrency. It has the usual, both crypto and fiat wallets, transfers between crypto and fiat, transfers between crypto accounts and it gives a spin on the cash in - cash out portion of the equation as no other project provides it. It is very important if this application is going to benefit and bank people to be very agile and compatible with FIAT at least until crypto reaches mass market. Most of the developed world has not even incorporated to legacy electronic systems. In addition to that the incorporation of a Point of Sale thought mainly for SMEs is something that can be key in augmenting the change for further adoption.

I think we can make the jump from those systems almost directly to self-banking, such as the jump that was made in some parts of Africa and even here in Latin America from skipping telephone landlines directly to Mobile phones. If that jump was made from that type of technology this one can be analogous and possible.

Perhaps the most important feedback we have obtained is that we have to show how our application will ensure the enforcement of anti-laundering laws.

We will do that will strong KYC. And at the same time Mexico has published since 2018 strong laws to manage that including its fintech law.

https://en.legalparadox.com/post/the-definitive-guide-mexican-fintech-law-a-look-3-years-after-its-publication#:~:text=The%20Mexican%20FinTech%20Law%20was,as%20Artificial%20Intelligence%2C%20Blockchain%2C%20collaborative

Quoting: " The Mexican FinTech Law was one of the first regulatory bodies created specifically to promote innovation, the transformation of traditional banking and credit financial services that would even allow the possibility of incorporating exponential technology such as Artificial Intelligence, Blockchain, collaborative economies and peer-to-peer financial services in secure regulatory spaces. "

All of this was a silent revolution that happened in this jurisdiction after the HSBC money-laundering scandal that included cartels and some other nefarious individuals. https://www.investopedia.com/stock-analysis/2013/investing-news-for-jan-29-hsbcs-money-laundering-scandal-hbc-scbff-ing-cs-rbs0129.aspx

Thus, the need for Decentralized solutions.

Security and identity verification of the clients who use the app is paramount for us, and to thrive in this market we need this to emulate incumbents such as Bitso. We think our technology is mature enough if we compare with these incumbents and much safer.

Of course, the main plan is to launch this application both the wallet and test the PoS system with several businesses at a retail level through pilots that we are already obtaining at this very moment.

Though our time with certain mentors during the Hackathon we were shared several insights both technical and on the business development side that will map the next upgrades to the project:

  • To have a conversion ready for the final user in a currency he can understand, this happens when we do not use Stablecoins. (from Kasper Mai Joergensen)

  • Improve or remove the seed phrase process for the PoS. (from Kasper Mai Joergensen)

  • Incorporate the SmolDOT light client instead of an RPC and refer to XCM correctly as a language xD. (from Leonardo Razovic)

  • Improve the UX and incorporate CRM utilities for businesses. (from Victor Estival)

  • Mind the Polkadot grants and support, and learn to market. (Victor Estival)

  • Improve on the delivery of the project and perhaps experiment with DeFi tools (Daniel Bigos)

  • Go further though several of the other Moonbeam tools and experiment (Kevin Neilson)

  • But in essence our plan is to launch the Wallet and run pilots for the PoS while we secure funding.

Hopefully you liked the Mobile DApp and Point of Sale.

Team

3 Engineers with experience developing IoT and hardware solutions. We have been working together now for 5 years since University.

References:

https://egade.tec.mx/es/egade-ideas/opinion/la-inclusion-financiera-en-mexico-retos-y-oportunidades

https://www.cnbv.gob.mx/Inclusi%C3%B3n/Anexos%20Inclusin%20Financiera/Panorama_IF_2021.pdf?utm_source=Panorama&utm_medium=email

https://www.inegi.org.mx/contenidos/saladeprensa/boletines/2021/OtrTemEcon/ENDUTIH_2020.pdf

https://www.cnbv.gob.mx/Inclusi%C3%B3n/Anexos%20Inclusin%20Financiera/Panorama_IF_2021.pdf?utm_source=Panorama&utm_medium=email

https://www.rappi.com

https://www.rapyd.net/

https://www.gsma.com/mobileeconomy/wp-content/uploads/2022/07/GSMA_APAC_ME_2022_R_Web_Final.pdf

https://www.pointer.gg/tutorials/solana-pay-irl-payments/944eba7e-82c6-4527-b55c-5411cdf63b23#heads-up:-you're-super-early

https://worldpay.globalpaymentsreport.com/en/market-guides/mexico

https://www.sipa.columbia.edu/academics/capstone-projects/cryptocurrency-and-unbankedunderbanked-world

Appendix I:

APIs used to transfer assets according to the parachain or token.

Acala USD:

api.tx.currencies.transfer(
    to_address,
    {Token: 'AUSD'},
    amount,
);

Acala:

api.tx.balances.transfer(
    to_address,
    amount
)

Astar:

api.tx.balances.transfer(
    to_address,
    amount
)

Bifrost:

api.tx.balances.transfer(
    to_address,
    amount
)

Polkadot:

api.tx.balances.transfer(
    to_address,
    amount
)

Interlay:

api.tx.tokens.transfer(
    to_address,
    {Token: 'INTR'},
    amount
)

Interlay BTC:

api.tx.tokens.transfer(
    to_address,
    {Token: 'IBTC'},
    amount
)

Parallel:

api.tx.balances.transfer(
    to_address,
    amount
)

Phala:

api.tx.balances.transfer(
    to_address,
    amount
)

Darwinia:

api.tx.balances.transfer(
    to_address,
    amount
)

AssetHub (Statemint):

api.tx.assets.transfer(
    1984, // USDT
    to_address,
    amount
);

Appendix II:

Acala:

  • RPC: wss://acala-rpc.dwellir.com
  • ParachainId: 0x00000007D0
  • WalletConnectId: fc41b9bd8ef8fe53d58c7ea67c794c7e

Astar:

  • RPC: wss://rpc.astar.network
  • ParachainId: 0x00000007D6
  • WalletConnectId: 9eb76c5184c4ab8679d2d5d819fdf90b

Bifrost:

  • RPC: wss://hk.p.bifrost-rpc.liebi.com/ws
  • ParachainId: 0x00000007EE
  • WalletConnectId: 262e1b2ad728475fd6fe88e62d34c200

Polkadot:

  • RPC: wss://polkadot-public-rpc.blockops.network/ws
  • ParachainId: 0x0000000000
  • WalletConnectId: 91b171bb158e2d3848fa23a9f1c2518

Interlay:

  • RPC: wss://interlay-rpc.dwellir.com
  • ParachainId: 0x00000007F0
  • WalletConnectId: bf88efe70e9e0e916416e8bed61f2b45

Parallel:

  • RPC: wss://rpc.parallel.fi
  • ParachainId: 0x00000007DC
  • WalletConnectId: e61a41c53f5dcd0beb09df93b34402aa

Phala:

  • RPC: wss://phala.api.onfinality.io/public-ws
  • ParachainId: 0x00000007F3
  • WalletConnectId: 1bb969d85965e4bb5a651abbedf21a54

Darwinia:

  • RPC: wss://rpc.darwinia.network
  • ParachainId: 0x00000007FE
  • WalletConnectId: 3cc73806aa66ef26e3ac31109e6bd17d

AssetHub (Statemint):

  • RPC: wss://statemint-rpc.polkadot.io
  • ParachainId: 0x00000003E8
  • WalletConnectId: 68d56f15f85d3136970ec16946040bc1