Skip to content

Instantly share code, notes, and snippets.

@drwasho
Last active September 16, 2015 22:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drwasho/a0225f5455e508095ac2 to your computer and use it in GitHub Desktop.
Save drwasho/a0225f5455e508095ac2 to your computer and use it in GitHub Desktop.
Further description of notaries within OpenBazaar

# Notary Selection in OpenBazaar: Voting Pools, Certification, and Contract Blinding

1. Introduction

There is a significant bottleneck in the current workflow for OpenBazaar, which is the selection of a third party notary or arbiter. Irrespective whether the notary or arbiter is the same agent, both the merchant and the buyer are required to come to a consensus in selecting a third party key-holder in a 2-of-3 multisignature escrow address. The fundamental obstacle is the risk of possible collusion between one of the parties and the notary, and the subsequent distrust one party has for the other party's notary preference. Unless both parties have preselected the same notary that they both trust, somewhat coincidentally, then a transaction cannot take place. This may result in significant and frustrating delays that run counter to the values that OpenBazaar hold for user experience. Worse, there is an elevated risk that one party will use poor judgement in just accepting whoever the other party prefers for a notary in their eagerness for the transaction to progress.
A potential solution to this problem is the use of voting pools made up of accredited notaries. The aim of this article is to define what an accredited notary is and how it may be implemented in OpenBazaar. We will also describe how certain fields within the Ricardian contract can be blinded from the notary to protect the privacy of the exchanging parties and giving deniability to notary service providers.

2. Voting Pools

The concept of voting pools has been described previously. Briefly, to decrease the overall risk of collusion and increase the redunancy of transactions, a multisignature escrow address is made up of several additional parties on top of the merchant and buyer. For example, an 8-of-15 multisignature escrow address can be created made up of:

  1. 3 notaries selected by the merchant
  2. 3 notaries selected by the buyer
  3. 1 notary selected at random
  4. 4 keys from the merchant
  5. 4 keys from the buyer

Signatures from 8 keys are required to release funds from the multisignature escrow address. If the merchant and buyer have any reason to doubt the pool, they can move the keys to a different multisignature address. If there is a dispute, a majority of signatures is required in combination with one of the parties to release funds from the address. No single party can steal the funds, and the likelihood of collusion is reduced with more parties involved.

Interaction of the notary pool with the arbiter is managed over the OpenBazaar client:

The notary pool will received a digitally signed ruling from the arbiter. The ruling can be blinded from the notaries (i.e. encrypted with the public keys of the merchant and buyer), to maintain the privacy of both parties (discussed in more detail below). Aside from the arbitration notes, the ruling will also contain an unsigned bitcoin transaction with:

  1. Input: the multisignature escrow address
  2. Output_1: the winning party from arbitration
  3. Output_2: notary fee
  4. Output_3: arbiter fee

In more complex settlements, where both parties receive a portion of the funds, additional outputs are added to the transaction. The bitcoin transaction is digitally signed by either both parties, or the winning party with the notary pool and broadcast to the Bitcoin network.

3. Accredited Notaries

Even with a notary pool, the question remains how users will choose notaries within OpenBazaar? The most direct way is for users to access the storefront of other nodes in the network, select the 'services' tab and manually add them to their list of preferred notaries. Users can also search for nodes on the network that they wish to add on their list. These approach however, assume that the user already knowns what node to trust as a notary.

One approach is for notaries to be accredited by a voluntary private orgaisation, which creates some open standards for notaries to voluntarily subject themselves to in order to earn an 'endorsement badge'. These open standards may include:

  1. The notary node has an up-time of >22 hours per day
  2. Communication response times are < 12 hours
  3. Notaries issue a surety bond held in a multisignature address by the accreditation organisation

This approach is a form of self-regulation, whereby accreditation is earned after demonstrating compliance. The accrediting organisation can also hold the surety bond in the event that an accredited notary defrauds a client. In this scenario, a corrupt notary is excluded from the organisation, their surety bond is forfeit (perhaps used to compensate a defrauded member), and they lose their public accreditation with the association. A notary may choose to become accredited from several such organisations to bootstrap trust.

Technically this can be achieved by the private organisation keep a public record of accredited notaries, digitally signed, that a notary can link to within their 'notary description' field within the client.

From a user's perspective, they can search and filter potential notaries according to the presence or absence of accreditation by various organisations. Of course this does not restrict users from finding and using unaccredited notaries that they prefer.

4. Contract Blinding

Data fields within the Ricardian contract can be hashed prior to forwarding to the notary for their digital signature. Nearly all data fields can be hashed with exception to the bitcoin pubkeys necessary to create a multisignature address. Hashing is preferable to encryption with the buyer or seller's public key as the data fields can be easily verified by an arbiter in the event of a dispute, rather than going through additional decryption steps. The goal is to create an immutable record of the product details of the contract while obfuscating them.

