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

MSC3184: Challenges Messages #3184

Draft
wants to merge 1 commit into
base: old_master
Choose a base branch
from

Conversation

BillCarsonFr
Copy link
Member

@BillCarsonFr BillCarsonFr commented May 10, 2021

rendered

In matrix we already have vibrant discussions going on in rooms, but we often miss a fair method to resolve a dispute between several parties.

This proposal improve matrix by adding several methods to fairly choose between several options by:

  • Defining the standard shape for extensible challenges messages, such as

    • Rock/Paper/scissors
    • Coin Flip
    • Drawing Straws
  • Defining extensible commitment schemes allowing to define the level for binding vs concealing property of the challenge

@BillCarsonFr BillCarsonFr changed the title Challenges MSC MS3184: Challenges Messages May 10, 2021
@BillCarsonFr BillCarsonFr marked this pull request as draft May 10, 2021 08:38
@turt2live turt2live added client-server Client-Server API kind:feature MSC for not-core and not-maintenance stuff proposal A matrix spec change proposal labels May 10, 2021
@BillCarsonFr
Copy link
Member Author

How it could look like in timeline

image



Each participant will choose one of the straws, by commiting to a number [1,n].
In order to resolve disputes, each participant must commit the straws by order of preference, e.g (1,3,2,4). If straw 1 was already taken, then try to peek 3, and so on.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If two people choose straw 1, how do you determine which one gets straw 1, and which one needs to use their second choice?

Copy link
Member Author

@BillCarsonFr BillCarsonFr May 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think based on m.challenge.commit event timestamp? then eventId order?
will update

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can easily forge event timestamps

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we will all see the same?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, but it means a person on their own homeserver where they can forge ts can then ensure that they get their choice vs fallback

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't beneficial to forge the timestamp because you don't know what the straws are, no choice is better than any other. All that matters is that we can decide who picked what before the shuffle is revealed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How? Since the reveal only happens after the events have been sent there isn't an issue. Unless you are talking about people adding an event after the reveal and spoofing it to appear like it came out before?

If it is the latter we could include a hash of the selected responses at the time of reveal. Of course the proposer could potentially be accuses of selecting the order to make their preferred participant win.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could use the order of users in the m.challenge tofield instead of timestamp.
"to": ["@bob:exemple.com", "@alice:exemple.com", @jhon:exemple.com,..]



Each participant will choose one of the straws, by commiting to a number [1,n].
In order to resolve disputes, each participant must commit the straws by order of preference, e.g (1,3,2,4). If straw 1 was already taken, then try to peek 3, and so on.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It isn't beneficial to forge the timestamp because you don't know what the straws are, no choice is better than any other. All that matters is that we can decide who picked what before the shuffle is revealed.

`===`
`=`
`==`
`====`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How are the shuffle and choices serialized?

## Alternatives


## Security considerations

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Colluding parties can reliably win. For example the flipper can tell the guesser out of band or the shuffler can share the order with the player that they want to win (or lose).



## Alternatives

Copy link

@kevincox kevincox May 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an MSC for polls. However this is notably different because it is about secret selection.

However this may have some overlap with a future bind-poll proposal which may wish to use similar techniques as the ones used here.

In fact it may be worth considering a generalization of this MSC which could support the following:

  1. Blind polls/simultaneous sharing. A system where participants can submit their proofs and they once the proofs are collected the actual values can be sent. This solves the "you go first" issue as you know that the answers didn't influence one another. This could be used to implement the straw picking example.
  2. Collaborative random choices. This could be used both for the coin-flip challenge as well as provably fair random picks in general. (Example: everyone submits a random value using a simultaneous share and the hash of all of the values is used to select a choice)



## Potential issues

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens if some clients don't support some or all of the challenges? Right now there is no negotiation. This basically means that humans would need to do the negotiation before starting a challenge. It may be worth considering auto-negoation so that clients can indicate which challenges are supported by all members of the room. This would be extra useful for the commitment strategy as it would make sense to automatically fall back to an older method if it isn't supported by everyone involved.

"type": "m.challenge.commit",
"content": {
"commitment": <sha256(✌️ || rA)>
[...]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we know who is involved? If I am in a group chat but want to challenge one person is there any automatic UX or is this left up to humans? This can be especially relevant if there are multiple groups in a room that have different challenges at the same time. For example imagine I am running a small tournament and each match needs to play rock-paper-scissors to decide who goes first, or each group needs to draw straws. Without some built-in targeting mechanism there will probably be a lot of people answering the wrong challenges.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a to field that indicates the intended targets:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@turt2live turt2live added the needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. label Jun 8, 2021
@turt2live turt2live changed the title MS3184: Challenges Messages MSC3184: Challenges Messages Jun 8, 2021
@kevincox kevincox mentioned this pull request Sep 7, 2021
@ghost
Copy link

ghost commented May 26, 2023

Two ideas:

  1. This could be done as an extention for pools, so clients that does not implement this MSC could also participate if they support pools. We also benefit from all the work and debugging done on pools.
  2. Coin flip should not be choosen manually like rock-paper-scissors, it is much more intuitive for coin flip to be automatic. We can do it by making Alice and Bob clients randomly choose 0 or 1, then XOR it. This way we get fairly choosen random boolean number :).
    This could also work in bigger rooms, let's set a timer and display message saying "Flipping...". If the timer runs out or all members choose 0 or 1, we do XOR on them all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-server Client-Server API kind:feature MSC for not-core and not-maintenance stuff needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants