Skip to main content

Public/Private Keys Overview

This page explains the basics of public/private key cryptography and how it works on Stellar, if you are already familiar with the concept, you can skip to the the next section.

Public/private key cryptography is the foundation of account security not only on Stellar, but across nearly all blockchains. The principle is the same everywhere:

  • A public key identifies you on the network.
  • A private key proves you are the rightful owner and authorizes actions.

The public key (Account ID) is mathematically derived from the private key, ensuring that anyone can verify your identity without ever knowing your secret.

Public Key (Account ID)

  • Format: Begins with G... for Classic Wallets and C... for Smart Wallets.
  • Purpose: Public identifier for receiving payments and being recognized on the network.
  • Usage: Safe to share — similar to a bank account number, but without revealing your ability to move funds.
  • Derivation: Generated from the private key using Ed25519 elliptic-curve cryptography.

Private Key (Secret Key)

  • Format: Begins with S...
  • Purpose: Signs transactions to authorize any change to the account or accounts it has signing power over — sending funds, creating trustlines, altering signers, etc.
  • Security Principle: Whoever has the private key controls the account.
  • Relationship: The public key is mathematically derived from it, but the reverse is computationally impossible.