Skip to content

Commit

Permalink
Merge pull request #8 from michaelfolkson/michael_docs
Browse files Browse the repository at this point in the history
More additions to docs
  • Loading branch information
cpacia authored Sep 27, 2017
2 parents 135ceb3 + 618ac27 commit 60471ac
Show file tree
Hide file tree
Showing 18 changed files with 425 additions and 353 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# OpenBazaar Documenation
# OpenBazaar Documentation

This repo is a work in progress. The goal is to have all the mkdocs documenation files for docs.openbazaar.org. Then docs.openbazaar.org can load files directly from master.
This repo is a work in progress. The goal is to have all the mkdocs documentation files in this repo for [docs.openbazaar.org](docs.openbazaar.org). Then [docs.openbazaar.org](docs.openbazaar.org) can load files directly from master.

Help is appreciated.
There is a #documentation_2-0 channel on the OpenBazaar Slack if you have any questions about this repo. You can join the OpenBazaar Slack [here](http://slack.openbazaar.org).

If you are new to OpenBazaar, the easiest way to start contributing to this documentation repo is to fork it, define some term(s) in the [Glossary](docs/glossary.md) and make a pull request.
17 changes: 17 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Contributing to OpenBazaar

Anyone is free to contribute to OpenBazaar. The process and guidelines for contributing are similar to those for [Bitcoin Core](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md).

Many of the OpenBazaar core developers (including the lead maintainer) are currently hired by OB1 but over time as the OpenBazaar ecosystem grows, there will hopefully be many more contributors affiliated with other organizations or independent.

To make a contribution to any of the OpenBazaar GitHub repositories, you should fork the repository, create a topic branch and then submit a pull request when you have completed your work.

To ensure the highest probability of your pull request being merged, it is best to discuss what you intend to contribute with core developers/other contributors on the OpenBazaar [Slack](http://slack.openbazaar.org)

If you would like to add a new feature rather than just a bug fix, you may need to follow the OBIP (OpenBazaar Improvement Proposal). More information on the OBIP process can be found [here](https://github.com/OpenBazaar/obips).

The OpenBazaar client is coded in Javascript. The server is coded in Go. If you code in the above languages, we encourage you to contribute!




2 changes: 1 addition & 1 deletion docs/core_values.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ The protocol is designed to be censorship resistant and to offer privacy to its

A long term goal of OpenBazaar is to be cryptocurrency and blockchain agnostic. Limited resources and user experience considerations will restrict progress on this front in the short term.

The project is guided by the processes of other successful open source projects (Bitcoin, Linux etc). If you would like features to be added to the protocol, it is possible to submit OBIPs (OpenBazaar Improvement Plans) after discussing them with the OpenBazaar core developers.
The project is guided by the processes of other successful open source projects (Bitcoin, Linux etc). If you would like features to be added to the protocol, it is possible to submit [OBIPs](https://github.com/OpenBazaar/obips) (OpenBazaar Improvement Plans) after discussing them with the OpenBazaar core developers.


10 changes: 9 additions & 1 deletion docs/glossary.md
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
Please help build this out at <a href="https://github.com/OpenBazaar/docs/">https://github.com/OpenBazaar/docs/</a>
# Glossary

This is a work in progress. This is intended to define any terms that users or developers may be confused about when interacting with the OpenBazaar software.

**Hierarchical Deterministic Wallet** - Add definition

**IPFS** - Add definition

**Multi-signature address** - Add definition
348 changes: 0 additions & 348 deletions docs/overview.md

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions docs/protocol/backups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Backups

## Backing up your Bitcoin wallet

Your Bitcoin wallet is generated using a 12 word seed which you are encouraged to save on paper. (The order of the words is important.) This seed will allow you to access your funds in the case of a loss or failure of your machine

There is an outstanding pull request to allow you to access your seed in the user interface.

https://github.com/OpenBazaar/openbazaar-desktop/pull/690

## Backing up your store and other account data

57 changes: 57 additions & 0 deletions docs/protocol/bitcoin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Bitcoin

The early release of OpenBazaar 2.0 will only accept the cryptocurrency Bitcoin. There is a Shapeshift integration so you can still purchase items on OpenBazaar with other cryptocurrencies via Shapeshift. There are plans to facilitate direct purchases with other cryptocurrencies in the near future.

Bitcoin is the oldest and most secure cryptocurrency. It aligns with the goals of OpenBazaar as it is decentralized, censorship resistant and does not rely on trusted third parties.

Bitcoin enables a "trustless" escrow system using multi-signature transactions where no one party has complete control of the funds. Mainstream payment systems like Paypal and credit cards rely on the payment provider for arbitration in the case of a dispute. With OpenBazaar, a free market for arbitration is created where the participants can agree on a particular moderator. This moderator only has partial control of the funds in escrow.

The activation of SegWit in Bitcoin Core should decrease transaction fees in the short term but there are multiple cryptocurrencies that can offer additional or superior features such as lower transaction fees, shorter block times or stronger privacy.

In theory, the OpenBazaar protocol could work with any cryptocurrency, not just Bitcoin. In practice, there are certain features a cryptocurrency must have to be added seamlessly to the OpenBazaar protocol. Multi-signature transactions must be enabled and a UTXO model is preferential to the account model. In summary, cryptocurrencies that are a close derivative to Bitcoin are stronger candidates for integrations in the short term.

## Multi-sig scripts
If you'd like to learn more about how Bitcoin works we'd suggest reading the <a href="https://bitcoin.org/en/developer-guide">Bitcoin Developer Guide</a> or [Mastering Bitcoin](https://www.amazon.com/Mastering-Bitcoin-Programming-Open-Blockchain/dp/1491954388/) by Andreas Antonopoulos. However, we can provide a quick overview of how the escrow system works.

In Bitcoin, the coins are not technically sent to a bitcoin "address" or account. Instead, they are sent to a simple computer program (or script). This script sets the terms upon which the coins are allowed to be transferred. A person seeking to spend bitcoins provides the inputs to the script function and the bitcoin software will execute it. If the script returns `True` (and all other transaction checks pass) then the bitcoins may be transferred to another script.

The specific script we use looks something like this:
```
OP_HASH160 <Hash160(redeemScript)> OP_EQUAL
```

Technically this script means "anyone who knows a certain password can spend these coins." Bitcoin underwent a soft-fork upgrade several years ago which gives this script a "special" meaning. In essence, when the interpreter sees this script it interprets it not as a password script, but as something called "pay to script hash" or P2SH.

Coins sent to this script can be spent by providing a `redeem script` whose hash matches the hash in the output script and then by fulfilling the terms of the `redeem script`.

In OpenBazaar we use a redeem script that looks like:

```
OP_2 <buyer_pubkey> <vendor_pubkey> <moderator_pubkey> OP_3 OP_CHECKMULTISIG
```

This script says the funds may be transferred if signatures matching two of the three listed public keys are provided.

The scripting language is flexible enough that we could extend it with additional features in the future. For example, suppose we want to add a timeout to the escrow. That is, if the buyer doesn't release the fund or file a dispute within 60 days, the funds will then be transferred to the vendor. Essentially this can save the vendor some headaches trying to collect his payment.

This redeem script would look like:

```
OP_IF
OP_2 <buyer_pubkey> <vendor_pubkey> <moderator_pubkey> OP_3 OP_CHECKMULTISIG
OP_ELSE
"60d" OP_CHECKSEQUENCEVERIFY OP_DROP
<vendor_pubkey> OP_CHECKSIG
OP_ENDIF
```

## Bitcoin Wallets
The OpenBazaar protocol specification has nothing to say about which Bitcoin wallet should be used with the protocol. To improve the user experience the reference implementation comes bundled with a built-in wallet. The default wallet implements something call Simplified Payment Verification (SPV) which provides strong cryptographic validation of incoming Bitcoin transactions while using very little of the computer's resources. The drawback to SPV mode is it leaks enough private data to allow potential attackers to figure out which transactions came from the wallet. That information by itself doesn't say who the *owner* of the wallet is, though other investigative techniques might provide that information.

For this reason, there is a setting in the openbazaar-go config file that allows a user to use bitcoind (a full Bitcoin implementation) with openbazaar-go. Bitcoind is a very heavyweight software and is typically only used by power users, but it does a much better job than SPV at providing transactional privacy.

## Bitcoin Fees

How are Bitcoin fees calculated?

Bitcoin transaction fees are estimated using the 21 Bitcoin fees API. More details [here](https://bitcoinfees.21.co/api).
Loading

0 comments on commit 60471ac

Please sign in to comment.