Live data from Hacker News

Cryptocontracts Will Turn Contract Law Into a Programming Language

thoughtinfection.com

31–40 of 91 posts

Re: Cryptocontracts Will Turn Contract Law Into a Programming Language

#31
How does the automatic enforcement work? Specifically, how would the software algorithmically determine whether one party has performed satisfactorily?

Determining whether one party has paid the other is relatively straightforward--compared to other contractual obligations, at least. Whether it relies on a centralized model like a bank, or something decentralized like BitCoin, it's easy to quantify and measure the exchange of money.

What's harder is measuring the other side of the contract. How does the software know that the plumber has satisfactorily installed the customer's new shower? Or that the web developer has built a satisfactory website for the client? Or that the mortgager has encumbered his home in violation of the mortgage?

Re: Cryptocontracts Will Turn Contract Law Into a Programming Language

#33
post #22

Contracts are sort of like computer programs, read and executed by people -- by the parties; by constituencies within a corporate party; and sometimes by judges and juries -- instead of by CPUs. Except that, unlike people: [EDITED FOR STYLE] * CPUs don't come up with imaginative reasons why they supposedly needn't follow a clear, unambiguous program instruction. * CPUs don't experience buyer's remorse and decide they…

Also: when program hits a missing case in a switch statement, throwing an exception and rebooting the program is an option. That's not true for the equivalent situation with contracting parties.

Re: Cryptocontracts Will Turn Contract Law Into a Programming Language

#34
post #16

Earlier quoted context omitted.

by keeping money in escrow until said conditions are met.

How does the computer know conditions have been met, and what prevents using those same mechanisms with ordinary contracts?

exactly this. If the conditions were clear and unambiguous as to whether a contract's term was satisfied or not, there would be no need for lawsuits to enforce a breach.

It's precisely because of the enormous ambiguity in human affairs, even when both parties are acting entirely in good faith, that hundreds of years of contract law exists, and courts and lawyers and lawsuits and police to enforce them.

The OP's example -- publish three blog posts -- is so trivial that it's hardly even worth discussing as a contract. "Paint my house" is a typical example in first year contracts and it's fodder for all kinds of problems and issues and exceptions: was the house painted? On time? Proper color as specified in the contract ["that's not blue!" "of course it is, says so right here on the can" "No it's not" etc]?

Bitcoin and other crypto currencies are interesting as a cheap escrow mechanism, but it still requires a neutral third party to verify that the conditions are satisfied and release the funds.

Re: Cryptocontracts Will Turn Contract Law Into a Programming Language

#35

A few years ago, the SEC was mulling specifying regulations for high-frequency trading in Python[0][1]. I've wondered about the potential for specifying law in programming languages since then. Formally verified laws would be a wonderful thing. [0] http://www.itworld.com/government/105650/languages-wall-stre... [1] http://www.itworld.com/government/105031/will-wall-street-re...

>high-frequency trading in Python

Wait...they're willing to spend millions to build a new undersea cable that shaves a millisecond off the latency...but they use an interpreted language? How does that work?

Re: Cryptocontracts Will Turn Contract Law Into a Programming Language

#36
post #29

I don't want to be negative-HN-commenter, but this seems crazy to me. First, expressing a contract in a programming language is a much harder problem than expressing a contract in English. How would you even express babysitting or lawnmower-borrowing as a program? Second, lawyers go to great efforts to cover all the cases and even so there are usually things uncovered. Programmatic contracts aren't going to be any be…

"You can think of the court system as exception handling for real-world contracts, and that's a dangerous thing to give up."

I was going to agree with you, but then I realized you can actually devise a contract with the equivalent of a "mediation" clause built-in. In fact, this is exactly what a multisig escrow Bitcoin contract is. If the buyer and seller agree that the transaction was successful they can finalize the contract, otherwise they have to go to the mediator who sides with one of the parties.

However, you still have to be very careful constructing the contract, as well as securing your private keys (from theft and loss).

Re: Cryptocontracts Will Turn Contract Law Into a Programming Language

#37
post #35

A few years ago, the SEC was mulling specifying regulations for high-frequency trading in Python[0][1]. I've wondered about the potential for specifying law in programming languages since then. Formally verified laws would be a wonderful thing. [0] http://www.itworld.com/government/105650/languages-wall-stre... [1] http://www.itworld.com/government/105031/will-wall-street-re...

>high-frequency trading in Python Wait...they're willing to spend millions to build a new undersea cable that shaves a millisecond off the latency...but they use an interpreted language? How does that work?