4.1 Example

For example, imagine that Alice wants to sell an item to Bob that she should not like the notary to be aware of. The unblinded contract that both Alice and Bob see is shown below:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

{
    "OpenBazaar Contract": {
        "OBCv": "0.1",
        "Category": "Physical good",
        "Sub-category,": "Ask price: negotiable",
        "Nonce": "01",
        "Expiration": "2014-06-29 12:00:00"
    },
    "Seller": {
        "NymID": "abc123",
        "NodeID": "Alice",
        "BTCuncompressedpubkey": "044448c02963b8f5ba1b8f7019a03b57c80b993313c37b464866efbf61c37098440bcdcc88bedf7f1e9c201e294cf3c064d39e372692a0568c01565b838e06af0b",
        "PGPpublicKey": "xsBNBFQtSk0BB/98EG2qpRRVJUZ0tjwbT88bzjeJl7rhPRWzewvjZDMjjDK0Q9p2q8xm21g1BAgsNV6fqyM8cpnosT6/jYur3h1c+l5YAAWTGw1LYZ44rArMFZ9yq9XuiKH0NEv5xko1+AAKdMnev1ZbU87iRR5YbQXqWCzS2/M+CZ3cY2d/WpJO50zlhofsC1gprtLaBuRmiFaboEjvj/i+a14BvkpmQhhdFlsVSUkUPKUS96hHQfYkY6uJGNC1SCAISaTJAXTMIgIjDRc0/tORAPqi0NrcCfAZJVQuMKBYrqA5acL2cFnehmIYGaCQpexqpV5Lme2jhiFk8/4Fjtl88kqjBUey2tcdABEBAAHNGkJsdWhoYXVhaGEgPGxhbGFAbGFsYS5jb20+wsByBBABCAAmBQJULUpeBgsJCAcDAgkQwltegB4kwqAEFQgCCgMWAgECGwMCHgEAAKvcB/wPLNVWm6iipqKO4hoY45Kxey23uEjVIqHAfNn5J+RkmKnYhEtAn/Q98flh6v7qnTi/GMvP1kbeGdIBob7S6X7z75ZUEIF72Q76qFI7BmuDme2RuKn/xyXRuQuTH0LD/EhPMGQiSjni5kW8ht1g2GpqFQiBKFMmhC4fwSgBQNXLCeDjYK8JvS5RsxLpfcCrvfWJEqjClwjnzXZySjFtZ3qjyry2CLxcPmiprVW7N9D/xJ1KWx3E+dK0zNiqrtxynlv2ZzfgXdu12WGs1YlAt0M1YAcKOSVtUC8iiyRvZYvgFUsuoYNZLDZhRw7PSua4FidYHZnPxMmt2H1ftVqMM9xGzsBNBFQtSl4BB/9wASUgKisYaE0iwp07R1z4Vp0zN/hO77RPV0QPsGcsjmefy1/bl6391pcMAuL7sLvDNXj91bA6SQ50rel2P12YbSvLGgcRpPoxPccQ4myHYOl0tVR4fJcLCyWDmOnz5rGSctZZhAUJ3FaTkeQd3pgzDtdD7M8hZ1GFwMnsw36IUDuyTRo450kNzZV/y9Ai7rjqqjZ86n6h74dp5cUB/w8FVBxAZaFbZYDYPSAsV+ja5CMxasgDhNZwukjRGX3MR/nJNNM+Oy684mi+iAe7ZEcR4m2fDHo/B7oJSTmSfqO21sK9v/K4lRDmJkPYJDpxUMlB/k+ksAgrjehA2h240NFPABEBAAHCwF8EGAEIABMFAlQtSnYJEMJbXoAeJMKgAhsMAADBWAf9Fqj98anrvWlsbtBFwbFu6LF8uNTrtoHNnFfTMOjIR6+ccTIDeMiOOKhEWkZa7VroS3hJXY9Ps0DGjUXQZ5nP0L4IeZOF5+Oj8SPQX+uJfyZ/Ewq/4lpD/DNz9AWyPkDTFLxUfEFJ9kTm1Uue3cV1KKtqeptaFuIL1l7tgaDOi2nxdVq/C937QAiXY6wEUcocaXUOSaWyWjEoiXA7tBRXrp3gxFFs6hl5ECW5gxFymITVm2WlNeHm6Jn9v786bp0Umz8K5+TcPWu08duuOBDw0qAN6g2alt4Cb0IDOOhxmKenIuEHg3RyhCwQwUOpMLlZXxpTWjUzWZOTLEvR9zciXA===28tV"
    },
    "Physical Good Contract": {
        "ItemName": "Little House on the Prairie DVD Anthology",
        "Currency": "Bitcoin",
        "Price": "0.01",
        "Description": [
            "The entire collection."
        ],
        "Delivery": {
            "Country": "USA",
            "Region": "All States",
            "EstimatedDelivery": "13 days after triple-signing",
            "PostagePrice": "Included in the item price"
        }
    }
}
-----BEGIN PGP SIGNATURE-----
Version: OpenPGP.js v0.7.2
Comment: http://openpgpjs.org

