A Python SDK for AI agents to securely generate and verify 'hello' authentication messages, enabling seamless interaction between AI agents and AI-centric services.
Project description
Hello-Message Python SDK
The Hello-Message Python SDK provides a simple interface for generating and verifying "hello" authentication messages for AI-to-AI and AI-to-AI-first services. This SDK is designed to work by using cryptographic signatures for secure authentication.
Installation
Install the SDK from PyPI using pip:
pip install hello-message-sdk
Features
- Generate Hello Messages: Create signed "hello" messages using Ethereum private keys.
- Verify Signatures: Validate the authenticity of signed "hello" messages.
Quick Start
Generate a "Hello" Message
from hello_message import Hello
# Initialize the Hello SDK with a private key
private_key = "<your_ethereum_private_key>"
hello = Hello(private_key=private_key)
# Get the Ethereum address
address = hello.get_address()
print("Address:", address)
# Generate a signed "hello" message
hello_message = hello.generate_hello_message()
print("Hello Message:", hello_message)
Verify a "Hello" Message
from hello_message import Hello
# Example signature and address
signature = "<signature_from_hello_message>"
address = "<ethereum_address>"
# Verify the signature
is_valid = Hello.verify_signature(hello_message["signature"], hello_message["message"], address)
print("Is valid:", is_valid)
API Reference
Class: Hello
Hello(private_key: str)
Initialize the Hello object with an Ethereum private key.
private_key: Ethereum private key (string) used for signing messages.
get_address() -> str
Get the Ethereum address corresponding to the private key.
generate_hello_message() -> dict
Generate a signed "hello" message.
verify_signature(signature: str, message: str, address: str) -> bool
Verify the authenticity of a "hello" message signature.
signature: The signed "hello" message (string).message: The message to verify (string).address: The Ethereum address expected to have signed the message (string).
Returns:
Trueif the signature is valid.Falseotherwise.
Testing
Run the tests using pytest:
python -m pytest
Contributing
We welcome contributions from the community! To get started:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a detailed description of your changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
- Discussions: Join the conversation.
- Issues: Report bugs or request features.
Happy coding with Hello-Message Python SDK!
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 hello_message_sdk-0.2.0.tar.gz.
File metadata
- Download URL: hello_message_sdk-0.2.0.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cbb567c05a1335fd81ee227cfd0bada26517182efc1e62c5882d023e2a3d7bfd
|
|
| MD5 |
c98b3d557a23b83067abd1cdf5144913
|
|
| BLAKE2b-256 |
3d588883d7f8fd65fcc3e01932639b9f1a18911a2df4b2e519d7a5e261b08668
|
Provenance
The following attestation bundles were made for hello_message_sdk-0.2.0.tar.gz:
Publisher:
python-publish.yml on aimxlabs/hello-message-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hello_message_sdk-0.2.0.tar.gz -
Subject digest:
cbb567c05a1335fd81ee227cfd0bada26517182efc1e62c5882d023e2a3d7bfd - Sigstore transparency entry: 157077383
- Sigstore integration time:
-
Permalink:
aimxlabs/hello-message-python@136a2ca0309730a477556cc210bf4cfd381ed520 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/aimxlabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@136a2ca0309730a477556cc210bf4cfd381ed520 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hello_message_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: hello_message_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f485c3ee8e319f199a8d12b73ae96e2f2ac1690727d9a8286fbb2d0f526c3fb3
|
|
| MD5 |
162f5611b2f4dc426555a32544f2629e
|
|
| BLAKE2b-256 |
3432a48c314ca3e8ad322986902e11feef8f48e1d18b93cb4e32185513739924
|
Provenance
The following attestation bundles were made for hello_message_sdk-0.2.0-py3-none-any.whl:
Publisher:
python-publish.yml on aimxlabs/hello-message-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hello_message_sdk-0.2.0-py3-none-any.whl -
Subject digest:
f485c3ee8e319f199a8d12b73ae96e2f2ac1690727d9a8286fbb2d0f526c3fb3 - Sigstore transparency entry: 157077385
- Sigstore integration time:
-
Permalink:
aimxlabs/hello-message-python@136a2ca0309730a477556cc210bf4cfd381ed520 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/aimxlabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@136a2ca0309730a477556cc210bf4cfd381ed520 -
Trigger Event:
release
-
Statement type: