cosmos / cosmos-rust

The home of all shared Rust resources for the Cosmos ecosystem.
Apache License 2.0
310 stars 125 forks source link

How to output the private key and print it to the terminal? #456

Closed RustMan88 closed 9 months ago

RustMan88 commented 10 months ago

The fmt trait is not implemented for crypto::secp256k1::SigningKey , So how to output the private key and print it to the terminal?

micovi commented 9 months ago

Hi @RustMan88, did you manage to find a way to output private keys in the terminal using this?

tony-iqlusion commented 9 months ago

crypto::secp256k1::SigningKey can't be output to the terminal.

It's a wrapper type for a trait object, and designed to support hardware key storage as well including e.g. hardware wallets / HSMs, in addition to software-backed keys.

If you want the original key, you need to use your original input you instantiated it with.