Skip to content
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

Event ID's should be hashes and the hashes field should not exist. #1127

Closed
jevolk opened this issue Feb 21, 2018 · 3 comments
Closed

Event ID's should be hashes and the hashes field should not exist. #1127

jevolk opened this issue Feb 21, 2018 · 3 comments
Assignees
Labels
improvement A suggestion for a relatively simple improvement to the protocol requires-room-version An idea which will require a bump in room version s2s Server-to-Server API (federation)

Comments

@jevolk
Copy link
Contributor

jevolk commented Feb 21, 2018

Appendix 4.2.2 "Room IDs and Event IDs" states:

An event has exactly one event ID. An event ID has the format:
$opaque_id:domain

There is no benefit to event ID's being opaque. A vehicle for useful federated information is lost by not standardizing the format of event ID's further than the sigil prefix and domain postfix. The effect of this loss is seen by:

  • Having to include additional structure in each event for a hashes object specified in Federation unstable.4.1 "PDU Fields."

  • Having to include additional structure in every single prev_event, prev_state, and auth_events list for a hashes object.

As one of several possible suggestions to improve this, the future specifier should consider the following:

$sha256$b58$DtRwDAMJW1BhvSS4SJQB6XZciiBtEQCngLScYaHFvp6yS:matrix.org

@richvdh richvdh added improvement A suggestion for a relatively simple improvement to the protocol requires-room-version An idea which will require a bump in room version labels May 3, 2018
@richvdh
Copy link
Member

richvdh commented May 3, 2018

the hashes field is (I learnt last week...) something different to the hashes you get in prev_event and friends.

So we have two hashes, the "content hash", which is based on the complete unredacted event; and the "reference hash", which is based on the redacted event in the same way as the signature.

The hashes field is the content hash. prev_event, prev_state and auth_events all use the reference hash (so that you know you're looking at the right event, even if you are seeing a redacted version of it). So the event id would want to be based on the reference hash.

So, everything you said is true, except that the hashes field still has a (different) purpose and should still exist.

@jevolk
Copy link
Contributor Author

jevolk commented May 4, 2018

So the hashes field remains for redactions but we lose the hashes in the prev_*. Then everything except the content is used to create the event_id hash.

Correction: Specifically prev_events and auth_events because prev_state is already dead it seems...

@ara4n ara4n added spec-bug Something which is in the spec, but is wrong s2s Server-to-Server API (federation) labels Sep 3, 2018
@richvdh richvdh removed the spec-bug Something which is in the spec, but is wrong label Sep 7, 2018
@erikjohnston
Copy link
Member

Fixed by #1659 :)

RiotTranslateBot pushed a commit to RiotTranslateBot/matrix-doc that referenced this issue Aug 22, 2023
* keys.yml: fix one_time_keys object contents

The alternatives previously listed under two additionalProperties levels
are actually one _more_ level deeper; we still can't define them in
a formal way before moving to OpenAPI 3 but at least let's be honest
and say there's always a dict where there's always a dict. Also,
since the same data structure is used in three places now, at least
give it a name, and document the actual definition (once) separately
(not using it now because it's OpenAPI 3).

* Changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement A suggestion for a relatively simple improvement to the protocol requires-room-version An idea which will require a bump in room version s2s Server-to-Server API (federation)
Projects
None yet
Development

No branches or pull requests

5 participants