/solana-base58-json-converter

A small CLI tool to convert Solana keys from/to Base58 format to/from JSON format.

Primary LanguageRust

Solana Base58 <-> JSON Converter

A small CLI tool to convert Solana keys from/to Base58 format to/from JSON format.

Installation

cargo install solana-base58-json-converter

Usage

Convert JSON key to Base58

$ sbjc --json "[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]"
1111111111111111111111111111111111111111111111111111111111111111

Or

$ cat key.json
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

$ sbjc --json key.json
1111111111111111111111111111111111111111111111111111111111111111

Convert Base58 key to JSON

$ sbjc --base58 1111111111111111111111111111111111111111111111111111111111111111
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

or

$ sbjc --base58 1111111111111111111111111111111111111111111111111111111111111111 > key.json
$ cat key.json
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]