diff --git a/applications/ISO20022-Implementation-POC.md b/applications/ISO20022-Implementation-POC.md index e3fa414a7bb..e21fc51869d 100644 --- a/applications/ISO20022-Implementation-POC.md +++ b/applications/ISO20022-Implementation-POC.md @@ -1,8 +1,8 @@ -# ISO20022 Implementation POC +# ISO20022 Ecosystem Research and Technical Design - **Team Name:** Solidbit GmbH - **Payment Address:** CHF (22 November, 2023, 08:57 UTC) -- **[Level](https://github.com/w3f/Grants-Program/tree/master#level_slider-levels):** 2 +- **[Level](https://github.com/w3f/Grants-Program/tree/master#level_slider-levels):** 1 ## Project Overview :page_facing_up: @@ -12,69 +12,18 @@ This proposal is a response to [this RFP](https://github.com/w3f/Grants-Program/blob/master/docs/RFPs/ISO_20022.md). -ISO20022 is the future standard of financial transactions of all kinds including payments, foreign exchange and securities trading. Many blockchain ecosystems like [Ripple](https://ripple.com/), [Cardano](https://cardano.org/) and [Stellar](https://stellar.org/) are already ISO20022 compliant. In order to make Polkadot ISO20022 compatible as well, it is necessary to start designing how such an integration would look like in pratice. Some [prior theoretical research](https://github.com/w3f/Grants-Program/blob/master/applications/ISO20022.md) has been conducted and in this project we want to go a step further and build a practical Proof-Of-Concept for ISO20022 payments in Substrate. ISO20022 covers a vast amount of different messages for different financial transactions. In this project, we want to focus on customer-to-customer interbank payments evolving around the ISO20022 message [pain.001.001.11](https://developer.gs.com/docs/services/transaction-banking/pain001FedACHsample/)(CustomerCreditTransferInitiationV11). +ISO20022 is the future standard of financial transactions of all kinds including payments, foreign exchange and securities trading. Many blockchain ecosystems like [Ripple](https://ripple.com/), [Cardano](https://cardano.org/) and [Stellar](https://stellar.org/) are already ISO20022 compliant. In order to make Polkadot ISO20022 compatible as well, it is necessary to start designing how such an integration would look like in pratice. ### Project Details -The goal of this project will be to implement a fully functional minimal viable product (MVP) that lets banks settle payments on the Polkadot blockchain using the ISO20022 standard. We will focus on customer-to-customer interbank payments and payment reversals, ie. Customer C1 with a bank account at bank B1 sending an amount of DOT to customer C2 with an account at bank B2 using ISO20022 messages. - -#### MVP Components -This MVP will consist of the following components: - -##### 1. Substrate Pallet -The first component is a pallet that will be responsible for storing hashed ISO20022 messages and handling interbank payment settlements as well as a payment reversal mechanism. -1. **Account management for banks:** Banks create an account and transfer some DOT to it. -2. **Transaction management:** Banks can submit a hashed (and salted) ISO20022 message along with the receiving bank account and DOT amount to the pallet in order to transfer a certain amount of DOT to the receiving bank. -3. **Payment reversal mechanism:** Banks will be able to revert payments in order to be compliant with ISO20022 messages such as pain.007.001.11 (CustomerPaymentReversalV11) or pacs.007.001.12 (FIToFIPaymentReversalV12). - -##### 2. Client for Banks -In order for banks to use Polkadot as a payment settlement system, they will need to run a client which offers the following funcionality: - -1. API to receive customer payment instructions -2. ISO20022 message parser/creator -3. Send extrinsics to pallet for transfer -4. Send extrinsic to pallet for reversal -5. Send/Read ISO messages to bus -6. Verify relevant ISO messages on chain -7. Client account management system - - Create for each client an account number - - Store for each client a list of hashes form the chain - - Functionality to derive client balance from onchain hashes -8. Hashmap-like storage of all ISO messages and salts - -We will use NodeJs to build this MVP client. - -##### 3. Interbank Message Bus -As the blockchain only stores hashes of the ISO 20022 messages in order to preserve privacy, we need some a communication system to exchange ISO20022 messages between banks. - - -#### Payment Flow -The below diagram describes the steps necessary to complete an ISO20022 payment using the Substrate pallet as the settlement system. Customer1 with a bank account at Bank1 is sending DOT to Customer2 with an account at bank Bank2. In this example we use two ISO20022 messages (for an example please see the appendix): -1. pain.001.001.11 (CustomerCreditTransferInitiationV11) for the customer to initiate the payment. -2. pacs.008.001.11 (FIToFICustomerCreditTransferV11) for the interbank transfer. - -![Payment Flow](https://solid-bit.com/w3f/iso20022.png "Payment Flow") - -#### Design Choices - -1. We do not process ISO20022 messages onchain in order to preserve privacy. -2. We do not use offchain-workers for message processing also for privacy reasons. -3. We do not create customer accounts on chain, because they could easily be linked to a real person, again breaking privacy. -4. We do not use one centralized message processing institution, as we want to give each bank full access to their on-chain funds, at least guaranteeing decentralization on the interbank level. - - - - -### Ecosystem Fit - -Many competing blockchain ecosystems are already ISO20022 compliant (see above). If Polkadot as well wants to become compatible with the traditional finance industry, an ISO20022 integration will be the right place to start. +If Polkadot wants to become compatible with the traditional finance industry, an ISO20022 integration will be the right place to start. +The goal of this project is to get an overview of how other blockchain ecosystmes approach the ISO20022 integration, outline challenges and opprotunities of such an integration and provide technical designs of how Polkadot could become ISO20022 compatible. ## Team :busts_in_silhouette: ### Team members - Piero Guicciardi (Project Lead & Developer) -- Christian Langenbacher (Advisor Implementation) ### Contact @@ -93,6 +42,11 @@ Piero has been a core protocol developer for [Encointer](https://github.com/enco Below you can find a list of contributions by Piero: +#### Big Tip for LiteScan +- Referenda: https://polkadot.polkassembly.io/referenda/970 +- Repo: https://github.com/pifragile/litescan + + #### W3F Grant Democratic Governance - Application: https://github.com/w3f/Grants-Program/pull/2123 - Submission: https://github.com/w3f/Grant-Milestone-Delivery/pull/1101 @@ -152,9 +106,6 @@ Below you can find a list of contributions by Piero: - https://github.com/encointer/encointer-js/pull/78 -The project advisor Christian Langenbacher is the tech lead of [Encointer](https://github.com/encointer) and [Integritee](https://github.com/integritee-network). - - Piero has previously received a W3F grant for a different project(see above). @@ -166,13 +117,11 @@ Piero has previously received a W3F grant for a different project(see above). Please also provide the GitHub accounts of all team members. If they contain no activity, references to projects hosted elsewhere or live are also fine. - https://github.com/pifragile -- https://github.com/clangenb ### Team LinkedIn Profiles - https://www.linkedin.com/in/piero-guicciardi-66b939152/ -- https://www.linkedin.com/in/christian-langenbacher-baa629182/ ## Development Status :open_book: @@ -183,60 +132,26 @@ This project has not started yet, but there has been some previous related work ### Overview -- **Total Estimated Duration:** 3 month -- **Full-Time Equivalent (FTE):** 0.43 (26 person days) -- **Total Costs:** 27040 CHF - -### Milestone 1 — Substrate Pallet - - **Estimated duration:** 1 month -- **FTE:** 0.5 (10 person days) -- **Costs:** 10400 CHF +- **FTE:** 0.25 (5 person days) +- **Total Costs:** 5200 CHF (5850 USD) -| Number | Deliverable | Specification | -| -----: | ----------- | ------------- | -| **0a.** | License | GPLv3 -| **0b.** | Documentation | We will provide both **inline documentation** of the code and a basic **tutorial** that explains how a user can (for example) spin up one of our Substrate nodes and send test transactions, which will show how the new functionality works. | -| **0c.** | Testing and Testing Guide | Core functions will be fully covered by comprehensive unit tests to ensure functionality and robustness. In the guide, we will describe how to run these tests. | -| **0d.** | Docker | We will provide a Dockerfile that can be used to test all the functionality delivered with this milestone. | -| 1. | Scope and Protocol | We will define all relevant ISO20022 messages for the MVP and - define a minimal set of XML attributes for each ISO20022 message| -| 2. | Blockchain | Create a Substrate chain.| -| 3. | Pallet | We will implement the pallet as described above.| - +### Milestone 1 — Ecosystem Research and Technical Design -### Milestone 2 — Bank Client for Blockchain Interaction and Substrate Integration Tests - -- **Estimated duration:** 2 months -- **FTE:** 0.4 (16 person days) -- **Costs:** 16640 CHF +- **Estimated duration:** 1 month +- **FTE:** 0.25 (5 person days) +- **Costs:** 5200 CHF (5850 USD) | Number | Deliverable | Specification | | -----: | ----------- | ------------- | -| **0a.** | License | GPLv3 -| **0b.** | Documentation | We will provide both **inline documentation** of the code and a basic **tutorial** that explains how a user can (for example) spin up one of our Substrate nodes and send test transactions, which will show how the new functionality works. | -| **0c.** | Testing and Testing Guide | Core functions will be fully covered by comprehensive unit tests to ensure functionality and robustness. In the guide, we will describe how to run these tests. | -| **0d.** | Docker | We will provide a Dockerfile that can be used to test all the functionality delivered with this milestone. | -| 0e. | Article | We will publish an **article** that descibes the functionality of the pallet, bank client and message bus.| -| 1. | Bank client | We will implement the bank client that interacts with the Substrate Chain as well as with other banks as specified above.| -| 2. | Interbank Message Bus | We will implement the interbank message bus as described above.| -| 3. | Integration Tests | Connect all parts using a running Substrate blockchain, a message bus and two customers with accounts at two banks, creating transactions and transaction reversals.| +| 0e. | Article | We will publish an **article** that outlines the current state of other blockchain's ISO20022 development as well as technical designs how to solve this for Polkadot.| ## Future Plans -There are many ways in which this project can be extended in the future. Some of them are: - -### Protocol -1. Allow for multiple currencies on the Polkadot Asset Hub -2. Give customers direct access to their onchain funds -3. Process a wider variety of ISO20022 transactions like card payments, currency conversions or even securities trading -4. Make bank client PCI SSC compliant - -### Adoption -1. Create partnerships with banks for pilot phase -2. Polkadot becomes a ISO20022 member to drive adoption +The next step will be to implement a POC of the proposed soution. ## References - [ISO 20022 Message Catalogue](https://www.iso20022.org/iso-20022-message-definitions?business-domain=1) @@ -261,216 +176,3 @@ ISO8583 Implementation: - https://github.com/w3f/Grants-Program/pull/1809 - https://github.com/w3f/Grants-Program/blob/master/applications/ISO-8583-implementation.md - https://github.com/w3f/Grant-Milestone-Delivery/blob/master/deliveries/iso_8583_PoC_milestone_1.md - -## Additional Information :heavy_plus_sign: - -## Appendix -### 1. pain.001.001.11 message example ([source](https://developer.gs.com/docs/services/transaction-banking/pain001FedACHsample/)) -``` - - - - - 431053 - 2022-03-11T01:33:49 - 2 - 600.11 - - Initiating Party Name - - - - Party Id - - - - - - - 13036902 - TRF - 2 - 200.00 - - - MURG - - - CTX - - - Mortgage - - - 2022-03-11 - - Debtor Name - - Debtor Streeet Name - Debtor Town Name - Debtor country sub division - US - - - - - GS00005132 - - - - US - - - - - Debtor Account Number - - - USD - - - - - - USABA - - 026015079 - - - US - - - - - - Paymen end to end Id - - - 200.00 - - - - - - USABA - - Clearing system Membership ID - - - US - - - - - Creditor Account Name - - US - - - - - - Creditor Account Number - - - - CACC - - - - - - 13036906 - TRF - 200.00 - - - MURG - - - CTX - - - Proprietary code - - - 2022-03-11 - - Debtor Name - - Street Name - Town Name - country Sub Division - Country - - - - - GS00005134 - - - - US - - - - - 270008045186 - - - USD - - - - - - USABA - - 026015079 - - - US - - - - - - NSMGSB13036911 - - - 400.11 - - - - - - USABA - - 028000082 - - - US - - - - - Creditor Name - - US - - - - - - 31062765 - - - - CACC - - - - - - -``` \ No newline at end of file