Getting Started

Install, configure, and start using SGAIP in minutes

Choose your preferred language:

Python Installation & Guide

1

Install SGAIP

pip install sgaip

This installs the SGAIP package from PyPI with both CLI tools and library support.

2

Verify Installation

sgaip --version

Confirms that SGAIP is properly installed and ready to use.

3

Generate Your First Keys

sgaip keygen

Creates two files:

  • • agent.sk — Your private key (keep secret!)
  • • agent.pk — Your public key (safe to share)
4

Sign a Message

sgaip sign --private agent.sk --message "Hello SGAIP"

Creates a cryptographic signature proving you authored the message.

5

Verify a Signature

sgaip verify --public agent.pk --signature signature.bin --message "Hello SGAIP"

Confirms the signature is authentic without needing the private key.

Using SGAIP as a Python Library

from sgaip import generate_keypair, derive_aid, create_proof

# Generate identity
private_key, public_key = generate_keypair()
aid = derive_aid(public_key)

# Create proof
challenge = b"random_challenge"
proof = create_proof(private_key, challenge)
print(f"AID: {aid}")

JavaScript / TypeScript Guide

1

Install SGAIP

# Global installation
npm install -g sgaip

# Or for project use
npm install sgaip

Install globally for CLI access or locally for library use in your project.

2

Verify Installation

sgaip --version

Confirms proper installation of the SGAIP CLI.

3

Generate Keys

sgaip keygen

Creates agent.sk and agent.pk files.

4

Sign & Verify

# Sign
sgaip sign --private agent.sk --message "Hello SGAIP"

# Verify
sgaip verify --public agent.pk --signature signature.bin --message "Hello SGAIP"

Using SGAIP in TypeScript

import { generateKeyPair, deriveAID, createProof } from 'sgaip';

// Generate identity
const { privateKey, publicKey } = generateKeyPair();
const aid = deriveAID(publicKey);

// Create proof
const challenge = Buffer.from('random_challenge');
const proof = createProof(privateKey, challenge);
console.log(`AID: ${aid}`);

📚 Common Use Cases

🔑

Create Agent Identity

Generate a unique, cryptographic identity for your agent that works everywhere.

✍️

Sign Messages

Prove you created a message without revealing your private key.

✅

Verify Authenticity

Confirm a message came from a specific agent using their public key.

🔗

Establish Trust

Build systems where identities are cryptographically proof-based.

🔧 Troubleshooting

Command not found: sgaip

Make sure SGAIP is installed in your PATH. Try:

python -m sgaip --version  # Python
npm list -g sgaip            # npm

Permission denied on keys

Fix private key file permissions:

chmod 600 agent.sk

Signature verification failed

Common causes:

  • • Message text changed (whitespace matters!)
  • • Using wrong public key
  • • Signature file corrupted

What's Next?

You've got the basics down. Here's what to explore: