Skip to main content

QWED verification for Universal Commerce Protocol (UCP) transactions

Project description

QWED-UCP

Verification for Universal Commerce Protocol (UCP) Transactions

PyPI CI License Python GitHub stars Verified by QWED

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.2.0.tar.gz (36.3 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.2.0-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qwed_ucp-0.2.0.tar.gz
  • Upload date:
  • Size: 36.3 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.2.0.tar.gz
Algorithm Hash digest
SHA256 ba8c453ffe7fcdfee0eedc60ec1011ad4816e1056c7a966c4ab44a81ca5e2357
MD5 bad6c0295332f466378d80b8ac67416e
BLAKE2b-256 9e6f41c25f2e939b0f5545545e84dbb9e9bca31476c0bdcab637554d39680342

See more details on using hashes here.

Provenance

The following attestation bundles were made for qwed_ucp-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: qwed_ucp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.9 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1cd598b7024457cc24e76a1afe66013974700b1503fc9445bf144c729c2b30e9
MD5 123f57d9656764d3e01dbd6b76b973f2
BLAKE2b-256 48fd57004080cc44c9518d0a62b9ec3ab8f507ed2faefa80ba79de1a5d1e7447

See more details on using hashes here.

Provenance

The following attestation bundles were made for qwed_ucp-0.2.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