🚀 PIT Agent Framework
Welcome to the PITAGENT Framework — a powerful system for creating and managing Programmable Intelligent Tokens (PITs) on a blockchain! 🌐
This framework allows developers to build and manage programmable tokens that contain specific logic, allowing for flexible and customizable interactions within decentralized applications (dApps) and ecosystems. PIT tokens can be used in a variety of use cases, from finance to gaming, offering secure and intelligent token management.
Features ✨
- Agent Management: Easily create and manage agents (users) with their associated tokens.
- Programmable Tokens: Tokens can carry conditions such as time-locks, amounts, or custom logic that must be met before they can be transferred or used.
- Blockchain Integration: Interaction with the blockchain (Solana, Ethereum, etc.) for secure and tamper-proof token storage and transactions.
- Token Conditions: Programmable logic that defines how tokens can be transferred or used.
- RESTful API: Comprehensive API to create agents, mint tokens, transfer tokens, and validate conditions.
Technologies Used 🛠️
- Flask: Lightweight web framework for Python.
- SQLAlchemy: ORM (Object-Relational Mapper) for working with databases.
- Solana (or Ethereum): Blockchain for token management (Solana in this example).
- Python 3.8+: Programming language for backend logic.
Quick Start 🚀
Prerequisites 📋
- Python 3.8+ installed.
- Flask and other Python libraries.
Installation 🛠️
-
Clone the repository:
git clone https://github.com/yourusername/pitagents.git cd pitagents
-
Create a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Run the application:
python app.pyThe Flask server will start at http://127.0.0.1:5000/.
Usage 📚
You can interact with the API using tools like curl, Postman, or any HTTP client of your choice. Below are examples of the API endpoints:
API Endpoints 📡
1. Create an Agent
- Endpoint:
/api/agents/create - Method:
POST - Body:
{ "agent_id": "agent_1" }
- Response:
{ "message": "Agent agent_1 created successfully." }
2. Mint a Token for an Agent
- Endpoint:
/api/tokens/mint - Method:
POST - Body:
{ "agent_id": "agent_1", "token_data": { "amount": 100, "purpose": "Utility token", "condition": "time_lock" } }
- Response:
{ "message": "Token minted successfully", "token": { "token_id": "TKN_1627568937", "amount": 100, "purpose": "Utility token", "condition": "time_lock" } }
3. Transfer a Token
- Endpoint:
/api/tokens/transfer - Method:
POST - Body:
{ "from_agent_id": "agent_1", "to_agent_id": "agent_2", "amount": 50 }
- Response:
{ "message": "Token transferred successfully", "transfer": { "from": "agent_1", "to": "agent_2", "amount": 50 } }
4. Validate Token Conditions
- Endpoint:
/api/tokens/validate - Method:
POST - Body:
{ "token_id": "TKN_1627568937" }
- Response:
{ "is_valid": true }
Project Structure 📂
PIT_Framework/
├── app.py # Main Flask API to interact with the framework
├── pit_token_logic.py # Logic for minting, transferring tokens and applying conditions
├── solana_service.py # Interactions with the Solana blockchain
├── models.py # SQLAlchemy models for Agents and PIT Tokens
├── requirements.txt # List of project dependencies
└── README.md # Project documentation (you're here)
Contributing 🤝
We welcome contributions! Feel free to fork the project, make changes, and submit a pull request. Here's how you can contribute:
- Fork the repo
- Create a new branch for your feature or fix:
git checkout -b feature/YourFeature - Commit your changes:
git commit -m 'Add new feature' - Push your branch:
git push origin feature/YourFeature - Create a Pull Request: Open a PR on GitHub.
License 📄
This project is licensed under the MIT License. See the LICENSE file for more details.
Contact 📧
- Email: pitagentsdev@gmail.com
- Twitter: @pitagentsai
- GitHub: @pitagentsai
Acknowledgements 🎉
- Inspired by the need for scalable and programmable token systems.
- Built with love using Flask, Solana, and SQLAlchemy.
- Special thanks to the blockchain community for their constant innovation.
Happy coding! ✨
Release files for pitagentsai 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pitagentsai-1.1.0.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pitagentsai-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.4 kB
Release files / pitagentsai-1.1.0.tar.gz
| Download URL | pitagentsai-1.1.0.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
990b682a3c6015bf3960b74a31a25d66d9a399176eade57d04088ceb46bdef61
|
|
BLAKE2b-256 checksum How to use checksums |
3d3c6569a67cf5c6c2ff72196a8c132e8e23899c20d76278684b3a44760695e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|
Release files / pitagentsai-1.1.0-py3-none-any.whl
| Download URL | pitagentsai-1.1.0-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a8c068a80a9cec363c0b10f7debf89045d123dd41773730a8499188bef45169
|
|
BLAKE2b-256 checksum How to use checksums |
86484bb7428d5d4b87c47a6b211535a55ae70cfaf5de077d104ff577025c2978
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.1
|