diff --git a/README.md b/README.md index 06b6a81..e63688a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,48 @@ +# Workflow for a new trade + +Install our code as a python package in editable mode. Installing relative to the protocol directory should work. +`pip install -e protocol/` + +Seller: +To initiate a new trade, seller creates a trade and names it. +`xcat newtrade testtrade` + +After creating, they are prompted to export it as hex, to transfer info to the buyer. +`xcat exporttrade testtrade` +Copy the resulting hex string and send it to the buyer. + +Buyer: +To examine trade, buyer imports it. +`xcat importttrade testtrade` + +If it looks ok, inform seller to proceed. + +Seller: +Funds sell p2sh. They can use the checktrade command to automatically take the next step in this trade. +`xcat checktrade testtrade` + +Buyer: +Funds by p2sh. Also uses checktrade command locally. +`xcat checktrade testtrade` + +Seller: +Redeems buyer p2sh. +`xcat checktrade testtrade` + +**At this stage, we need to manually export the trade again, because we haven't added the `walletnotify` functionality which will let the buyer determine what the seller's redeem tx was.** + +So seller exports trade again and sends to seller, so they have the seller's redeem_tx. (this is a temporary measure) +`xcat exportrade testtrade` + +Buyer: +Imports exported trade. +`xcat importtrade testtrade` + +Redeems seller p2sh. +`xcat checktrade testtrade` + +Tx is done! Buyer or seller can check the trade again, but the status will indicate that it is complete. + # ZBXCAT A work-in-progress for Zcash Bitcoin Cross-Chain Atomic Transactions @@ -49,12 +94,6 @@ Be sure to run a Zcash daemon in regtest mode. zcashd -regtest -txindex=1 --daemon ``` -## XCAT CLI interface - -Run `xcat.py` to go through the protocol. `xcat.py new` creats a new trade, `xcat.py seller` progresses with the seller's next step, `xcat.py buyer` progresses with the buyer's next step. - -To test the entire script workflow, run `test.py`. - ## Misc I used the module [future](http://python-future.org/futurize.html) to make existing python2 code for the rpc interface compatible with python3.