wsBcBAEBCAAQBQJULpobCRDCW16AHiTCoAAATMEH/20Yq5z0ceOc40RDi9V/
bXXCi6fkLTcZDO1iX17i7MWwmg/5aInq1VCNy2fNQaqEpV7NIpB7y8DBtYr1
C4zhysZhGJxQKZFBF/OgbkXf0+CfNF3C5Bc5O9PNv8irG46PUKKRkvh/+KRw
6A0ay6xQmzX2Fb3rLBxAZFg0m0UL/vVT9VBZXZ9Vx6ZfkONySO7bJaoazLSq
mX99ypbKbo3c0FHIf8lHuWYoPBwazNWg3SJVPSExnP5YwAt9pz1eefCX08GH
2r0PjGQ4yK9IZcc++cZfqU0Z3MxGwUISqpO7kZ9NhRPzGclzkN/seuVIRek6
f5fTinKexZHIYhc3NyWsIGo=
=I7vn
-----END PGP SIGNATURE-----

Bob accesses the contract via the OpenBazaar client for signing. However, as both Alice and Bob want to maintain privacy in their transaction, Bob blinds the transaction first before sending it to the notary.

Contract blinding requires the following steps to take place:

  1. Bob hashes the original seed contract
  2. Bob prepares a blinded double-signed contract
  • This contract includes the hash of the original seed contract from (1). The purpose of this hash to provide an immutable reference to what Alice and Bob are actually trading.

An example of the blinded contract:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

