π± Building a 2βofβ3 Escrow API for MyZubster
I recently built a REST API for MyZubster that handles:
- β x402 payment sessions (via AWS AgentCore)
- β 2βofβ3 escrow (simulated via Boson)
- β Job completion with rating & review
The API is built with Flask, uses boto3 for AWS Signature v4, and is ready to be deployed on Render or any WSGI server.
π§ The Stack
- Python 3.12
- Flask + Gunicorn
- boto3 / urllib3 β for SigV4βsigned AWS requests
- Boson β escrow 2βofβ3 (testnet)
- dotenv β environment variables
π§ͺ The API Endpoints
POST /escrow/create
Creates a new escrow and a payment session.
Request:
json
{
"offer_id": "garden_test_001",
"buyer": "0xBuyerWalletTest",
"seller": "0xSellerWalletTest",
"amount": 12.50
}
Response:
json
{
"job_id": "myzubster_6c712474",
"payment_id": "mock_payment_87f3ea91",
"payment_address": "0xMockPaymentAddress",
"escrow_id": "boson_mock_escrow_f92dd7a7",
"status": "ESCROW_PENDING",
"created_at": "2026-08-03T04:27:28.187745+00:00"
}
POST /escrow/complete
Completes a job and records a review.
Request:
json
{
"job_id": "myzubster_6c712474",
"rating": 5,
"review": "Giardino tagliato in modo impeccabile!"
}
Response:
json
{
"job_id": "myzubster_6c712474",
"status": "COMPLETED",
"rating": 5,
"review": "Giardino tagliato in modo impeccabile!"
}
π Repository & Code
The full source code, environment setup, and README are available on GitHub:
π https://github.com/MyZubster-Ecosystem/myzubster-escrow-api
π Deploy on Render
You can deploy this API in minutes:
Push the code to GitHub.
On Render, create a new Web Service.
Set Start Command to:
bash
gunicorn -w 4 -b 0.0.0.0:5000 escrow_api:app
Add environment variables from .env.
π‘ Why This Matters
This API is the backbone of a decentralized job marketplace:
Buyers pay via x402 (USDC).
Sellers receive funds via 2βofβ3 escrow.
Reputation is built through reviews.
MyZubster is building a bridge between physical work, blockchain payments, and AI.
π€ Contribute
If you're a Python developer, check out the issues on GitHub:
π https://github.com/MyZubster-Ecosystem/myzubster-escrow-api/issues
π Final Thought
This is just the beginning.
Next steps: real Boson integration, ERCβ8004 reputation, and photoβbased validation.
#MyZubster #Python #Flask #Escrow #x402 #Blockchain #AWS #DevUpdate
Top comments (0)