Vitor Pamplona on Nostr: ok, now I understand it. It's about escaping the content field to create the JSON ...
ok, now I understand it.
It's about escaping the content field to create the JSON string. Some implementations are escaping newline char into "\n" (2 chars) but not other characters like LSEP into \u2028 (6 chars) before hashing.
Everything is fine in interfaces because they automatically space and unescape things.
But the hash is sensitive to those differences.
The issue is that some implementations PARTIALLY escape some characters and not escape others.
I am not sure if there is a standard for these choices.
Published at
2023-03-04 21:21:37Event JSON
{
"id": "f178b6ae8e0afa49ff08bb1d4cd7bb5bfeb8a3a3964c386dba1f524ca32eb581",
"pubkey": "460c25e682fda7832b52d1f22d3d22b3176d972f60dcdc3212ed8c92ef85065c",
"created_at": 1677964897,
"kind": 1,
"tags": [
[
"e",
"17a51656c40f15c903ea28069d1f22224576e840b8fb64e803da62b5aa5be27f",
"",
"root"
],
[
"e",
"cec81a0e1a9719a02c33d4693c3f20fb0ca8ef74499109d3a0c0b2c7030f453b",
"",
"reply"
],
[
"p",
"ccaa58e37c99c85bc5e754028a718bd46485e5d3cb3345691ecab83c755d48cc"
],
[
"p",
"32e1827635450ebb3c5a7d12c1f8e7b2b514439ac10a67eef3d9fd9c5c68e245"
],
[
"p",
"ccaa58e37c99c85bc5e754028a718bd46485e5d3cb3345691ecab83c755d48cc"
]
],
"content": "ok, now I understand it. \n\nIt's about escaping the content field to create the JSON string. Some implementations are escaping newline char into \"\\n\" (2 chars) but not other characters like LSEP into \\u2028 (6 chars) before hashing. \n\nEverything is fine in interfaces because they automatically space and unescape things. \n\nBut the hash is sensitive to those differences. \n\nThe issue is that some implementations PARTIALLY escape some characters and not escape others. \n\nI am not sure if there is a standard for these choices. ",
"sig": "77c54da061bf316b38a24af50f5ec09f4fc6073022cade55a7a2481c07a5d6763c90031590c3913fb12419e9662632b018e043c26b7d795aeb7cc3007df28a36"
}