Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 929EB516 for ; Mon, 14 Aug 2017 06:05:37 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 4A9E0A6 for ; Mon, 14 Aug 2017 06:05:37 +0000 (UTC) Received: by mail-wm0-f46.google.com with SMTP id i66so35386205wmg.0 for ; Sun, 13 Aug 2017 23:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=s9MfeKkAqgTz/sKlMejfObKmebDfG0jjcrHWhpa7E+E=; b=VAFL7vB5s6bTwfYjoGjto2929MQLCbR66UCXth3jblpRDRHJC/V72jp1o5Vrt8VM30 LTaWVy291IWAuCCcTgMk1MpNlJfs5iJ4nAINWiKwsgIDbsJViWUAZkj0O+NCiXTsz61R ptsJcevs98pYWyRcdCCfgDFEGNFKVws3w2b65P/zsFtsJFaQJpcuh+s9eSvmNd827F8R e4RqSlK+DJriaCLGfNiSAbqkgDIlBNDS8H75tZugZ6XMEc1pTsJODubncNflnXowsXZj 0kZ3pEiUg/grFAqsX9drNDVRfXNFgzZ72oBiVi9tS6r/NK2fhc4bfvk6rFujUw4w3aoU iksA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=s9MfeKkAqgTz/sKlMejfObKmebDfG0jjcrHWhpa7E+E=; b=qGpk7Kp7DToekdDZZ9ecDOEotbfOyRMn2eqT1Vn5gBZb4DNWN1t6Ypg+xH4/Hcc0a4 zSgm6hiERkszIezOc6W4Lu7/rDFCdm1drMMdcGzL2JVwz5zyssRuemN1Vdh/WYEyrDdx bLu5OKIMJeHb9MADeTNBkcL+ZFgJMcaHHNuBpiUudVYdKk+DoZgQ7tL6LiHYitaniYFY TjbrKZb9N16NaCmoZyezX54dTlt0WTPP50FHwGVKDgByRCKMSEXf3RPbhxvEMEutbDiC golS8Ir5m2q46Ri+mR1UicSuzxwGSlGdeUWAhR/Fu5DWCCjky8LUsXrZiMy7HWtH4tRD JbQg== X-Gm-Message-State: AHYfb5hS9L2WO+HgAvk2o/+xX8adCwj9SKY/LEi1mFgFw0j0LyOFwGcf fZ0LuUZOvicvnPjgiirl3X9AFI8T5TD1prE= X-Received: by 10.28.193.203 with SMTP id r194mr3305959wmf.85.1502690735660; Sun, 13 Aug 2017 23:05:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.171.232 with HTTP; Sun, 13 Aug 2017 23:05:35 -0700 (PDT) From: omar shibli Date: Mon, 14 Aug 2017 09:05:35 +0300 Message-ID: To: bitcoin-dev@lists.linuxfoundation.org Content-Type: multipart/alternative; boundary="94eb2c13158e81a4da0556b073a9" X-Mailman-Approved-At: Tue, 15 Aug 2017 02:32:01 +0000 Subject: [bitcoin-dev] BIP proposal, Pay to Contract BIP43 Application X-BeenThere: bitcoin-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Bitcoin Protocol Discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Aug 2017 06:05:37 -0000 --94eb2c13158e81a4da0556b073a9 Content-Type: text/plain; charset="UTF-8" Hey all, A lot of us familiar with the pay to contract protocol, and how it uses cleverly the homomorphic property of elliptic curve encryption system to achieve it. Unfortunately, there is no standard specification on how to conduct such transactions in the cyberspace. We have developed a basic trade finance application that relies on the original idea described in the Homomorphic Payment Addresses and the Pay-to-Contract Protocol paper, yet we have generalized it and made it BIP43 complaint. We would like to share our method, and get your feedback about it, hopefully this effort will result into a standard for the benefit of the community. Abstract idea: We define the following levels in BIP32 path. m / purpose' / coin_type' / contract_id' / * contract_id is is an arbitrary number within the valid range of indices. Then we define, contract base as following prefix: m / purpose' / coin_type' / contract_id' contract commitment address is computed as follows: hash document using cryptographic hash function of your choice (e.g. blake2) map hash to partial derivation path Convert hash to binary array. Partition the array into parts, each part length should be 16. Convert each part to integer in decimal format. Convert each integer to string. Join all strings with slash `/`. compute child public key by chaining the derivation path from step 2 with contract base: m// compute address Example: master private extended key: xprv9s21ZrQH143K2JF8RafpqtKiTbsbaxEeUaMnNHsm5o6wCW3z8ySyH4UxFVSfZ8n7ESu7fgir8imbZKLYVBxFPND1pniTZ81vKfd45EHKX73 coin type: 0 contract id: 7777777 contract base computation : derivation path: m/999'/0'/7777777' contract base public extended key: xpub6CMCS9rY5GKdkWWyoeXEbmJmxGgDcbihofyARxucufdw7k3oc1JNnniiD5H2HynKBwhaem4KnPTue6s9R2tcroqkHv7vpLFBgbKRDwM5WEE Contract content: foo Contract sha256 signature: 2c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae Contract partial derivation path: 11302/46187/26879/50831/63899/17724/7472/16692/4930/11632/25731/49056/63882/24200/25190/59310 Contract commitment pub key path: m/999'/0'/7777777'/11302/46187/26879/50831/63899/17724/7472/16692/4930/11632/25731/49056/63882/24200/25190/59310 or /11302/46187/26879/50831/63899/17724/7472/16692/4930/11632/25731/49056/63882/24200/25190/59310 Contract commitment pub key: xpub6iQVNpbZxdf9QJC8mGmz7cd3Cswt2itcQofZbKmyka5jdvQKQCqYSDFj8KCmRm4GBvcQW8gaFmDGAfDyz887msEGqxb6Pz4YUdEH8gFuaiS Contract commitment address: 17yTyx1gXPPkEUN1Q6Tg3gPFTK4dhvmM5R You can find the full BIP draft in the following link: https://github.com/commerceblock/pay-to-contract-protocol-specification/blob/master/bip-draft.mediawiki Regards, Omar --94eb2c13158e81a4da0556b073a9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey all,

