{"id":123043,"date":"2021-04-29T06:39:14","date_gmt":"2021-04-29T06:39:14","guid":{"rendered":"https:\/\/precoinnews.com\/?p=123043"},"modified":"2021-04-29T06:39:14","modified_gmt":"2021-04-29T06:39:14","slug":"cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation","status":"publish","type":"post","link":"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/","title":{"rendered":"Cooperative smart contracts: How off-chain honesty saves on-chain computation"},"content":{"rendered":"

This post originally appeared on Medium as part of a three-part series on Bitcoin smart contracts, and we republished with permission from Xiaohui Liu. Read part 1 here and part 2 here.<\/em><\/p>\n

We introduce a generic approach to skip on-chain computation in Bitcoin smart contracts, while ensuring security in the presence of malicious parties. In this approach, honest contracting parties can reach agreements peer to peer off chain and opportunistically decide to short-circuit complex computational alternative.<\/p>\n

Outsource example<\/strong><\/p>\n

Alice asks Bob to compute an input\/witness\u00a0x<\/em><\/strong>\u00a0which makes\u00a0function\u00a0f(x)<\/em><\/strong>\u00a0return true. For example,\u00a0f<\/em><\/strong>\u00a0can be a hash puzzle, a solution to\u00a0a Sudoku puzzle\u00a0or\u00a0a Travelling Salesman Problem\u00a0(TSP). If Bob can provide\u00a0x<\/em><\/strong>, he is paid in\u00a0Tx1<\/em><\/strong>\u00a0as shown below. Otherwise, Alice can cancel and get her fund back in\u00a0Tx2<\/em><\/strong>\u00a0after time\u00a0t<\/em><\/strong>, which is pre-signed by Bob. This is dual to\u00a0Timed Commitment Scheme\u00a0(TCS) we introduced before, in the sense that Bob has to respond in time, not Alice.<\/p>\n


\n<\/p>\n

Outsource with cooperation<\/strong><\/p>\n

Now let us modify the above contract\/protocol slightly. Bob, instead of redeeming Alice\u2019s fund by broadcasting\u00a0Tx1<\/em><\/strong>, shares his witness\u00a0x<\/em><\/strong>\u00a0with Alice directly. Alice can validate it off chain and ensure it is expected (i.e.,\u00a0f(x)<\/em><\/strong>\u00a0evaluates to true). Afterwards, she has two choices:<\/p>\n


\n<\/p>\n

In choice 1, Bob can still create\u00a0Tx1<\/em><\/strong>\u00a0and redeem Alice\u2019s fund. Alice cannot cheat and does not gain anything.<\/p>\n

In choice 2, Alice chooses to be honest and can enjoy significant benefits.<\/p>\n

Privacy<\/strong><\/p>\n

Often, Alice does not want\u00a0x<\/em><\/strong>\u00a0to be public. Maybe it is the preimage in a hash puzzle, acting as token to access her rental car, or the answer to the TSP\u2019s problem is secret of her logistics company\u2019s route. x would be exposed in\u00a0Tx1\u00a0<\/em><\/strong>and be shielded in\u00a0Tx3<\/em><\/strong>.<\/p>\n

Efficiency<\/strong><\/p>\n

f<\/em><\/strong>\u00a0can be a computationally intensive function, which has to be evaluated by all miners if\u00a0Tx1<\/em><\/strong>\u00a0is used. If\u00a0Tx3<\/em><\/strong>\u00a0is used,\u00a0f<\/em><\/strong>\u00a0is not evaluated by miners at all, since a contract function is only called when it is used in the spending transaction to unlock. Instead, only two signatures have to be checked, which can be many orders of magnitude smaller and independent of the complexity of\u00a0f<\/em><\/strong>.<\/p>\n

From Alice\u2019s perspective, she is incentivized to act honestly and choose 2 to gain privacy. Her honesty also offloads heavy computation off chain, reducing overall tasks on the Bitcoin network.<\/p>\n

Generalization<\/strong><\/p>\n

The idea is applicable to all types of smart contracts where multiple parties can reach mutual agreements off chain, thus avoid heavy on-chain computation and gain additional privacy by following the contract\/protocol honestly. This is achieved with no loss of security and fairness, even if some parties try to cheat. It is expected to gain wide adoption in practice.<\/p>\n

Source: Read Full Article<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

This post originally appeared on Medium as<\/p>\n","protected":false},"author":3,"featured_media":123042,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"yoast_head":"\nCooperative smart contracts: How off-chain honesty saves on-chain computation - Pre Coin News<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cooperative smart contracts: How off-chain honesty saves on-chain computation - Pre Coin News\" \/>\n<meta property=\"og:description\" content=\"This post originally appeared on Medium as\" \/>\n<meta property=\"og:url\" content=\"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/\" \/>\n<meta property=\"og:site_name\" content=\"Pre Coin News\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-29T06:39:14+00:00\" \/>\n<meta name=\"author\" content=\"mediabest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/precoinnews.com\/wp-content\/uploads\/2021\/04\/Cooperative-smart-contracts-How-off-chain-honesty-saves-on-chain-computation.jpg\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"mediabest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/\",\"url\":\"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/\",\"name\":\"Cooperative smart contracts: How off-chain honesty saves on-chain computation - Pre Coin News\",\"isPartOf\":{\"@id\":\"https:\/\/precoinnews.com\/#website\"},\"datePublished\":\"2021-04-29T06:39:14+00:00\",\"dateModified\":\"2021-04-29T06:39:14+00:00\",\"author\":{\"@id\":\"https:\/\/precoinnews.com\/#\/schema\/person\/ad0e9920e03d3b41c7ad02a18375d76a\"},\"breadcrumb\":{\"@id\":\"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/precoinnews.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Crypto\",\"item\":\"https:\/\/precoinnews.com\/category\/crypto\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Cooperative smart contracts: How off-chain honesty saves on-chain computation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/precoinnews.com\/#website\",\"url\":\"https:\/\/precoinnews.com\/\",\"name\":\"Pre Coin News\",\"description\":\"precoinnews.com\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/precoinnews.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/precoinnews.com\/#\/schema\/person\/ad0e9920e03d3b41c7ad02a18375d76a\",\"name\":\"mediabest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/precoinnews.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f5f13cb3b94fc348d515c0951f6ca073?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f5f13cb3b94fc348d515c0951f6ca073?s=96&d=mm&r=g\",\"caption\":\"mediabest\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cooperative smart contracts: How off-chain honesty saves on-chain computation - Pre Coin News","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/","og_locale":"en_US","og_type":"article","og_title":"Cooperative smart contracts: How off-chain honesty saves on-chain computation - Pre Coin News","og_description":"This post originally appeared on Medium as","og_url":"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/","og_site_name":"Pre Coin News","article_published_time":"2021-04-29T06:39:14+00:00","author":"mediabest","twitter_card":"summary_large_image","twitter_image":"https:\/\/precoinnews.com\/wp-content\/uploads\/2021\/04\/Cooperative-smart-contracts-How-off-chain-honesty-saves-on-chain-computation.jpg","twitter_misc":{"Written by":"mediabest","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/","url":"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/","name":"Cooperative smart contracts: How off-chain honesty saves on-chain computation - Pre Coin News","isPartOf":{"@id":"https:\/\/precoinnews.com\/#website"},"datePublished":"2021-04-29T06:39:14+00:00","dateModified":"2021-04-29T06:39:14+00:00","author":{"@id":"https:\/\/precoinnews.com\/#\/schema\/person\/ad0e9920e03d3b41c7ad02a18375d76a"},"breadcrumb":{"@id":"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/precoinnews.com\/crypto\/cooperative-smart-contracts-how-off-chain-honesty-saves-on-chain-computation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/precoinnews.com\/"},{"@type":"ListItem","position":2,"name":"Crypto","item":"https:\/\/precoinnews.com\/category\/crypto\/"},{"@type":"ListItem","position":3,"name":"Cooperative smart contracts: How off-chain honesty saves on-chain computation"}]},{"@type":"WebSite","@id":"https:\/\/precoinnews.com\/#website","url":"https:\/\/precoinnews.com\/","name":"Pre Coin News","description":"precoinnews.com","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/precoinnews.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/precoinnews.com\/#\/schema\/person\/ad0e9920e03d3b41c7ad02a18375d76a","name":"mediabest","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/precoinnews.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f5f13cb3b94fc348d515c0951f6ca073?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f5f13cb3b94fc348d515c0951f6ca073?s=96&d=mm&r=g","caption":"mediabest"}}]}},"_links":{"self":[{"href":"https:\/\/precoinnews.com\/wp-json\/wp\/v2\/posts\/123043"}],"collection":[{"href":"https:\/\/precoinnews.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/precoinnews.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/precoinnews.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/precoinnews.com\/wp-json\/wp\/v2\/comments?post=123043"}],"version-history":[{"count":0,"href":"https:\/\/precoinnews.com\/wp-json\/wp\/v2\/posts\/123043\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/precoinnews.com\/wp-json\/wp\/v2\/media\/123042"}],"wp:attachment":[{"href":"https:\/\/precoinnews.com\/wp-json\/wp\/v2\/media?parent=123043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/precoinnews.com\/wp-json\/wp\/v2\/categories?post=123043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/precoinnews.com\/wp-json\/wp\/v2\/tags?post=123043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}