How do I correctly use libsodium so that it is compatible between versions? : <p>I'm planning on storing a bunch of records in a file, where each record is  then signed with <a href="https://libsodium.org/">libsodium</a>. However, I would like future versions of my program to be able to check signatures the current version has made, and ideally vice-versa.</p>

<p>For the current version of Sodium, signatures are made using the Ed25519 algorithm. I imagine that the default primitive can change in new versions of Sodium (otherwise libsodium wouldn't expose a way to choose a particular one, I think).</p>

<p>Should I...</p>

<ol>
<li>Always use the default primitive (i.e. <code>crypto_sign</code>)</li>
<li>Use a specific primitive (i.e. <code>crypto_sign_ed25519</code>)</li>
<li>Do (1), but store the value of <code>sodium_library_version_major()</code> in the file (either in a dedicated 'sodium version' field or a general 'file format revision' field) and quit if the currently running version is lower</li>
<li>Do (3), but also store <code>crypto_sign_primitive()</code></li>
<li>Do (4), but also store <code>crypto_sign_bytes()</code> and friends</li>
</ol>

<p>...or should I do something else entirely?</p>

<p>My program will be written in C.</p>