{
    "OpenBazaar Contract": {
        "OBCv": "0.1",
        "Category": "Physical good",
        "Sub-category,": "Ask price: negotiable",
        "Nonce": "01",
        "Expiration": "2014-06-29 12:00:00"
    },
    "Seller": {
        "NymID": "abc123",
        "NodeID": "Alice",
        "BTCuncompressedpubkey": "044448c02963b8f5ba1b8f7019a03b57c80b993313c37b464866efbf61c37098440bcdcc88bedf7f1e9c201e294cf3c064d39e372692a0568c01565b838e06af0b",
        "PGPpublicKey": "xsBNBFQtSk0BB/98EG2qpRRVJUZ0tjwbT88bzjeJl7rhPRWzewvjZDMjjDK0Q9p2q8xm21g1BAgsNV6fqyM8cpnosT6/jYur3h1c+l5YAAWTGw1LYZ44rArMFZ9yq9XuiKH0NEv5xko1+AAKdMnev1ZbU87iRR5YbQXqWCzS2/M+CZ3cY2d/WpJO50zlhofsC1gprtLaBuRmiFaboEjvj/i+a14BvkpmQh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Z5nP0L4IeZOF5+Oj8SPQX+uJfyZ/Ewq/4lpD/DNz9AWyPkDTFLxUfEFJ9kTm1Uue3cV1KKtqeptaFuIL1l7tgaDOi2nxdVq/C937QAiXY6wEUcocaXUOSaWyWjEoiXA7tBRXrp3gxFFs6hl5ECW5gxFymITVm2WlNeHm6Jn9v786bp0Umz8K5+TcPWu08duuOBDw0qAN6g2alt4Cb0IDOOhxmKenIuEHg3RyhCwQwUOpMLlZXxpTWjUzWZOTLEvR9zciXA===28tV"
    },
    "Buyer": {
        "NymID": "def456",
        "NodeID": "Bob",
        "BTCuncompressedpubkey": "04a34b99f22c790c4e36b2b3c2c35a36db06226e41c692fc82b8b56ac1c540c5bd5b8dec5235a0fa8722476c7709c02559e3aa73aa03918ba2d492eea75abea235",
        "PGPpublicKey": "xsBNBFQum5sBCACGWTFtJElTxRGG7OnHDfaEnPE5fUx57a5i5q5L7Bk6mG3h6omPO7MhhFFtKjbszdq1WUSogvTF7JTqzblC843i6D0XZOCfNEvj2jbMXu7N6QkX4otEOleVZdiRrSkBK8ubdGcaSXsKEONs37nRAfSCOdVz1JZvCtV7fT/oiaqR47osu2OMYOExpAASwF6f1CfglC6uWLnG34e3use+ILrev2WKREINLU4Z5cuZET59gotfqpfH2l3Wo22SBn+HWJl8yIsK3/QB/7oRtPN4wSTky0jJE7+bzE4/F2qjoXPUiqWMDfdF+ALbFs+GBsv8Gtfsmuawr3ZzzPi3fElAoXirABEBAAHNIE9CVGVzdDIgPG9idGVzdDJAb3BlbmJhemFhci5vcmc+wsByBBABCAAmBQJULpuqBgsJCAcDAgkQKr7omyUpIU8EFQgCCgMWAgECGwMCHgEAACP9B/0cjB3CrF4wARoPblCdWijTKq6MwxG/iUp7zOXiIoxF4cXDzTjtkcVBaDOj5Y5wlL7UQc4zJy4c3NUh7qrOzYxNVfqfF9xTVmOtECTYa+hFP4HAxl1v1KAhrhiHren9jOkAc+LRyyMMmM59JcpjY37VsynzdJrLTz3W6fa4PAdSy9b1Ezmg7svgOzPSz/xwWooQBk/2pKH6AF0+wrCMKbztutnf6KMlZoxkbrMcAYQkiCMaRrvNdGcJevgpsViqQ06f9eKuZrmHAhvpuAkT1Xh/YyYZ26RdPKFmpk5KPEPSQbzl8GcS75TfgNiZCBM+WoT1h7F82Tgo30MHxh/dqewFzsBNBFQum6wBCACEEU6kx2ZhYEI+uSExGlby11hPz4QDLrsNWVH4sHJS6Ln05lt30Le55MEpTNiRXAZa/Q70Dt5konpPiQ9+Y6L7WNL3pTlVnDm0Wl6g2Obf1Brg1xqmFAW44u1p2kr8yc/kNh87L2+y3p5qHd0hFV++ex7Fg5oSeow2lQ1lNwMbCFOgml1ddY9Ls+ZsRCBEbBsWD/gfd4wgBtLZBzokx2QueBh/sZrINtLLqXht8C05MpvTQS1m9G4J+sek12c1R6I/O2lcg9sbntKrclMBX1ZcSWh/dkWtG/fgKqYrLxHF9noPiHFTYUlq+5I0KDJUHle6CLb5dsWUrIBHwqI3rLQzABEBAAHCwF8EGAEIABMFAlQum8YJECq+6JslKSFPAhsMAADNYgf+MeBZIlXWbG1p99LNGJWwOyznqinhvj2FWTJAeBpWz+MT35enq+RG7jTziGW3UdvkojLFgMFFZFU34QXKRBOBwXVwXebOAdFyeO0thB7J7mt2esteJGNy5pEegWma97618ZUCOsBmKhfNGGxOfT0+x5qHLpb4X54neA7LxaF3jSBQTut/TTOZNVWscwM+w4hLLzB5Q/0RC6nmQQ03nCCqScQK8WfRohx/vRnXIDmHRsm4p8FJwGBZbT5clOVkon8Bj0Gkp83y9TfJX0CpGrwmbnuaWXPU4EI6+G14XHu3p9xwo3L2Bc8jli0+GVZ7SJCCRdJ+/66NvJYHIVzzbxlvkQ===7H5F"
    },
    "Physical Good Contract": {
        "Blind_contractHash": "544e7ddb8b5b7771303a9d45449b8de328d331b1c7cc473840017f1d67a35542",
        "Currency": "Bitcoin",
        "Price": "0.01"
    }
}
-----BEGIN PGP SIGNATURE-----
Version: OpenPGP.js v0.7.2
Comment: http://openpgpjs.org

wsBcBAEBCAAQBQJULpxACRAqvuibJSkhTwAARkoH/3lwO95EU9zxOIaQp/eB
yab9wyWBNrFLpPXVGNH0xuXwmwO8P7E3vTXs3+hW+TCHQm/zhl3BZa67ttBE
5bI/zfzbVytlawYTD5toE4xdMIZYQU6gjCy7f5KazSJrmKUYLycl88uR4s4Y
Ao5btfWL0gDiqVhICurrjIWAHVKIfkuh1Gx1zvnMRqcA/5zt2ttH4Is90Xeu
hAW0gji/3A5aRW+KKI0FKr1zhhwNkDxqHTcVxbGAuhkskhhMZfxSv8kLiQs7
sJMhxI6U3ayI9V2CFpEYXYFA+KGU8GSwP7x2JCmGGoH5aaSjR/UfPHIqH1zS
qtnvyVGzmFn+KSSpjInBCCw=
=UG48
-----END PGP SIGNATURE-----

As per the standard process, the buyer forwards the contract to the notary who adds a third digital signature to the contract. However, the notary will not be able to determine the contents of the good being sold on OB. OpenBazaar client, exports and emails it as an attached .json file directly to Bob. Bob can then who imports it into the OpenBazaar client. Bob signs the contract and selects a notary.

5. Conclusion

The measures described above are designed to mitigate the risk of collusion taking place over OpenBazaar, but they do not replace individual responsibility and vigilence all users must take on the network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment