[YouTube] I want half! Marriage smart contract for Ethereum

mids106mids106 Member Posts: 188 ✭✭✭
edited March 2014 in Education

Joel Dietz and Joris Bontje show how you can implement a marriage smart contract (with divorce clause) for Ethereum.

Name inspired by Eddie Murphy:

Contract created by Dutch Ethereum User Group:
- Yves Candel
- Nick Savers
- Joris Bontje

CLL source code: https://github.com/jorisbontje/cll-sim/blob/master/examples/i_want_half.cll
Simulation code: https://github.com/jorisbontje/cll-sim/blob/master/examples/i_want_half.py

Joel Dietz - https://twitter.com/fractastical
Joris Bontje - https://twitter.com/mids106


  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    edited March 2014
    Good call. Memes away!

    Stupid python question: why does `MarriageRun` need to adress `self.something` all the time, whereas `Marriage` can just access the members?

    Also, i notice earlier you used `stop(message)` to note that the correct exit points where reached in the test. It is a bit more stringent to also require correct exit points. Probably doesnt matter much in this case.

    Proceeding with taking it too seriously: note that presumably it isnt intended to be filled with a lot at the initial proposal, as there is no way to extract before marriage. But emotional/cultural reasons would cause people to actually put a lot in.
  • mids106mids106 Member Posts: 188 ✭✭✭
    @Jasper? I have implemented some (nasty) Python hacks that allow you to omit the `self.` prefix within contracts (to allow them to look as much like plain CLL as possible). However this isn't proper Python code in general, so I am not reusing it in the test functions.

    I have some mixed feelings about this... It would be better if you can load the CLL directly from an external file and use the actual CLL syntax 100%

    As for extending the contract to deal with value extraction before marriage... send a pull request!
  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    Never used python to a any large extent before... Can hardly believe it would be so clumsy? Nothing essentially `with-slots` (have all member functions accessibly by identity only.. The common lisp version requires listing them once.. Still better than a=self.a; b=self.b, where it is twice. Macros can fix it all.)

    About that pull request.. Well the thing is these are 'examples' and you make youtube videos about it. Maybe have a second directory where the 'for actual use'(no warrantee) scripts live. Each script could also have a directory with a readme.md, and maybe some other related things that way..

    It can become a bit more complex than a simple contract and that is it. For instance the dropbox example requires off-blockchain software to figure out what `tx.data` is correct. The serving-and-viewing data idea(that works on the cll-simulator, but i added `block.parenthash`, `block.number`) requires a ..server of some sort, it needs to check that the script is of the right kind, has enough balance, and it may want a black list.
  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    I should link a little more; here is where i asked for those extra params https://github.com/jorisbontje/cll-sim/issues/5 i can pull request that too if you want.
  • mids106mids106 Member Posts: 188 ✭✭✭
    @jasper I have just implemented block.number, block.difficulty, block.parenthash per your request. I think I now have all the CLL properties implemented, but please let me know if I missed any :)

    As for dealing with people depositing money into the contract before it is "ready", how would you suggest handling it? Our initial reasoning when creating this contract was; people just shouldn't be depositing into it before it is "ready" (state = MARRIED); which can be enforced client side. But I now realize that you (and others) might try to model some kind of real world marriage scenario (wedding gifts?) that were not part of our initial envisioned use case. I am interesting to hear your solution! Either as a forum comment or as a pull request :D
  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    Its not hard at all. Here it is https://github.com/jorisbontje/cll-sim/pull/6

    Of course all features that a 'wealth safety contract', that are not particular to marriage, like multisig-retrieval and limited-rate extraction of ether in case of lost/stolen key.

    One related to marriage is when divorced, or multisig is used(for instance if one of the two dies), anyone can use the contract. This way you can use your great-grandfather marriage contract.
  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    Damn my writing sometimes. It is largely because the text box is so small and i sometimes edit it out of order.
  • IgorIgor BrasilMember Posts: 37 ✭✭
  • mlrichardmlrichard Montreal, CanadaMember Posts: 1
    I will be getting married on the Ethereum blockchain as soon as this is possible. Your initial contract is quite interesting giving me a place to start. I have been married twice already and there has never been a lawyer involved in the entire process of getting married or divorced, I can take care of all these things myself to the relative satisfaction of both parties.

    Basically, it is important to me that such a thing is not susceptible to any outside party who could collude to accentuate conflict and delay processes and therefore drain a family of their entire savings. This is why I want to establish my own marriage contract to refer to the following cases:

    - *Timestamping the marriage (wedding!)
    - Naming my spouse as beneficiary of my estate and vice versa
    - Naming my spouse as sole executor of my living will (medical decisions) and vice versa
    - *Requiring both spouses signature to make changes (i.e.: addition of third spouse to family!)
    - *Both parties must provide 'proof-of-happily-married' at regular intervals for the marriage to remain active.
    - Separation of property and custody of feline children :)
    - *Separation of crypto-currency (not necessarily Ether).

    This is the 'minimal viable product' of my marriage contract! The * refer to programmable events and the rest I am not sure if I can encode into a blockchain but I really want to. The interesting thing is that in Quebec, we are already considered married because we live together and also have access to French Law (notaries) to fill in the gaps.

    I am writing this here because there is sincerely nobody in my entourage who would understand why and how this works LOL

    Who else is getting married in the blockchain soon?

  • vaXvaX Austin, TXMember Posts: 78 ✭✭✭
    mlrichard said:

    Who else is getting married in the blockchain soon?

    David Mondrus (Bitnation) and Joyce Bayo are (re)marrying this Sunday at 'Coins In The Kingdom'. They're using the bitcoin blockchain.

  • F1LT3RF1LT3R Member Posts: 1
    I'm getting married in February and thinking about using Etherium/Mist to write a marriage contract. My fianceé is interested in the idea too.

    Is there anyone that could support us in doing this, to make sure we do it the right way?

    Warm regards,

  • o0ragman0oo0ragman0o Member, Moderator Posts: 1,291 mod
    Fine as long as you want your marriage on a temporary PoC blockchain ;)
  • StephanTualStephanTual London, EnglandMember, Moderator Posts: 1,282 mod

    Fine as long as you want your marriage on a temporary PoC blockchain ;)

    Wife is not going to be happy when you explain that one :)
  • bingowings85bingowings85 Member Posts: 2
    off topic but related (?)
    how could I temporarily (with plausible deniability) tie up my net worth in some smart contract so that for all intents and purposes I have no money? And mortgage contracts, who can hold a mortgage contract over me, keeping me totally insolvent? So even if a claim "for half" was lodged, there would be nothing to have, because, the smart contract has made me broke! Of course i'm talking about divorce. I like the idea of playing a "Ethereum Lottery" to get my net worth back, with a guaranteed win that I can chose to cash out or not.
  • bingowings85bingowings85 Member Posts: 2
    for the record, I love women; I don't love what they do to men.
  • levilevi Member Posts: 11
    @bingowings85, Get into debt > Get Divorced > Pay yourself the debt you owe

    Disclaimer: I am not an attorney.
Sign In or Register to comment.