A lot of us familia= r with the pay to contract protocol, and how it uses cleverly the homomorph= ic property of elliptic curve encryption system to achieve it.
Un= fortunately, there is no standard specification on how to conduct such tran= sactions in the cyberspace.

We have developed a ba= sic trade finance application that relies on the original idea described in= the Homomorphic Payment Addresses and the Pay-to-Contract Protocol paper, = yet we have generalized it and made it BIP43 complaint.

We would like to share our method, and get your feedback about it, ho= pefully this effort will result into a standard for the benefit of the comm= unity.

Abstract idea:

We = define the following levels in BIP32 path.
m / purpose' / coi= n_type' / contract_id' / *=C2=A0

contract_= id is is an arbitrary number within the valid range of indices.
<= br>
Then we define, contract base as following prefix:=C2=A0
m / purpose' / coin_type' / contract_id'

contract commitment address is computed as follows:
hash= document using cryptographic hash function of your choice (e.g. blake2)
map hash to partial derivation path
Convert hash to binar= y array.
Partition the array into parts, each part length should = be 16.
Convert each part to integer in decimal format.
= Convert each integer to string.
Join all strings with slash `/`.<= /div>
compute child public key by chaining the derivation path from ste= p 2 with contract base:
m/<contract_base>/<hash_derivati= on_path>
compute address
Example:

master private extended key:=C2=A0
xprv9s21ZrQH143K2JF8Raf= pqtKiTbsbaxEeUaMnNHsm5o6wCW3z8ySyH4UxFVSfZ8n7ESu7fgir8imbZKLYVBxFPND1pniTZ8= 1vKfd45EHKX73
coin type: 0
contract id: 7777777=C2=A0

contract base computation :

derivation path:=C2=A0
m/999'/0'/7777777'=C2=A0
contract base public extended key:=C2=A0
xpub6CMCS9rY5GKdk= WWyoeXEbmJmxGgDcbihofyARxucufdw7k3oc1JNnniiD5H2HynKBwhaem4KnPTue6s9R2tcroqk= Hv7vpLFBgbKRDwM5WEE=C2=A0

Contract content:
<= div>foo

Contract sha256 signature:
2c26b= 46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae=C2=A0

Contract partial derivation path:
11302/46187/268= 79/50831/63899/17724/7472/16692/4930/11632/25731/49056/63882/24200/25190/59= 310

Contract commitment pub key path:
m/= 999'/0'/7777777'/11302/46187/26879/50831/63899/17724/7472/16692= /4930/11632/25731/49056/63882/24200/25190/59310
or
<= contract_base_extended_pub_key>/11302/46187/26879/50831/63899/17724/7472= /16692/4930/11632/25731/49056/63882/24200/25190/59310

<= div>Contract commitment pub key:
xpub6iQVNpbZxdf9QJC8mGmz7cd3Cswt= 2itcQofZbKmyka5jdvQKQCqYSDFj8KCmRm4GBvcQW8gaFmDGAfDyz887msEGqxb6Pz4YUdEH8gF= uaiS

Contract commitment address:
17yTyx= 1gXPPkEUN1Q6Tg3gPFTK4dhvmM5R


You ca= n find the full BIP draft in the following link:


Regards,
Omar
--94eb2c13158e81a4da0556b073a9--