Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

# Fuel Agent Kit

## Overview
Fuel Agent Kit is an agentic framework designed to enhance the capabilities of the Fuel Network. It provides tools, libraries, and infrastructure to build, deploy, and manage intelligent agents that can interact with the Fuel Network ecosystem.

## Prerequisites
Before you begin, ensure you have the following installed on your system:

- **Fuel Toolchain**: The Fuel development environment and toolchain.
- **Node.js**: Version 16 or higher for building and running agent applications.

## Installation

1. **Clone the Repository**:
```bash
git clone https://github.com/priyanshudumps/fuel-agent-kit.git
cd fuel-agent-kit
```

2. **Install Dependencies**:
```bash
npm install
```

3. **Set Up Environment**:
Configure your environment variables as specified in the `.env.example` file.

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
142 changes: 142 additions & 0 deletions docs/security/multi-sig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@

# Multi-Signature Support for Agents

## Why Use Multi-Signature Wallets?

Multi-signature (multi-sig) wallets provide enhanced security for managing high-value assets by requiring multiple parties to authorize transactions. This significantly reduces the risk of unauthorized access and loss of funds, making them ideal for:

- **High-value agent deployments** where a single point of failure could result in significant financial loss
- **Collaborative environments** where multiple stakeholders need to approve transactions
- **Compliance requirements** that mandate shared control over sensitive operations

## How Multi-Signature Works

Multi-sig wallets require **N-of-M** signatures, where:
- **N** = number of required signatures
- **M** = total number of authorized signers

For example, a 2-of-3 multi-sig wallet requires any 2 out of 3 authorized parties to sign a transaction.

## Initializing a Multi-Sig Transaction

### Prerequisites

1. **Multi-sig wallet setup**: Ensure your wallet is properly configured with the required number of signers
2. **Agent configuration**: Configure your Fuel Agent Kit to support multi-sig transactions
3. **Private keys**: Securely store the private keys for each signing party

### Step-by-Step Process

1. **Prepare the transaction**:
```typescript
import { MultiSigTransaction } from '@fuel-agent-kit/multi-sig';

// Create a new multi-sig transaction
const transaction = new MultiSigTransaction({
requiredSignatures: 2, // N
totalSigners: 3, // M
gasPrice: 1000000,
gasLimit: 100000,
inputs: [input1, input2],
outputs: [output1, output2],
data: transactionData
});
```

2. **Sign the transaction**:
Each authorized party signs their portion of the transaction:
```typescript
// Signer 1 signs the transaction
const signer1Signature = await transaction.signWithPrivateKey(privateKey1);

// Signer 2 signs the transaction
const signer2Signature = await transaction.signWithPrivateKey(privateKey2);
```

3. **Combine signatures**:
```typescript
transaction.addSignatures([signer1Signature, signer2Signature]);
```

4. **Broadcast the transaction**:
```typescript
const txId = await transaction.broadcast();
console.log(`Transaction broadcasted with ID: ${txId}`);
```

## Best Practices

1. **Key management**:
- Use hardware wallets for storing private keys
- Implement proper key rotation policies
- Never share private keys or signing credentials

2. **Transaction approval**:
- Require all authorized parties to review transactions before signing
- Implement timeouts for pending transactions to prevent indefinite delays

3. **Monitoring**:
- Set up alerts for failed or pending multi-sig transactions
- Regularly audit transaction history

4. **Recovery procedures**:
- Establish clear procedures for lost keys or compromised signers
- Consider using threshold signatures for improved security

## Example: 2-of-3 Multi-Sig Setup

```typescript
// Initialize a 2-of-3 multi-sig wallet
const multiSigWallet = new MultiSigWallet({
requiredSignatures: 2,
totalSigners: 3,
walletType: 'BIP32' // or 'BIP44', 'BIP49', etc.
});

// Add authorized signers
multiSigWallet.addSigner(signer1PublicKey);
multiSigWallet.addSigner(signer2PublicKey);
multiSigWallet.addSigner(signer3PublicKey);

// Create and sign a transaction
const tx = await multiSigWallet.createAndSignTransaction({
to: 'recipientAddress',
amount: 100000000,
data: 'transactionData'
});

// Broadcast the transaction
await tx.broadcast();
```

## Security Considerations

- **Quantum resistance**: Consider using post-quantum cryptographic algorithms for long-term security
- **Offline signing**: For high-value transactions, use offline signing devices
- **Audit trails**: Maintain comprehensive logs of all multi-sig transactions
- **Emergency procedures**: Define clear protocols for handling security breaches

## Troubleshooting

1. **Signature verification failures**:
- Verify all private keys are correctly formatted
- Ensure all signers are using the same transaction version
- Check for network issues that might prevent proper signature transmission

2. **Transaction timeouts**:
- Review your network's block time and adjust timeouts accordingly
- Consider implementing a fallback mechanism for delayed transactions

3. **Key management issues**:
- Regularly test backup and recovery procedures
- Implement proper access controls for key management systems

## Conclusion

Multi-signature wallets provide a robust security layer for managing high-value assets with the Fuel Agent Kit. By implementing proper multi-sig practices, you can significantly reduce the risk of unauthorized transactions while maintaining operational flexibility.

For more advanced use cases, consider integrating with:
- Smart contract wallets
- Time-locked transactions
- Decentralized identity solutions

49 changes: 49 additions & 0 deletions python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@

# Fuel Agent Kit - Python Implementation

Fuel Agent Kit provides tools for building and managing fuel agents in Python.

## Prerequisites

- Python 3.10 or higher
- pip package manager

## Installation

Install the Fuel Agent Kit using pip:

```bash
pip install fuel-agent-kit
```

## Quick Start

Here's how to initialize a basic Fuel Agent:

```python
from fuel_agent import FuelAgent

# Initialize a new Fuel Agent
agent = FuelAgent(
agent_id="my_agent_123",
name="My Fuel Agent",
description="A sample fuel agent implementation"
)

# Start the agent
agent.start()

# Stop the agent when done
agent.stop()
```

## Features

- Fuel agent management
- Configuration and initialization
- Integration with fuel infrastructure
- Extensible architecture for custom agents

## Documentation

For more detailed documentation and API reference, please visit our [official documentation](https://fuel-agent-kit.org/docs).