I think we should have a documented policy on the scope of the library. The discussion comes up from time to time [0] and has never really been resolved, I think. We don’t strictly need answers to these questions but I feel a written policy would avoid some discussions and bikeshedding in the future. And of course, a policy won’t be written in stone, we can still change it if have a reason to do so.
One way to approach this is “features that are used by Bitcoin Core now or a have a good chance to be used by Bitcoin Core in the future”. ECDH was somewhat of an exception here but maybe it will be used in the future for BIP324 (P2P encryption).
Another approach is to add features that are useful to the wider ecosystem. Of course, this does not mean that we need to accept every feature that meets this definition — including features means that we commit on maintaining them.
I think with ECDH and Java bindings, the thinking here was more towards the latter approach. Personally I lean more towards the former idea because it avoids the need to take decisions about what to include, and it saves resources. (For example, Java bindings have been removed for a reason.)
A somewhat related discussion is the one about experimental features (#817). For example, if we view musig2 as something that can be experimented around with in a fork such as secp256k1-zkp but then plan on porting it to here [0], then what’s the difference to something which can go in as an experimental module? Is musig2 “super-experimental”, is it just not clear yet if it has a good chance of ending up in Bitcoin Core or is there just really no difference in the end?
Right now, I think there’s a good chance that #995 will be merged, so if we wanted to deprecate experimental modules (as has been proposed in #817 but couldn’t find consensus), now would be a good time.
[0] https://github.com/bitcoin/bitcoin/issues/23326#issuecomment-947942068