remove id from wire form wrapper as it is unnecessary
This commit is contained in:
@@ -41,4 +41,8 @@ The primary data structure is designed to wrap the message within the authentica
|
||||
|
||||
Note that here is shown the pretty printed form, it must be processed for verification in minified form as sent on the wire.
|
||||
|
||||
Also note that the `"content"` field is escaped with the simple escaping scheme used with nostr which only escapes control characters with the single letter type, any other special characters must be in standard utf `\uXXXX` form. Only change these unicode escape characters for presentation, in JSON form the process of unescaping and escaping must be reversible.
|
||||
Also note that the `"content"` field is escaped with the simple escaping scheme used with nostr which only escapes control characters with the single letter type, any other special characters must be in standard utf `\uXXXX` form. Only change these unicode escape characters for presentation, in JSON form the process of unescaping and escaping must be reversible.
|
||||
|
||||
### Signed Form of Event
|
||||
|
||||
Because we stipulate a consistent structure to the event JSON, it is not necessary to include the event Id in the wire encoded message. The receiver can then slice the message up to derive the Id to use with the public key to verify the event.
|
||||
@@ -2,7 +2,6 @@ package event
|
||||
|
||||
import (
|
||||
"github.com/mleku/transit/content"
|
||||
"github.com/mleku/transit/id"
|
||||
"github.com/mleku/transit/kind"
|
||||
"github.com/mleku/transit/mime"
|
||||
"github.com/mleku/transit/pubkey"
|
||||
@@ -23,11 +22,10 @@ type E struct {
|
||||
|
||||
// Signed uses a wrapped structure around event.E so that generating the hash on the embedded
|
||||
// event is just a matter of extracting and hashing it. It is also placed at the top of the
|
||||
// structure so that one can just find the `"id":` text and cut the text out from the initial
|
||||
// structure so that one can just find the `"sig":` text and cut the text out from the initial
|
||||
// parenthesis until this object key. For this reason, ensure that your JSON encoder produces
|
||||
// consistent ordering of the fields as shown below.
|
||||
type Signed struct {
|
||||
*E `json:"event" doc:"embedded event"`
|
||||
Id *id.I `json:"id" doc:"Blake3 hash of embedded event in base64 URL encoding"`
|
||||
Signature *signature.S `json:"sig" doc:"ed25519 signature on event"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user