rust-bitcoin / rust-secp256k1

Rust language bindings for Bitcoin secp256k1 library.
Creative Commons Zero v1.0 Universal
353 stars 270 forks source link

Use `serde::de::DeserializeSeed` for `KeyPair` in case that we don't have global context #514

Open apoelstra opened 2 years ago

apoelstra commented 2 years ago

I haven't worked through this, but submitting so I don't forget ... the DeserializeSeed trait is there exactly to cover the case when a desereializer needs extra context (e.g. a secp context). So maybe we should use this rather than Deserialize in the non-global-context case?

apoelstra commented 2 years ago

(I got this from a footnote in this blog post which addresses this issue but proposes dramatic changes to Rust to solve it.)