Using serde/bincode to serialize SecretKey or PublicKey results in an unneeded eight-byte length.
This length is unneeded, as we already know that the SecretKey is 32 bytes and the PublicKey is 33 bytes.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
struct Hash([u8; 32]);
let hash = Hash([1u8; 32]);
let hash_bin = bincode::serialize(&hash).unwrap();
assert_eq!(hash_bin, [1u8; 32]);
let skey = SecretKey::from_slice(&[2u8; 32]).unwrap();
let skey_bin = bincode::serialize(&skey).unwrap();
assert_eq!(skey_bin, [2u8; 32]);
thread 'tests::it_works' panicked at 'assertion failed: `(left == right)`
left: `[32, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]`,
right: `[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]`'