Skip to main content

QWED verification for Universal Commerce Protocol (UCP) transactions

Project description

QWED-UCP

Verification for Universal Commerce Protocol (UCP) Transactions

CI License Python

QWED-UCP is a verification layer for Google's Universal Commerce Protocol, ensuring AI agent commerce transactions are mathematically correct.

Why QWED-UCP?

AI agents (like Gemini) are now handling e-commerce:

  • Cart calculations
  • Tax percentages
  • Discount math
  • Refunds

Problem: AI agents hallucinate on math.

Solution: QWED-UCP verifies every transaction deterministically.

The 3 Guards

Guard Engine Verifies
Money Guard SymPy Cart totals, tax, discounts
State Guard Z3 Checkout state machine logic
Structure Guard JSON Schema UCP schema compliance

Installation

pip install qwed-ucp

Quick Start

from qwed_ucp import UCPVerifier

verifier = UCPVerifier()

checkout = {
    "currency": "USD",
    "totals": [
        {"type": "subtotal", "amount": 100.00},
        {"type": "tax", "amount": 8.25},
        {"type": "total", "amount": 108.25}
    ],
    "line_items": [...]
}

result = verifier.verify_checkout(checkout)

if result.verified:
    print("✅ Transaction verified - safe to process!")
else:
    print(f"❌ Verification failed: {result.error}")

Integration with UCP

# Middleware for UCP checkout
def ucp_checkout_middleware(checkout_json):
    verifier = UCPVerifier()
    result = verifier.verify_checkout(checkout_json)
    
    if not result.verified:
        raise UCPVerificationError(result.error)
    
    return proceed_to_payment(checkout_json)

Links

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qwed_ucp-0.1.0.tar.gz (27.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qwed_ucp-0.1.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file qwed_ucp-0.1.0.tar.gz.

File metadata

  • Download URL: qwed_ucp-0.1.0.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qwed_ucp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f7431ce6bc0d00ec7e3bd874d498a678404a23a194a827a7e56546f41fe4b4f8
MD5 05c7be06a78230bbf44af5a2df4daccf
BLAKE2b-256 1e02e7ba4b59c69b53bcbb7ceddb942fb6571db83fd070af91572b87d449b248

See more details on using hashes here.

Provenance

The following attestation bundles were made for qwed_ucp-0.1.0.tar.gz:

Publisher: publish.yml on QWED-AI/qwed-ucp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qwed_ucp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qwed_ucp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qwed_ucp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49cc09527f80fffa960fef75737583296384b3b494e182a534836821e69c3f78
MD5 606c1771223a8847be4d7c91e4f108fc
BLAKE2b-256 85ad59cc6b61d13a68279d946d04e9d82358a06091efd6eae00de16332c92a6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for qwed_ucp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on QWED-AI/qwed-ucp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page