QWED verification for Universal Commerce Protocol (UCP) transactions
Project description
QWED-UCP
Verification for Universal Commerce Protocol (UCP) Transactions
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7431ce6bc0d00ec7e3bd874d498a678404a23a194a827a7e56546f41fe4b4f8
|
|
| MD5 |
05c7be06a78230bbf44af5a2df4daccf
|
|
| BLAKE2b-256 |
1e02e7ba4b59c69b53bcbb7ceddb942fb6571db83fd070af91572b87d449b248
|
Provenance
The following attestation bundles were made for qwed_ucp-0.1.0.tar.gz:
Publisher:
publish.yml on QWED-AI/qwed-ucp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qwed_ucp-0.1.0.tar.gz -
Subject digest:
f7431ce6bc0d00ec7e3bd874d498a678404a23a194a827a7e56546f41fe4b4f8 - Sigstore transparency entry: 831234822
- Sigstore integration time:
-
Permalink:
QWED-AI/qwed-ucp@e0076527d66f8df05f60564b3bab1c74a8fed8cb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/QWED-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e0076527d66f8df05f60564b3bab1c74a8fed8cb -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49cc09527f80fffa960fef75737583296384b3b494e182a534836821e69c3f78
|
|
| MD5 |
606c1771223a8847be4d7c91e4f108fc
|
|
| BLAKE2b-256 |
85ad59cc6b61d13a68279d946d04e9d82358a06091efd6eae00de16332c92a6f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
qwed_ucp-0.1.0-py3-none-any.whl -
Subject digest:
49cc09527f80fffa960fef75737583296384b3b494e182a534836821e69c3f78 - Sigstore transparency entry: 831234832
- Sigstore integration time:
-
Permalink:
QWED-AI/qwed-ucp@e0076527d66f8df05f60564b3bab1c74a8fed8cb -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/QWED-AI
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e0076527d66f8df05f60564b3bab1c74a8fed8cb -
Trigger Event:
release
-
Statement type: