New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

trac-wallet

Package Overview
Dependencies
Maintainers
4
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trac-wallet

This project provides a `WalletProvider` class that can generate wallets that store ED25519 keys, sign messages, and verify signatures. It also includes functionality to export keys to an encrypted file.

latest
Source
npmnpm
Version
2.0.1
Version published
Maintainers
4
Created
Source

Trac Wallet

This project provides a WalletProvider class that can generate wallets that store ED25519 keys, sign messages, and verify signatures. It also includes functionality to export keys to an encrypted file.

Installation

To install the necessary dependencies, run:

npm install

Usage

Generating a Wallet

You can create a new wallet with a randomly generated mnemonic phrase:

import { WalletProvider } from 'trac-wallet';

const provider = new WalletProvider({ addressPrefix: 'trac' });
const wallet = await provider.generate('optional-seed');

console.log(wallet.publicKey.toString('hex')); // Prints the public key

You can also create a wallet with a specific mnemonic phrase:

const mnemonic = 'session attitude weekend sign collect mobile return vacuum pool afraid wagon client';
const wallet = await provider.fromMnemonic({ mnemonic });
console.log(wallet.publicKey.toString('hex')); // Prints the public key

Signing and Verifying Messages

You can sign a message with the wallet's secret key and verify the signature with the public key:

const message = 'Hello, world!';
const signature = wallet.signMessage(message);
const isValid = wallet.verify(message, signature);
console.log(isValid); // Prints true if the signature is valid

Exporting Keys to a File

You can export the wallet's keys to a JSON file:

const filePath = './wallet.json';
exportToFile(wallet, filePath);

Running Tests

To run the tests, use the following command:

npm run test

FAQs

Package last updated on 19 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts