Note: This guide targets themainbranch of the Kora repository. The integration test harness (harness_context,KoraSpec, and the[[test]]targets) and thejustrecipes referenced below exist only onmainand the beta tags. Thev2.0.5tag has none of them.
Architecture Overview
Kora uses the externalsolana-keychain crate
for all signing operations. This architecture provides a unified signing
interface for signing Solana transactions. To add a new signer to Kora, you’ll
need to:
- First: Add your signer implementation to the
solana-keychaincrate - Second: Add configuration support for your signer in Kora
Step-by-Step Integration Guide
Quick Integration Checklist
Part 1: Add Signer tosolana-keychain Crate
- Implement your signer following the solana-keychain integration guide
- Wait for PR approval and crate publication
- Update Cargo.toml’s dependency so that
solana-keychaincrate uses the latest version (that includes your signer) - Add configuration struct for your signer’s environment variables
- Update
SignerTypeConfigenum incrates/lib/src/signer/config.rs - Add validation logic for your signer’s config
- Add build logic to construct your signer from config
- Export configuration struct in
crates/lib/src/signer/mod.rs - (Optional) Add test mock builder in
crates/lib/src/tests/config_mock.rs - Update example configuration files
- Update test scripts to include your signer (see below)
- Update documentation to include your signer (see below)
- Submit PR to Kora repository
Add Signer Support in Kora
First, ensure your signer is supported in thesolana-keychain crate. If it is
not, follow the guide at:
https://github.com/solana-foundation/solana-keychain/blob/main/docs/ADDING_SIGNERS.md
Step 1: Update Cargo.toml
Update Cargo.toml’s dependency so thatsolana-keychain crate uses the latest
version (that includes your signer):
2.x series with sdk-v4 is what main uses. The v2.0.5 tag depends on
solana-keychain 0.1.0 with sdk-v3.
Step 2: Define Your Configuration Struct
Incrates/lib/src/signer/config.rs, add a new configuration struct for your
signer that defines which environment variables are needed. For example:
Step 3: Add Your Signer to SignerTypeConfig Enum
Add your signer variant to the SignerTypeConfig enum in
crates/lib/src/signer/config.rs:
Step 4: Add Build Logic
In the same file (config.rs), add a method to build your signer from
configuration in the SignerConfig implementation:
Signer::from_your_service() should match what you
implemented in the solana-keychain crate.
Step 5: Add Validation Logic
Add validation for your signer’s configuration in thevalidate_individual_signer_config method:
Step 6: Export Your Configuration
Add your new config struct to the module exports incrates/lib/src/signer/mod.rs (or at the top of the file if it’s public):
Testing Your Integration
Add Test Mock Builder
To make testing easier, add a builder method toSignerPoolConfigBuilder in
crates/lib/src/tests/config_mock.rs:
Environment Variables
Add the example environment variables to the following files:.env.example(root of the project).env(root of the project, for local testing)sdks/ts/.env(local only; the TypeScript SDK tests load it when you run them fromsdks/ts)
Integration Tests
Each integration phase is its own[[test]] target in tests/Cargo.toml. Every
target boots an embedded surfnet plus a Kora node through harness_context,
seeded from scratch. Kora keeps config in process-global state, so a new signer
needs a new target rather than a new module in an existing one.
1. Add a Signer Fixture
Create a signer configuration intests/src/common/fixtures/:
2. Add a Test Target
Register the phase intests/Cargo.toml:
tests/your_service/main.rs. It points the harness at your fixture
and must contain at least one #[tokio::test] that exercises the signer:
signTransaction test as well so the signer’s signing path runs, not just
key lookup. tests/multi_signer/ is a complete example to copy from.
3. Running Tests
Documentation Requirements
When submitting your PR, include:1. Update the Signers Guide
Add signer documentation following theADDING_SIGNERS.md
guide, explaining the prerequisites, setup, and usage.
2. Update README
Add your service to the main README’s signer list.Submission Checklist
- Your signer is supported in the
solana-keychaincrate - Updated
solana-keychaindependency in Cargo.toml to latest version - Added configuration struct for your signer
- Added
SignerTypeConfigvariant - Added build logic in
build_signer_from_config - Added validation logic in
validate_individual_signer_config - Exported configuration struct in
mod.rs - (Optional) Added test mock builder method in
config_mock.rs - Code compiles without warnings
- All tests pass (
just test) - Code is formatted (
just fmt) - Documentation added following
ADDING_SIGNERS.md - Example configuration files created (
.tomland.env.example) - No hardcoded values or secrets
- Error messages are helpful
- Follows Rust naming conventions (snake_case)
- Formatting and lint checks pass (
just check) - Contact the Kora team with API Keys for integration testing
Getting Help
- For signer implementation: Open an issue in the
solana-keychainrepository - For Kora integration: Open an issue in the Kora repository for design discussions
- Join our community channels
- Review existing signer configurations in
crates/lib/src/signer/config.rs(pinned to v2.0.5; seemainfor the latest)