Update readme

This commit is contained in:
Jay Graber 2017-08-01 13:25:50 -07:00
parent 6312cd02b0
commit 938ee71c97
1 changed files with 45 additions and 6 deletions

View File

@ -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 <hexstring> 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 <hexstring> 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.