Giter Site home page Giter Site logo

python-op_return's People

Contributors

gidgreen 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  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

python-op_return's Issues

Changing Bitcoin client

(Before I put myself on developing something useless...)
Is it possible to leverage an SPV client (e.g.: picocoin), instead of the full node Bitcoin-Core?
In other words, do you think I can modify the lib to make use of a lightweight client?

Problem with rounding and 40 max bytes

Hi, i been testing this lib and i louve it, i found two things that can be improved:

one is to change the OP_RETURN_MAX_BYTES=40 to 80 as the field is now bigger

the other is that i found sometimes a problem with rounding the change amount. It sometimes goes to more than 8 decimal and this is a problem.

I added this small modification to prevent it from happening on the OP_RETURN_send function :

# Calculate amounts and choose inputs
send_amount = round(send_amount,8)

output_amount=round(send_amount+OP_RETURN_BTC_FEE,8)

inputs_spend=OP_RETURN_select_inputs(output_amount, testnet)

if 'error' in inputs_spend:
    return {'error': inputs_spend['error']}

change_amount=round(inputs_spend['total']-output_amount,8)

Regards

Carlos

Where to store the funds?

Hi
I'm trying to use this lib, and understand where should the funds needed to use the lib should be store, and as fas as i can understand, the lib uses the bitcoin core commands using rpc, so i assume i need the funds in the wallet of the bitcoin core client, thats correct?
Maybe it will be useful to add this information into the readme

Cannot retrieve data

I did a quick test of the cli tools. I stored some data:

$ python store-OP_RETURN.py "Test kk message!" 1
TxIDs: b4c9efa9e53c586b4ead18a802b98c647c3774900e3dea62d676db11e5f4cca4
Ref: 1064270-051636

...and then tried to retrieve using the reference but I got the following error:

$ python retrieve-OP_RETURN.py 1064270-051636 1
Traceback (most recent call last):
File "retrieve-OP_RETURN.py", line 43, in
results=OP_RETURN_retrieve(ref, 1, testnet)
File "/home/user/scripts/python/python-OP_RETURN/OP_RETURN.py", line 211, in OP_RETURN_retrieve
txns=OP_RETURN_get_block_txns(height, testnet) # if block, get all fully unpacked
File "/home/user/scripts/python/python-OP_RETURN/OP_RETURN.py", line 401, in OP_RETURN_get_block_txns
block=OP_RETURN_unpack_block(raw_block['block'])
File "/home/user/scripts/python/python-OP_RETURN/OP_RETURN.py", line 623, in OP_RETURN_unpack_block
transaction=OP_RETURN_unpack_txn_buffer(buffer)
File "/home/user/scripts/python/python-OP_RETURN/OP_RETURN.py", line 663, in OP_RETURN_unpack_txn_buffer
input['sequence']=buffer.shift_unpack(4, '<L')
File "/home/user/scripts/python/python-OP_RETURN/OP_RETURN.py", line 785, in shift_unpack
unpack=struct.unpack(format, self.shift(chars))
struct.error: unpack requires a bytes object of length 4

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.