public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: omar shibli <omarshib@gmail•com>
To: bitcoin-dev@lists•linuxfoundation.org
Subject: [bitcoin-dev] BIP proposal, Pay to Contract BIP43 Application
Date: Mon, 14 Aug 2017 09:05:35 +0300	[thread overview]
Message-ID: <CAE3EOfgJdrO29GCftwORcq0087X0Y74gYtuMWvO1EWEkrT-7rg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2751 bytes --]

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/<contract_base>/<hash_derivation_path>
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
<contract_base_extended_pub_key>/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

[-- Attachment #2: Type: text/html, Size: 3770 bytes --]

             reply	other threads:[~2017-08-14  6:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-14  6:05 omar shibli [this message]
2017-08-15  5:12 ` Gregory Maxwell
2017-08-15 16:40   ` omar shibli
2017-09-01  7:16     ` Omar Shibli
2019-03-12  5:53       ` Omar Shibli
2019-03-12  7:05         ` ZmnSCPxj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAE3EOfgJdrO29GCftwORcq0087X0Y74gYtuMWvO1EWEkrT-7rg@mail.gmail.com \
    --to=omarshib@gmail$(echo .)com \
    --cc=bitcoin-dev@lists$(echo .)linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox