Authorization Engine

Deep dive into ClawPay's programmable authorization logic.

Overview

The Authorization Engine is the core component that validates every transaction against user-defined rules. Unlike traditional banking where you give merchants unlimited access to your account, ClawPay uses AI agent permissions to enforce spending permissions.

Architecture

┌─────────────────┐
│   Transaction   │
│     Request     │
└────────┬────────┘


┌─────────────────┐
│  Authorization  │
│     Engine      │
└────────┬────────┘

    ┌────┴────┐
    │         │
    ▼         ▼
┌───────┐ ┌───────────┐
│ Policy│ │ ZK Proof  │
│ Check │ │ Validator │
└───┬───┘ └─────┬─────┘
    │           │
    └─────┬─────┘


    ┌──────────┐
    │ Approve/ │
    │ Decline  │
    └──────────┘

How It Works

1. Transaction Initiation

When a card transaction occurs:

2. Policy Retrieval

The engine fetches authorization policies for the card's vault:

3. Rule Evaluation

The engine evaluates multiple checks:

4. Zero-Knowledge Proof

If required, validate ZK-proof:

5. Decision

Authorization Policies

Policy Types

1. Whitelist Policy

Only allow pre-approved merchants:

Use case: Company treasury with strict vendor management.

2. Multi-Party Approval

Require multiple signatures for large transactions:

How it works:

  1. Transaction over threshold is held pending

  2. Approval request sent to designated approvers

  3. Must receive minimum approvals within timeout

  4. If approved, transaction proceeds

  5. If timeout expires, transaction is declined

3. Velocity Control

Prevent rapid successive transactions:

Use case: Fraud prevention and rate limiting.

4. Time-Based Restrictions

Limit transactions to specific times:

Use case: Business hours only spending.

5. Geographic Restrictions

Control where cards can be used:

Combining Policies

Multiple policies can be applied simultaneously:

The engine evaluates all rules. Transaction must pass every check.

Advanced Features

Dynamic Limits

Limits can adjust based on context:

Contextual Authorization

Authorization can consider additional context:

Machine Learning Fraud Detection

The engine can incorporate ML-based risk scores:

Zero-Knowledge Proofs

Why ZK-Proofs?

Zero-knowledge proofs allow transaction validation without revealing:

  • Transaction amounts

  • Merchant details

  • Cardholder identity

  • Vault balance

Only the fact that authorization is valid is proven.

Enabling ZK-Proofs

How It Works

  1. Prover (cardholder) generates proof:

  1. Verifier (authorization engine) checks proof:

  1. Transaction proceeds if proof is valid.

Performance

Proof System
Generation Time
Verification Time
Proof Size

Groth16

~2s

~5ms

128 bytes

PLONK

~5s

~10ms

512 bytes

STARK

~10s

~20ms

45 KB

Times are approximate and hardware-dependent

Approval Workflows

Manual Approval Flow

Conditional Approval

Monitoring & Analytics

Authorization Metrics

Decline Analysis

Policy Effectiveness

Best Practices

1. Start Restrictive, Relax Gradually

2. Use Webhooks for Real-Time Monitoring

3. Regular Policy Reviews

4. Test Policies in Sandbox

Troubleshooting

Transaction Declined

Check which rule failed:

Approval Timeout

Next Steps

Last updated