Authentication

In Permagit, your identity is not tied to a username, password, or email address. Instead, your Solana wallet is your account. All actions—such as pushing code, encrypting private repositories, and signing collaborative updates—are tied directly to your wallet's public key.

Why a Solana Wallet?

  • Decentralized Identity: Your public key (e.g., 5x...7y) serves as your unique, global username.

  • Cryptographic Security: Instead of a password, you "sign" transactions and uploads with your private key. This signature is verifiable proof that you authorized the action.

  • Encryption Key: As we will see in Page 5, your wallet is used to derive a unique, 1:1 encryption key for securing your private repositories.

Connecting Your Wallet (CLI Login)

For the permagit CLI to act on your behalf, it needs access to your wallet to create signatures. The most common and secure method for a command-line environment is using a filesystem keypair file.

Note: A keypair file is a JSON file (often named id.json or solana.json) that securely stores your private key. It's crucial that you never share this file or commit it to a repository.

Step 1: Locate or Generate a Keypair

If you already have a keypair file from using the Solana CLI, you can use that. It is often located at ~/.config/solana/id.json.

If you need to generate a new one, you can use the Solana CLI tools:

# Install the Solana CLI if you don't have it
sh -c "$(curl -sSfL https://release.solana.com/v1.18.4/install)"

# Generate a new keypair file
solana-keygen new

This will create a new id.json file in the default location.


Step 2: Log in with the Permagit CLI

To authenticate, you simply point the permagit CLI to your keypair file.

Run the login command:

permagit login --keypair /path/to/your/keypair.json

If you use the default Solana CLI path, you can often omit the path:

permagit login

The CLI will securely load your keypair and store its location in its local configuration. Your private key never leaves your machine. It is only used locally to sign transactions that are then broadcasted.

Checking Your Identity

Once you have logged in, you can verify your identity at any time by running the whoami command:

permagit whoami

This will display the Solana public key (wallet address) that you are currently authenticated with.

You are logged in as:
5xAbCdEfGhIjKlMnOpQrStUvWxYz1234567890aB

Any repositories you push will now be associated with this public key.

Last updated