Skip to main content
The sava-core module is the foundation of the Sava Solana Java SDK, providing essential functionality for interacting with the Solana blockchain.

What the Core Module Provides

The core module delivers low-level blockchain primitives and utilities:
  • Account Management: Public keys, signers, and program derived addresses (PDAs)
  • Transaction Building: Create, sign, and serialize Solana transactions
  • Instruction Creation: Build program instructions with account metadata
  • Encoding Utilities: Base58, byte manipulation, and compact encoding
  • Cryptography: Ed25519 signatures, SHA-256 hashing, and key generation
  • Borsh Serialization: Serialize and deserialize data using the Borsh format
  • Token Support: SPL Token and Token-2022 account structures
  • Address Lookup Tables: Optimize transaction size with lookup tables

Module Dependencies

Declared in module-info.java:
module software.sava.core {
  requires org.bouncycastle.provider;
}
The core module depends only on BouncyCastle for cryptographic operations.

Exported Packages

The module exports the following packages:
  • software.sava.core.accounts - Account and key management
  • software.sava.core.accounts.lookup - Address lookup table support
  • software.sava.core.accounts.meta - Account metadata for instructions
  • software.sava.core.accounts.sysvar - System variable accounts
  • software.sava.core.accounts.token - SPL Token account structures
  • software.sava.core.accounts.token.extensions - Token-2022 extension types
  • software.sava.core.accounts.vanity - Vanity key generation
  • software.sava.core.borsh - Borsh serialization utilities
  • software.sava.core.crypto - Cryptographic functions
  • software.sava.core.crypto.ed25519 - Ed25519 utilities
  • software.sava.core.encoding - Encoding and byte utilities
  • software.sava.core.programs - Program discriminators
  • software.sava.core.rpc - RPC filter utilities
  • software.sava.core.serial - Serialization interfaces
  • software.sava.core.tx - Transaction and instruction types
  • software.sava.core.util - General utilities

Core API Pages

Accounts API

SolanaAccounts interface and account management

PublicKey API

PublicKey interface and implementations

Signer API

Key pair generation and signing operations

PDA API

Program Derived Address creation

Transactions API

Transaction building and serialization

Instructions API

Instruction creation and serialization

Encoding API

Base58, byte utilities, and compact encoding

Borsh API

Borsh serialization and deserialization

Cryptography API

Hashing and signature verification

Tokens API

SPL Token and Token-2022 support

Getting Started

All core functionality is available through the exported packages. Import the classes you need:
import software.sava.core.accounts.PublicKey;
import software.sava.core.accounts.Signer;
import software.sava.core.tx.Transaction;
import software.sava.core.encoding.Base58;

// Generate a new keypair
var signer = Signer.createFromKeyPair(Signer.generatePrivateKeyPairBytes());

// Create a public key from base58
var pubKey = PublicKey.fromBase58Encoded("11111111111111111111111111111111");

// Build and sign a transaction
var tx = Transaction.createTx(feePayer, instructions);
tx.sign(blockHash, signer);

Build docs developers (and LLMs) love