vck
vck copied to clipboard
Selective Disclosure in `kotlinx.serialization`
For any actual real-life wallet use case, we will need some kind of selective disclosure of credentials.
It would be very nice to extend kotlinx.serialization
with redactable fields; essentially serialization for a Redactable<T>
object (essentially a fancy optional) with serialization to JWP or some other (non-binary) merkle tree-like structure.
Not a very well-formed idea yet, but it'd be very convenient to be able to do
@Serializable
data class Credential(
val firstname: Redactable<String>,
val lastname: Redactable<String>,
val dob: Redactable<String>)
and then have this serialize to a (partially-redacted) Merkle tree. I am also not sure how to best handle revealing of individual nodes after the fact; this sounds like it might need code generation (akin to what kotlinx.serialization already does?) to be done efficiently.
It's... an idea, not very well-structured yet. @JesusMcCloud told me to post it here either way.