Coder Social home page Coder Social logo

zbxcat's People

Contributors

arcalinea avatar arielgabizon avatar prestwich avatar zmanian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zbxcat's Issues

Immediate next steps

  • Run on testnet
  • Run on two computers
  • Get the secret parsed from transactions
  • Seller and buyer can find the funding txids themselves from blockchain (buyer finding seller funding tx does work well.)
  • Make sure it works well on both blockchains
  • More flexible data model
  • Add way to test protocol without command line input
  • test locktime conditions
  • test refund conditions

next steps for bitcoin-zcash

  1. Make sure test.py works for all redeem scenarios -
    seller bails before fulfilling, buyer bailed before funding, both redeem with hash preimage

Setting up

@arcalinea @arielgabizon

Following the set up instructions I run into problems:

Using venv, python -V returns Python 3.5.2 which is expected.

Next step, pip install zbxcat returns:

  Could not find a version that satisfies the requirement zbxcat (from versions: )
No matching distribution found for zbxcat

User ListRecievedByAddress instead of GetRecievedByAddress

bitcoinRPC.py->get_fund_status might better served by listreceivedbyaddress instead of getreceivedbyaddress

Listrecievedbyaddress provides richer information on incoming txs allowing for the program to provide feedback like fund tx in mempool but unconfirmed.

Json structure of listrecievedbyaddress results

Result:
[
  {
    "involvesWatchonly" : true,        (bool) Only returned if imported addresses were involved in transaction
    "address" : "receivingaddress",  (string) The receiving address
    "account" : "accountname",       (string) DEPRECATED. The account of the receiving address. The default account is "".
    "amount" : x.xxx,                  (numeric) The total amount in BTC received by the address
    "confirmations" : n,               (numeric) The number of confirmations of the most recent transaction included
    "label" : "label",               (string) A comment for the address/transaction, if any
    "txids": [
       n,                                (numeric) The ids of transactions received with the address 
       ...
    ]
  }
  ,...
]

Zcash 2.0.2 compatibility

Kindly update for compatibility with Zcash 2.0.2 or provide some instructions and suggestions to accomplish same.

Improve testing

  • flake8
  • coverage (tool to measure code coverage for unit tests, html reports)

Ideas for future development

Add to RPC interface, so it's available with zcash-cli to perform these trades?
Have a new layer of abstraction on top of RPC interface for commonly used functions, including this?
Python library for XCAT with current RPC commands?

Notes:
Some things we want to implement could be built on top of RPC interface.
For example, synchronous z_sendmany call. That operation could be created as standalone client, or put into existing interface.
Should we start to move logic to a new layer?

User flow:
Low-level tool that could be building block for other stuff
Like having a tool for executing those 4 steps. Have to coordinate with other person out of band

  • other applications would want to preserve state differently
  • every time there's more than one state that's a source of truth, bugs are introduced

Calculate locktime confidence across chains

Eventually we need reliable estimates of how often X Bitcoin blocks will occur before Y Zcash blocks, so that we can set safe locktimes on each chain. With the help of a statistician friend, I wrote a script to calculate that.

import operator as op
import math


# StackExchange ncr magic
def ncr(n, r):
    r = min(r, n - r)
    if r == 0:
        return 1
    numer = reduce(op.mul, xrange(n, n - r, -1))
    denom = reduce(op.mul, xrange(1, r + 1))
    return numer // denom


# Number of Bitcoin blocks for estimation
c1b = 100.0
# Bitcoin's rate (1 block per 600 seconds)
c1r = 1/600.0

# Number of Zcash blocks for estimation
c2b = 300.0
# Zcash's rate (1 block per 150 seconds)
c2r = 1/150.0

sum = 0.0

for k in range(int(c1b), int(c1b + c2b)):
    term_one = ncr(int(c1b + c2b - 1), int(k))
    term_two = math.pow(c1r / (c1r + c2r), k)
    term_three = math.pow(c2r / (c1r + c2r), c1b + c2b - 1 - k)

    sum += term_one * term_two * term_three

print sum

Improve data input for addresses and amounts

Currently the user enters data on the command line, or sets it in xcatconf.py. The xcatconf.py file is used for test cases to avoid manual data entry.

Need to improve how this data is passed in, and make compatible with different use cases.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.