Integrate MPESA Payments into ZkRamp Using TLS Notary Techniques #76
AbdelStark
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Integrate MPESA Payments into ZkRamp Using TLS Notary Techniques
Background
MPESA transactions primarily operate over the USSD protocol, which poses challenges for direct integration using TLS Notary techniques due to the lack of TLS-based communication. However, MPESA provides APIs accessible over HTTPS, which can be utilized to retrieve transaction details securely.
Challenges with MPESA and USSD
Proposed Solution
Leverage the MPESA APIs, specifically the Transaction Status API, to retrieve transaction details over HTTPS. Utilize TLS Notary to capture the TLS session during the API request, generating a cryptographic proof of the transaction data retrieved directly from MPESA's servers. This proof is then used to generate a STARK proof, which can be submitted to ZkRamp's smart contract on Starknet for on-chain verification.
Workflow Overview
Implementation Steps
1. Accessing the MPESA Transaction Status API
https://sandbox.safaricom.co.ke/mpesa/transactionstatus/v1/query
Sample Request Body:
Sample Response Body:
2. Capturing TLS Session with TLS Notary
3. Generating a STARK Proof
ResponseCode
is0
).4. Smart Contract Verification on Starknet
API References
MPESA Developer Portal: https://developer.safaricom.co.ke/
Transaction Status API Documentation: Transaction Status
Sample Request and Response Codes:
ResponseCode
values:0
: Success - The transaction was processed successfully.1
: Insufficient Funds - The account has insufficient funds.2001
: Insufficient Credit - The initiator has insufficient credit.21
: Authorization Error - Access denied due to authorization failure.Considerations
Authentication and Security
Consumer Key
andConsumer Secret
required for API authentication.SecurityCredential
for initiating transactions.User Experience
Next Steps
Prototype Development
UI/UX Design
References:
Beta Was this translation helpful? Give feedback.
All reactions