To generate a keypair for signing in libsodium one can use (copied from documentation):
unsigned char pk[crypto_sign_PUBLICKEYBYTES];
unsigned char sk[crypto_sign_SECRETKEYBYTES];
crypto_sign_keypair(pk, sk);
crypto_sign_SECRETKEYBYTES resolves to crypto_sign_ed25519_SECRETKEYBYTES and the latter resolves to (32U + 32U).
When searching the internet for ed25519 private key length, it appears that the length should be 32 bytes.
Where does this discrepancy come from?
It appears that the public key is attached to the private key.
For example the following code (using lazysodium in Kotlin):
gives:
The second part of the private key is exactly the public key.