I'm sorry for the grammatical ambiguity. The regulations themselves were to be written in Python. Nonetheless, I do think interpreted languages are used in HFT, but presumably not the kind of HFT that attempts to exploit inefficiencies between in, say, the prices of frozen concentrated orange juice futures on the Chicago Mercantile Exchange vs the price of agricultural companies on the New York Stock Exchange.

Re: Cryptocontracts Will Turn Contract Law Into a Programming Language

#38
post #29

I don't want to be negative-HN-commenter, but this seems crazy to me. First, expressing a contract in a programming language is a much harder problem than expressing a contract in English. How would you even express babysitting or lawnmower-borrowing as a program? Second, lawyers go to great efforts to cover all the cases and even so there are usually things uncovered. Programmatic contracts aren't going to be any be…

The question of how is answered: — declarative syntax driven by JSON structural schemas[0] and encrypted JSON transactions stored in the blockchain.

The domain of case evidence is a matter of training a bitcoin network with a modular feed-forward neural network decision engine that discovers novel situational categories. Unit Tests consist of the declarative language and its implementation in any given environment through evaluations of syntax.

After you deploy it once, it theoretically becomes increasingly less costly to iterate deployments. Code first, design later.

[0]: http://json-schema.org/

Re: Cryptocontracts Will Turn Contract Law Into a Programming Language

#39
post #29

I don't want to be negative-HN-commenter, but this seems crazy to me. First, expressing a contract in a programming language is a much harder problem than expressing a contract in English. How would you even express babysitting or lawnmower-borrowing as a program? Second, lawyers go to great efforts to cover all the cases and even so there are usually things uncovered. Programmatic contracts aren't going to be any be…

I think this is interesting debate, so without detracting from the importance of these questions here are some answers of mine:

1. I don't think this is a linguistic restriction as much as a denotation of the scope of a contract formal language. Real world actions like this could perhaps be recorded by a neutral third party (accepted via cryptographic signature with the necessary identity components baked into the script of the contract itself). I think more broadly that the scope of this formal language would be less around verification and enforcement and more around producing automated analysis of the content of a contract.

2. Continuing from point (1), this is exactly what I see the point of a contract formal language is—by becoming exhaustive about what kinds of things can be described in a contract we can check exhaustively (automatically) whether or not a contract is well-formed. You might be able to ask questions like "given I've defined these 18 eventualities, are all of them eventually observed and handled properly?". These kinds of questions are related to typing, termination[1], and totality checks, all of which are done in programming languages.

([1] Note, termination can be checked for a subset of all programs without violating the Halting Problem—you just won't have a Turing Complete contract language, which doesn't seem particularly problematic.)

3. This is definitely an interesting point—I'd imagine that large, complex, fully-automated, and self-executing cryptocontracts are much, much further off than cryptocontracts used in combination with a court. If a court is an exception system then a nice contract formal language just makes it easier to go further without depending as much upon exceptions---but they're still there for when the shit really hits the fan.

4. I think this is certainly true—for the last 40 years of building programming languages it's clear we're pretty inundated with shitty ones. But that said, for as painful as reusability is sometimes, we do get a lot of reusability. It might be unbelievably challenging to write the first lease cryptocontract, but if it was done well then the components which built it could be recycled, re-parameterized, and re-combined into other similar contracts with ease. The constraints of a contract formal language could ensure that these recombinations are sensible and other program analyses can ensure that it's, say, enforceable and complete.

I think it definitely transitions the challenges from interpretation and maintenance of contracts toward front-loaded concerns like contract composition and extensibility, but once that's done we have much firmer grasp on contract reusability. That's clearly a valuable thing given how often contracts are just mid-libbed between parties already—a contract formal language could make it easier, saner to reuse old contracts.

---

So, I'd definitely come off saying that a contract "programming language" is probably not going to look as much like a programming language that most programmers today are familiar with and more like a formal language such as mathematics or Coq where power is sacrificed for analyzability. As always with programs, the real-world interface is one of the most painful, but that's often what cryptographic technology provides---ways of translating messy real world actions into limited, binary, unforgeable digital effects (the 1-0 effect of having a cryptographic key versus the messy effect of being at fault).

From what I've seen of the Bitcoin protocol it's going to be useful for things like escrow, but is a far, far, far cry away from a meaningful place to specify more interesting contracts.

Re: Cryptocontracts Will Turn Contract Law Into a Programming Language

#40

I really do not understand the mechanism - maybe I missed it. But A and B enter a contract - A will pay B 1000 usd for every equity research article published (think blog post someone would pay for). How is that self enforcing? how does anyone but a human decide that was a article worth paying for and it scraped off ten random pages?

Add voting: say the donations are from 10 people, and 6-of-10 unlocks the payment. If people feel ripped off by a scraped page...
Post reply on HN