Automating Escrow with USDC and AI - Corey Cooper, Circle
By AI Engineer
TechnologyFinanceAI
Share:
Key Concepts
- USDC as programmable money
- Escrow automation with AI and USDC
- Circle's developer tooling (Wallets, Contracts, Paymaster, CCTP)
- Smart contract features (Allow list/Block list, Spend on behalf, Minter configuration, Multi-sig, Cold storage support, Contract pausing)
- Agent-to-agent payments
- Cross-chain transactions
Circle Overview
- Circle is a fintech company established in 2013 that issues stablecoins like USDC and EURC.
- Backed by financial industry pillars like BlackRock and Fidelity due to its trust and transparency.
- USDC is backed one-to-one with fiat and short-term treasuries in a bank account (100% reserved).
- Circle has settled over $26 trillion in transactions across roughly 20 blockchains.
- Recently acquired Hashnote, enabling tokenized money market funds with 24/7 liquidation to USDC.
Circle's Developer Services
- Wallets: Programmatically embeddable wallets in applications.
- Circle Contracts: Smart contract platform for deploying and interacting with contracts.
- Circle Paymaster: Allows users to pay gas fees in USDC.
- Cross-Chain Transfer Protocol (CCTP): Enables permissionless USDC transfers between different blockchains.
- Aiming to unify balances across multiple blockchain networks.
USDC Attributes
- Internet Native: Ledger built into blockchain networks and smart contracts, enhancing programmability and transferability.
- Borderless: Enables seamless global transactions.
- Permissionless: Open network for anyone to build on top of for sending, receiving, and storing value.
- Issuance: Businesses approved by Circle connect their bank account to Circle Mint, wire fiat, and receive corresponding USDC.
- Redemption: USDC can be redeemed one-to-one for USD.
- Monthly attestations and independent audits ensure full reserves and transparency.
USDC Smart Contract
- Strict implementation requirements for deploying USDC on different blockchains to ensure standardization and safety.
- Allow list and Block list: Protects users from transacting with sanctioned or malicious actors.
- Spend on Behalf: Allows delegation of spending from a wallet balance with defined limits (e.g., corporate virtual debit cards).
- Minter Configuration: Ability to add other entities to mint from the token contract (potential future partnerships with financial institutions).
- Multi-Sig Transactions: Requires multiple signatures (e.g., CEO, CFO) for transactions above a certain threshold.
- Cold Storage Support: Allows preparing and signing transactions offline for scheduled execution (e.g., payroll).
- Contract Pausing: Ability to pause the contract for upgrades (e.g., USDC v2.2 for gas efficiency).
USDC Contract Functions
- Core functions for developers:
balanceOf
,totalSupply
,allowance
,transfer
,transferFrom
, andapprove
. transferFrom(address from, address to, uint256 amount)
: Sends USDC from one account to another.
USDC for Agents
- Near-instant settlement and built-in verification of transactions.
- Eliminates chargebacks.
- 24/7 availability.
- Verifiable transactions through cryptography.
- Programmability for conditional logic in transactions.
Escrow Agent Application (Sample App)
- Core Building Blocks: Circle Wallets, Circle Contracts, and USDC.
- Architecture:
- Client (business and freelancer) create accounts.
- Circle Wallets API provisions wallets for each party.
- Business uploads a PDF agreement.
- OpenAI's multimodal model parses information (amount, tasks).
- AI agent generates a listing on the platform.
- Human approves the listing.
- Smart contract is created using a template and initialized with parsed information (USDC as currency, depositor/beneficiary wallets).
- Circle Contracts API deploys the contract.
- Business deposits funds into the smart contract using the
deposit
function. - Freelancer uploads work (e.g., image).
- OpenAI agent verifies the work against the agreement.
- If verified, the agent uses its wallet to call the
release funds
function, releasing funds to the beneficiary.
Onboarding Flow
- Account Creation: Business and freelancer create accounts on the platform, triggering wallet provisioning via Circle APIs.
- Agreement Upload & Parsing: Business uploads a PDF agreement, which is parsed by OpenAI to extract key details like amount and tasks.
- Listing Generation & Approval: The AI agent generates a listing summarizing the agreement, which is then reviewed and approved by a human.
- Smart Contract Creation & Deployment: A smart contract is created based on a template, initialized with the parsed agreement details, and deployed using Circle Contracts API.
- Funding the Contract: The business deposits USDC into the smart contract, signaling their commitment to the agreement.
- Work Submission & Verification: The freelancer submits their work, which is then verified by an OpenAI agent against the agreed-upon criteria.
- Fund Release: If the work meets the criteria, the agent releases the funds from the smart contract to the freelancer's wallet.
Demo Highlights
- The demo showcases the escrow agent app with transactions in different states (initiated, deployed, locked).
- Demonstrates uploading a contract, parsing information, creating a smart contract, and depositing funds.
- Uses the Base network.
- Gas abstraction is built-in, allowing gas fees to be paid in fiat.
Cross-Chain Escrow
- Possible using CCTP for cross-chain deposits and payouts.
- Contracts typically reside on one chain, with interoperability built for deposits and payouts.
Minimizing Human Intervention
- Challenges exist due to the non-deterministic nature of AI.
- Current approach involves human-in-the-loop for review and approval.
- Future potential for autonomous handling of payments by AI agents.
Real-Life Examples
- Crossmint and ThirdWeb (Nebula) are companies offering similar experiences.
ZK Proofs
- Feasible to implement ZK proofs in blockchain-based escrow transactions.
- Companies like ZKP P2P are experimenting with this.
Cold Storage Support
- Use case: Scheduled payroll transactions.
- Transactions can be generated, signed, and approved offline, then broadcasted on the scheduled date.
Multi-Sig Use Cases
- Multiple agents acting as a financial operations unit, cross-checking each other's work.
- Requiring multiple signatures for transactions above a certain threshold.
Contract Evaluation
- Potential for multiple agents to evaluate the same contract and criteria.
Conclusion
The presentation highlights the potential of combining AI and USDC for automating escrow processes. Circle's developer tooling provides the necessary infrastructure for building these applications, while USDC offers the benefits of programmability, near-instant settlement, and 24/7 availability. While challenges remain in minimizing human intervention, the technology shows promise for creating more efficient and transparent payment workflows.
Chat with this Video
AI-PoweredHi! I can answer questions about this video "Automating Escrow with USDC and AI - Corey Cooper, Circle". What would you like to know?
Chat is based on the transcript of this video and may not be 100% accurate.