-
Notifications
You must be signed in to change notification settings - Fork 401
MSC3672: Sharing ephemeral streams of location data #3672
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
12066dd
55fb0ed
861dc4c
c7c032e
2a26b20
f439d3e
fb30996
f063795
440a5d1
a72bda3
de543b1
6144b23
35c20f6
a62d237
76df8b5
4a922c4
f035694
e07abb3
45389a5
43d224a
750635d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# MSC3672 - Sharing ephemeral streams of location data | ||
|
||
## Problem | ||
|
||
[MSC3489](https://github.com/matrix-org/matrix-doc/blob/matthew/location-streaming/proposals/3489-location-streaming.md) | ||
focuses on streaming persistent location data for applications that require | ||
historical knowledge. | ||
|
||
We also need the ability to share this data in a non-persistent way for cases in | ||
which privacy is a concern, like user locations. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this needs a bit of a longer justification of why this is needed and why EDUs are the way to go. Some ideas:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you. I've added more details for the first two points but perhaps the last one should be taken up in MSC2477? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might make sense to pick that up in the justification for a bit, i.e. "You can make EDUs expire after some time, so they never get delivered to devices, which are offline for some time" or so, if that is actually possible with 2477. It's been a while since I read it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added some wording about how long the server should keep the EDUs, and I think the beginning part of the Proposal section clarify the justification for EDUs. What do you think @deepbluev7 ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Took me a while to find, but yes, that looks reasonable. Does that work when the EDU is encrypted? Because then the event type is m.room.encrypted, isn't it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I should have provided a proper link. I expect that if we later add the ability to specify delivery guarantees for EDUs, we will include that in the unencrypted part. Before we have that, servers will have to apply the same policy to all user-defined encrypted EDUs. |
||
|
||
## Proposal | ||
|
||
This MSC adds the ability to publish short-lived location beacons through the | ||
the use of custom Ephemeral Data Units (EDUs) by building on top of [MSC2476](https://github.com/ananace/matrix-doc/blob/user-defined-edus/proposals/2477-user-defined-ephemeral-events.md). | ||
|
||
In order to do so we will start by introducing a new boolean property on | ||
`m.beacon_info` called `live` which will mark the start of an user's | ||
intent to share ephemeral location information. | ||
|
||
```json5 | ||
{ | ||
"type": "m.beacon_info.@stefan:matrix.org", | ||
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"state_key": "@stefan:matrix.org", | ||
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"content": { | ||
"m.beacon_info": { | ||
"description": "Stefan's live location", | ||
"timeout": 600000, // how long from the last event until we consider the beacon inactive in milliseconds | ||
"live": true // this is a live location beacon | ||
}, | ||
"m.ts": 1436829458432, // creation timestamp of the beacon on the client | ||
"m.asset": { | ||
"type": "m.self.live" // live user location tracking | ||
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} | ||
} | ||
``` | ||
|
||
We define this new property in order to allow clients to distinguish between | ||
share types without potentially overwriting static ones. | ||
|
||
Multiple live beacons on the same timeline have the option of either aggregating | ||
all available location EDUs or just the ones referencing a particular | ||
`beacon_info`. | ||
|
||
Subsequently clients will start sending beacon data EDUs to the new | ||
`rooms/{roomId}/ephemeral/{eventType}/{txnId}` endpoint where `eventType` equals | ||
`m.beacon` with the same location payload as defined in [MSC3489](https://github.com/matrix-org/matrix-doc/blob/matthew/location-streaming/proposals/3489-location-streaming.md). | ||
|
||
|
||
```json5 | ||
anoadragon453 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
"m.relates_to": { // from MSC2674: https://github.com/matrix-org/matrix-doc/pull/2674 | ||
"rel_type": "m.reference", // from MSC3267: https://github.com/matrix-org/matrix-doc/pull/3267 | ||
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
"event_id": "$beacon_info" | ||
}, | ||
"m.location": { | ||
"uri": "geo:51.5008,0.1247;u=35", | ||
"description": "Arbitrary beacon information" | ||
}, | ||
"m.ts": 1636829458432, | ||
} | ||
``` | ||
|
||
These will reach clients through `/sync`s `ephemeral` dictionary with the same | ||
payload but with the addition of a `sender` which the clients can aggregate user | ||
locations on. | ||
|
||
When the user decides they would like to stop sharing their live location the | ||
original `m.beacon_info`'s `live` property should be set to `false`. | ||
andybalaam marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Encryption | ||
|
||
E2E encryption for EDUs isn't currently defined but as we're dealing with | ||
privacy sensitive data we propose to wrap them inside the standard encryption | ||
envelope: | ||
|
||
```json5 | ||
{ | ||
"algorithm": "m.megolm.v1.aes-sha2", | ||
"sender_key": "<sender_curve25519_key>", | ||
"device_id": "<sender_device_id>", | ||
"session_id": "<outbound_group_session_id>", | ||
"ciphertext": "<encrypted_payload_base_64>" | ||
} | ||
``` | ||
|
||
in which the `ciphertext` will contain the `m.beacon` payload defined above and | ||
which will be sent to `rooms/{roomId}/ephemeral/m.room.encrypted/{txnId}` | ||
|
||
The Megolm keys required to decrypt this EDU should be shared over Olm just like | ||
regular encrypted timeline events. | ||
|
||
## Alternatives | ||
|
||
Alternatively, we could negotiate a WebRTC data channel using [MSC3401](https://github.com/matrix-org/matrix-doc/blob/matthew/group-voip/proposals/3401-group-voip.md) and stream low-latency geospatial data over the | ||
participating devices in the room. However it would be useful to support plain | ||
HTTP like the rest of Matrix and requiring a WebRTC stack is prohibitively | ||
complicated for simple clients (e.g. basic IOT devices reporting spatial telemetry). | ||
|
||
stefanceriu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## Unstable prefix | ||
|
||
* `m.beacon_info.*` should be referred to as `org.matrix.msc3489.beacon_info.*` until this MSC lands. | ||
* `m.beacon` should be referred to as `org.matrix.msc3489.beacon` until this MSC lands. | ||
* `m.location` should be referred to as `org.matrix.msc3488.location.*` until MSC3488 lands. | ||
* `m.ts` should be referred to as `org.matrix.msc3488.ts.*` until MSC3488 lands. | ||
* `m.asset` should be referred to as `org.matrix.msc3488.asset.*` until MSC3488 lands. | ||
anoadragon453 marked this conversation as resolved.
Show resolved
Hide resolved
|
Uh oh!
There was an error while loading. Please reload this page.