I actually don‘t know.
I can only point you to the specs:
- https://github.com/nostr-protocol/nips/blob/master/04.md
- https://github.com/nostr-protocol/nips/blob/master/44.md
and to the author of Amethyst:
nostr:npub1gcxzte5zlkncx26j68ez60fzkvtkm9e0vrwdcvsjakxf9mu9qewqlfnj5z