Nonce should be random. Output all messages as debug. Don't pre-format log messages.
Build the header on-demand
Fix typo, this should be payload, not bytes