Secret Santa in DAML

This one’s an example, not a guide or tutorial. I had some fun today modelling a Secret Santa game in DAML. I’ll run this on project:DABL for Digital Asset employees. It’s only DAML so far, but if there is enough interest, I’ll add a UI over the next few weeks.

I believe the model is safe, sound, and privacy-preserving. Santa is regulated by a holiday regulator. I’ll leave it to you to do due diligence using the code above. The basic rules are thus:

  • The app starts in sign-up, which Santa gets to close once enough elves have signed up.
  • Once signup ends, Santa matches the elves in the usual way. You find out who you are getting a gift for, but now who’s getting one for you.
  • Once you have been matched, you must pledge your gift by December 25th by saying in plain text what it is. Don’t worry, the receiver doesn’t find out. If you miss that deadline, Santa gets to penalize you and your pledge defaults to a bag of homebaked cookies.
  • Then every time you meet someone that is also part of the secret santa (socially or 1<>1) , you register that meeting in the app. If you met the person that you are getting a gift for, the pledge will be revealed. If Santa sees that the receiver claims to have met you, but you neither revealed your pledge, nor registered the meeting in reverse, Santa will chase you.
  • When you have received your gift, you Resolve the Pledge.
  • Once all Pledges are resolved, the fun is over.
6 Likes

I really like it. I think it’s also a good idea for schools. I would be interested to see how you would design the UI.

Cheers from Germany

3 Likes

SIgnups are going well so that UI will be forthcoming :smiley:

2 Likes

Wow! Nice to hear that @bernhard :santa:

1 Like

It may be a bit late now for others to use this in 2020, but the UI is complete at GitHub - bame-da/secret-santa-2020: A secret santa in DAML. :tada:

2 Likes

Secret Santa came through… I was meaning to get one myself, so this was quite prescient!

Thank you @bernhard for making this happen - really cool idea :smiley:

1 Like