This project demonstrates how to encode, sign, and verify Ethereum-style attestations(signed by primuslabs) using Python.
- Python 3.8 or higher (recommended to use a virtual environment)
-
Clone the repository (if not already):
git clone https://github.com/xudean/attestation-verify-python-demo.git cd attestation-verify-python-demo
-
Install dependencies:
pip install -r requirements.txt
-
Prepare your attestation JSON:
- Edit or replace
attestation.json
with your attestation data(signed by primuslabs).
- Edit or replace
-
Run the demo:
-
Run demo to verify attestation:
python3 attestation_sign.py
This will:
- Load the attestation from
attestation.json
- Encode the attestation
- Attempt to recover the signer address from the signature
- Compare the recovered signer address with the expected signer address
- Load the attestation from
-
Run demo to sign an app signature and verify it:
python3 app_sign_and_verify.py
This will:
- Generate an app signature with app secret key
- Verify the app signature