CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-solana--web3-js

Comprehensive JavaScript SDK for building Solana blockchain applications with modern architecture and type safety

93

1.29x

Evaluation93%

1.29x

Agent success when using this tile

Overview
Eval results
Files

task.mdevals/scenario-8/

Wallet Key Manager

Build a wallet key management utility for a Solana application that generates and manages cryptographic keypairs. The utility should support creating new keypairs, restoring keypairs from existing secret keys, generating deterministic keypairs from seeds, and signing messages.

Requirements

Random Keypair Generation

Create a function that generates a new random cryptographic keypair. Each generated keypair should be unique and suitable for wallet creation.

Keypair Restoration from Secret Key

Support restoring a full keypair from a previously saved secret key in byte array format (64 bytes). This allows recovering a keypair from its secret key.

Seed-Based Keypair Generation

Implement functionality to generate a deterministic keypair from a 32-byte seed. Using the same seed should always produce the same keypair.

Message Signing

Provide capability to sign arbitrary byte messages using a keypair. Return the signature as a byte array.

Test Cases

  • Generating a new keypair returns an object with publicKey and secretKey properties @test
  • Restoring a keypair from a known 64-byte secret key recreates the correct keypair @test
  • Generating a keypair from the same 32-byte seed twice produces identical keypairs @test
  • Signing a message with a keypair produces a 64-byte signature @test

Implementation

@generates

API

/**
 * Generates a new random cryptographic keypair
 * @returns {Object} A keypair object with publicKey and secretKey
 */
function generateKeypair() {
  // Implementation
}

/**
 * Restores a keypair from a secret key
 * @param {Uint8Array} secretKey - The 64-byte secret key
 * @returns {Object} The restored keypair
 */
function restoreFromSecretKey(secretKey) {
  // Implementation
}

/**
 * Generates a deterministic keypair from a seed
 * @param {Uint8Array} seed - The seed bytes (32 bytes)
 * @returns {Object} A keypair derived from the seed
 */
function generateFromSeed(seed) {
  // Implementation
}

/**
 * Signs a message using a keypair
 * @param {Object} keypair - The keypair to sign with
 * @param {Uint8Array} message - The message to sign
 * @returns {Uint8Array} The signature bytes (64 bytes)
 */
function signMessage(keypair, message) {
  // Implementation
}

module.exports = {
  generateKeypair,
  restoreFromSecretKey,
  generateFromSeed,
  signMessage
};

Dependencies { .dependencies }

@solana/web3.js { .dependency }

Provides Solana blockchain cryptographic primitives and utilities.

Install with Tessl CLI

npx tessl i tessl/npm-solana--web3-js

tile.json