GithubHelp home page GithubHelp logo

perone / protocoin Goto Github PK

View Code? Open in Web Editor NEW
97.0 97.0 34.0 68 KB

A pure Python Bitcoin protocol implementation

Home Page: http://protocoin.readthedocs.org/

License: BSD 4-Clause "Original" or "Old" License

Python 100.00%

protocoin's People

Contributors

bmuller avatar hno avatar jhart-r7 avatar kvikshaug avatar perone avatar snare 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

protocoin's Issues

Issue with brainwallet

import hashlib

import sys
sys.path.append('../protocoin')
from protocoin import keys

def brainwallet(num_bytes):
    hashobj = hashlib.sha256("my super secret password seed")
    return hashobj.digest()

priv_key = keys.BitcoinPrivateKey(entropy=brainwallet)
pub_key = priv_key.generate_public_key()                    #This line gives an AssertionError

....

Traceback (most recent call last):
  File "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensio
ns\Microsoft\Python Tools for Visual Studio\2.0\visualstudio_py_util.py", line 7
6, in exec_file
    exec(code_obj, global_variables)
  File "C:\git\myBlockChain\brainWalletTest\brainWalletTest.py", line 12, in <mo
dule>
    pub_key = priv_key.generate_public_key()
  File "../protocoin\protocoin\keys.py", line 180, in generate_public_key
    return BitcoinPublicKey.from_private_key(self.private_key)
  File "../protocoin\protocoin\keys.py", line 32, in from_private_key
    return klass(hexkey)
  File "../protocoin\protocoin\keys.py", line 20, in __init__
    curve=ecdsa.SECP256k1)
  File "C:\Anaconda\lib\site-packages\ecdsa\keys.py", line 36, in from_string
    (len(string), curve.verifying_key_length)
AssertionError: (63, 64)
Press any key to continue . . .

Error when deserializing some message headers

There is a bug with some clients happening at random times while deserializing message hader, it seems to be something related to the magic number

  File "node1.py", line 68, in _run
    client.loop()
  File "protocoin/clients.py", line 92, in loop
    message_header, message = self.receive_message()
  File "protocoin/clients.py", line 45, in receive_message
    message_header = message_header_serial.deserialize(self.stream)
  File "protocoin/serializers.py", line 73, in deserialize
    value = field_obj.deserialize(stream)
  File "protocoin/fields.py", line 99, in deserialize
    return struct.unpack(self.datatype, data)[0]
error: unpack requires a string argument of length 4

Add support for testnet

It is not enough to simply specify the port, it seems that due to a different magic in the message header, testnet doesn't accept connection and throws the following error:

PROCESSMESSAGE: INVALID MESSAGESTART

Perhaps add a default argument to BitcoinClient and BitcoinBasicClient?

clients.py: Error in close_stream, should be 'self' and not 'sel' in the statement 'sel.socket.close()'

Hello,

in clients.py in the class BitcoinBasicClient is this class function:

def close_stream(self):
"""This method will close the socket stream."""
sel.socket.close()

Obviously this should be self.socket.close() and not sel.socket.close().

The error I got was this one:

('Message sent:', 'version')
Traceback (most recent call last):
File "./receive_test.py", line 33, in
main()
File "./receive_test.py", line 28, in main
client.close_stream()
File "/usr/local/lib/python2.7/dist-packages/protocoin-0.2-py2.7.egg/protocoin/clients.py", line 20, in close_stream
sel.socket.close()
NameError: global name 'sel' is not defined

Kind regards
M

Not an issue -- altcoin for study

Sorry, non an issue but cannot find any way to contact the maintainer. I wonder if protocoin is suitable to build a altcoin just for experimentation purposes, example adding new features like key/value storing in transaction or other stuff not part of Bitcoin protocol. Thank you.

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.