-
Notifications
You must be signed in to change notification settings - Fork 552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bech32 embeds #1078
base: master
Are you sure you want to change the base?
Bech32 embeds #1078
Conversation
I like this. It could solve the |
So an eyeglasses payload from an electronic medical record looks like this: {
"resourceType": "VisionPrescription",
"status": "active",
"created": "2014-06-15",
"patient": {
"reference": "Patient/example"
},
"dateWritten": "2014-06-15",
"prescriber": {
"reference": "Practitioner/example"
},
"lensSpecification": [
{
"eye": "right",
"sphere": -2,
"prism": [
{
"amount": 0.5,
"base": "down"
}
],
"add": 2
},
{
"eye": "left",
"sphere": -1,
"cylinder": -0.5,
"axis": 180,
"prism": [
{
"amount": 0.5,
"base": "up"
}
],
"add": 2
}
]
} It is signed as a {
"id": "73a5ace1c95de239ea355a745abfafee39d4dc613081a5c3dc25158c9385620d",
"pubkey": "bcd4715cc34f98dce7b52fddaf1d826e5ce0263479b7e110a5bd3c3789486ca8",
"created_at": 1708705561,
"kind": 82,
"tags": [],
"content": "{\"resourceType\":\"VisionPrescription\",\"status\":\"active\",\"created\":\"2014-06-15\",\"patient\":{\"reference\":\"Patient/example\"},\"dateWritten\":\"2014-06-15\",\"prescriber\":{\"reference\":\"Practitioner/example\"},\"lensSpecification\":[{\"eye\":\"right\",\"sphere\":-2,\"prism\":[{\"amount\":0.5,\"base\":\"down\"}],\"add\":2},{\"eye\":\"left\",\"sphere\":-1,\"cylinder\":-0.5,\"axis\":180,\"prism\":[{\"amount\":0.5,\"base\":\"up\"}],\"add\":2}]}",
"sig": "e87f7c360a1b01fc436b081037eb11b5e0c23714907427c5e124611a3a004d3c13841d965842766dd85a0a3eaa6c14e053764f67848e892f3a4776ce5046b63f"
} which creates the following bech32:
Agree. But I didn't want to make a whole new serialization scheme for events. |
Funny thing... if we start using compression, we could gzip the JSON-stringified event and the final re-encoded bech32 becomes smaller than the original event. The full JSON of the signed event is 802 chars Compression of the signed event JSON string is 474 bytes
As a comparison, a regular nevent with relays in it is this big:
|
These are just ideas: |
Creates a
nembed
bech32 encoding to carry JSON-stringified events as Nostr URIs and facilitate the loading of those events by Clients without having to ping a relay.This is particularly helpful for exporting existing/pre-signed health information payloads from corporate/private relays and send to users who might not have direct access to them. Health providers are used to including these payloads inside private communications with patients and adding information around them for better context.
A use case would be the following encrypted DM:
PS: I am not attached to the
embed
name. Suggestions are welcome.