npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@solana/keychain-aws-kms

v0.2.1

Published

AWS KMS-based signer for Solana transactions using EdDSA (Ed25519)

Downloads

625

Readme

@solana/keychain-aws-kms

AWS KMS-based signer for Solana transactions using EdDSA (Ed25519) signing.

Installation

pnpm add @solana/keychain-aws-kms @aws-sdk/client-kms

Prerequisites

  1. An AWS KMS key with:

    • Key spec: ECC_NIST_EDWARDS25519
    • Key usage: SIGN_VERIFY
  2. AWS credentials configured (see AWS Credentials below)

AWS Credentials

The signer uses the AWS default credential provider chain to authenticate. You don't need to pass credentials explicitly unless you want to override the defaults.

Credential Resolution Order

The AWS SDK looks for credentials in this order:

  1. Environment variables

    export AWS_ACCESS_KEY_ID="AKIAIOSFODNN7EXAMPLE"
    export AWS_SECRET_ACCESS_KEY="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
    export AWS_SESSION_TOKEN="..." # Optional, for temporary credentials
    export AWS_REGION="us-east-1"  # Optional
  2. Shared credentials file (~/.aws/credentials)

    [default]
    aws_access_key_id = AKIAIOSFODNN7EXAMPLE
    aws_secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
  3. IAM role (automatic when running on AWS EC2, ECS, or Lambda)

  4. Web identity token (for EKS/Kubernetes with IRSA)

Recommended Setup

| Environment | Recommended Method | |-------------|-------------------| | Production on AWS | IAM role attached to EC2/ECS/Lambda (no explicit creds needed) | | Local development | Environment variables or ~/.aws/credentials file | | CI/CD pipelines | Environment variables or OIDC | | Explicit control | Pass credentials in config (TypeScript only) |

Security Best Practices

  • Never commit credentials to source control
  • Use IAM roles in production instead of long-lived access keys
  • Use least-privilege IAM policies - only grant kms:Sign and kms:DescribeKey
  • Enable CloudTrail to audit KMS key usage

Creating an AWS KMS Key

Use the AWS CLI to create a key suitable for Solana signing:

aws kms create-key \
  --key-spec ECC_NIST_EDWARDS25519 \
  --key-usage SIGN_VERIFY \
  --description "Solana signing key"

Or use the AWS Console:

  1. Go to AWS KMS → Customer managed keys
  2. Click "Create key"
  3. Select "Asymmetric" key type
  4. Select "ECC_NIST_EDWARDS25519" key spec
  5. Select "Sign and verify" key usage
  6. Complete the key creation process

Usage

Basic Example

import { AwsKmsSigner } from '@solana/keychain-aws-kms';

const signer = new AwsKmsSigner({
    keyId: 'arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012',
    publicKey: 'YourSolanaPublicKeyBase58',
    region: 'us-east-1', // Optional, defaults to AWS config default
});

// Sign a message
const message = { content: new Uint8Array([1, 2, 3, 4]) };
const signatures = await signer.signMessages([message]);

// Sign a transaction
const signatures = await signer.signTransactions([transaction]);

With Custom Credentials

const signer = new AwsKmsSigner({
    keyId: 'arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012',
    publicKey: 'YourSolanaPublicKeyBase58',
    region: 'us-east-1',
    credentials: {
        accessKeyId: 'your-access-key-id',
        secretAccessKey: 'your-secret-access-key',
        sessionToken: 'optional-session-token', // For temporary credentials
    },
});

With Request Delay (Rate Limiting)

const signer = new AwsKmsSigner({
    keyId: 'arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012',
    publicKey: 'YourSolanaPublicKeyBase58',
    requestDelayMs: 100, // 100ms delay between concurrent requests
});

API Reference

AwsKmsSigner

Constructor

new AwsKmsSigner(config: AwsKmsSignerConfig)

Config Options:

  • keyId (required): AWS KMS key ID or ARN
  • publicKey (required): Solana public key (base58-encoded)
  • region (optional): AWS region (defaults to AWS config default)
  • requestDelayMs (optional): Delay in ms between concurrent requests (default: 0)
  • credentials (optional): AWS credentials object

Methods

  • signMessages(messages): Sign multiple messages
  • signTransactions(transactions): Sign multiple transactions
  • isAvailable(): Check if the signer is available and the key is valid

AWS IAM Permissions

The AWS credentials used must have the following permissions:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kms:Sign",
                "kms:DescribeKey"
            ],
            "Resource": "arn:aws:kms:*:*:key/*"
        }
    ]
}

Notes

  • Ed25519 signatures are 64 bytes
  • The signer uses ED25519_SHA_512 algorithm with RAW message type
  • The key must be in Enabled state to sign
  • Rate limiting can be configured via requestDelayMs to avoid AWS KMS throttling