Using the php Function Sodium_Crypto_Sign_PublicKeyFrom_SecretKey
Article
This function does not work for Nano, as it requires a 64 bytes keypair, while the private key is only 32 bytes in Nano. This is due to the fact that Nano uses a variant of Ed25519, which is not supported by the standard Libsodium library. Instead, you need to use the functions sodium_base642bin and sodium_bin2base64 for decoding/encoding the raw binary. Also try sodium_aead_chacha20poly1305_ietf_keygen for generating a random ChaCha20-Poly1305 (IETF) key.
What's Next? Subscribe to our newsletter.