- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control. - Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities. - Created .gitmodules to include OpenZeppelin contracts as a submodule. - Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment. - Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks. - Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring. - Created scripts for resource import and usage validation across non-US regions. - Added tests for CCIP error handling and integration to ensure robust functionality. - Included various new files and directories for the orchestration portal and deployment scripts.
4.8 KiB
4.8 KiB
Financial File Tokenization
Overview
The financial tokenization service tokenizes ISO-20022, SWIFT FIN, and other financial files using Hyperledger Firefly. Files are parsed, uploaded to IPFS, and tokenized as NFTs or fungible tokens.
Supported Formats
ISO-20022
- pacs.008: Payment Instruction
- pacs.009: Financial Institution Credit Transfer
- camt.052: Bank-to-Customer Account Report
- camt.053: Bank-to-Customer Statement
- camt.054: Bank-to-Customer Debit Credit Notification
- paint.001: Payment Initiation
SWIFT FIN
- MT103: Single Customer Credit Transfer
- MT202: General Financial Institution Transfer
- MT940: Customer Statement Message
- MT942: Interim Transaction Report
- MT950: Statement Message
Architecture
Components
- Financial Tokenization Service: Main service for tokenization
- ISO-20022 Parser: Parses ISO-20022 messages
- SWIFT FIN Parser: Parses SWIFT FIN messages
- Firefly Client: Integrates with Firefly for tokenization
- IPFS: Stores tokenized files
Tokenization Flow
- Parse File: Parse ISO-20022 or SWIFT FIN file
- Upload to IPFS: Upload file to IPFS via Firefly
- Create NFT: Create NFT for the file
- Store Metadata: Store parsed metadata on-chain
Deployment
Prerequisites
- Firefly deployed
- IPFS deployed
- Besu network deployed
Deploy Service
# Deploy tokenization service
./scripts/deployment/deploy-tokenization-service.sh
# Or manually
kubectl apply -f services/financial-tokenization/k8s/deployment.yaml
Usage
Tokenize ISO-20022 File
curl -X POST http://financial-tokenization-service:8080/api/v1/tokenize/iso20022 \
-H "Content-Type: application/json" \
-d '{
"xml_content": "<?xml version=\"1.0\"?>...",
"file_name": "pacs008_001.xml"
}'
Tokenize SWIFT FIN File
curl -X POST http://financial-tokenization-service:8080/api/v1/tokenize/swift-fin \
-H "Content-Type: application/json" \
-d '{
"swift_message": "{1:F01...}",
"file_name": "mt103_001.txt"
}'
API Endpoints
POST /api/v1/tokenize/iso20022
Tokenize ISO-20022 message.
Request:
{
"xml_content": "<?xml version=\"1.0\"?>...",
"file_name": "pacs008_001.xml"
}
Response:
{
"status": "success",
"messageId": "MSG001",
"nft": {
"id": "nft-id",
"tokenId": "1",
"uri": "ipfs://..."
},
"ipfsId": "ipfs-id",
"parsed": {
"type": "pacs.008",
"amount": "1000",
"currency": "USD",
...
}
}
POST /api/v1/tokenize/swift-fin
Tokenize SWIFT FIN message.
Request:
{
"swift_message": "{1:F01...}",
"file_name": "mt103_001.txt"
}
Response:
{
"status": "success",
"messageType": "MT103",
"nft": {
"id": "nft-id",
"tokenId": "1",
"uri": "ipfs://..."
},
"ipfsId": "ipfs-id",
"parsed": {
"type": "SWIFT_FIN",
"amount": "1000",
"currency": "USD",
...
}
}
GET /api/v1/health
Health check endpoint.
Response:
{
"status": "healthy"
}
Parsers
ISO-20022 Parser
The ISO-20022 parser (parsers/iso20022_parser.py) supports:
- pacs.008: Payment instructions
- pacs.009: Financial institution transfers
- camt.052/053/054: Account reports and statements
- paint.001: Payment initiation
SWIFT FIN Parser
The SWIFT FIN parser (parsers/swift_fin_parser.py) supports:
- MT103: Customer credit transfers
- MT202: Institution transfers
- MT940/942/950: Statement messages
Integration
Firefly Integration
The service integrates with Firefly for:
- Token Pool Creation: Create token pools for financial files
- NFT Minting: Mint NFTs for tokenized files
- IPFS Upload: Upload files to IPFS
- Metadata Storage: Store parsed metadata
Besu Integration
The service connects to Besu via:
- RPC Endpoint: Besu RPC nodes
- Chain ID: 138
- Firefly: Firefly handles blockchain interaction
Examples
Tokenize Payment Instruction
from services.financial_tokenization.financial_tokenization_service import FinancialTokenizationService
service = FinancialTokenizationService(firefly_client)
# Tokenize ISO-20022 pacs.008
result = service.tokenize_iso20022(xml_content, "pacs008_001.xml")
print(f"NFT ID: {result['nft']['id']}")
print(f"IPFS ID: {result['ipfsId']}")
Tokenize SWIFT FIN Message
# Tokenize SWIFT FIN MT103
result = service.tokenize_swift_fin(swift_message, "mt103_001.txt")
print(f"NFT ID: {result['nft']['id']}")
print(f"Message Type: {result['messageType']}")