Code Monkey home page Code Monkey logo

yours-bitcoin's People

Contributors

clemensley avatar petertodd avatar ryanxcharles 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yours-bitcoin's Issues

Fix all js standard style issues

We're using "js standard" to enforce style, which I added only recently. We have 2300+ style issues that cannot be resolved with "standard --format" and thus have to be fixed by hand. We need to fix all of these.

What happened to SINs?

Howdy Ryan,

I'm working on replacing bitcore with fullnode in bitauth and node-bitpay-client, but it appears that the SIN implementation didn't make the cut for the move from bitcore. It seems that the intent was to do so (reading the README):

Any non-standard features (such as SINs and stealth addresses) are placed in the lib/expmt/ folder and are accessible at fullnode.expmt.

Do you expect to port the bitcore SIN implementation?

Allow templates on script interpreter

It is possible the script interpreter is faulty. In fact, any consensus-critical code may be faulty. This could result in lost funds if someone relied on faulty consensus code that put them on a fork. One way to address this issue is through the use of templates. Allow the script interpreter and other consensus-critical code to be disabled for non-standard transactions. Allow a whitelist of template scripts to constitute standard transactions (similar to or perhaps idential to IsStandard in bitcoin core).

This idea comes from Peter Todd: https://twitter.com/petertoddbtc/status/541018246858960897

Establish tcp connection with known peer

It needs to be possible to establish a tcp connection. This will require a connection manager. However, at the current time, we only need to establish one tcp connection to a known peer. We do not (yet) need to worry about managing multiple connections at a time. We also do not need this workin in a browser (yet) - only in node.js.

Merkle trees

We need to implement bitcoin-style merkle trees for SPV.

Update dependencies

Some of the fullnode dependencies are out of date. I tried updating them, however the tests run much slower after the update (15s instead of 3s in node). We need to figure out why the tests run much slower, and then update the dependencies. The reason probably has something to do with the way I'm wrapping Fedor's crypto. Something has probably changed with his big number and elliptic curve code to make my wrapping code much slower. We need to identify the problem and refactor the fullnode BN and Point classes to not be slow. Or, if that is not the issue, identify what the real issue is and fix it.

My attempt to update dependencies: #27

watchify build process

Right now the way to test for the browser is either to run gulp to build things and then refresh the mocha tests by hand, or run karma once, both of which are slow. We need to add watchify into the build process and keep karma open, so that you can get continuous feedback on broken tests during the development process. Watchify should run both the browser tests and karma tests.

Use libsecp256k1 and other C/C++ crypto in node

We're using Fedor Indutny's pure-js cryptography both in node and browsers. His code is fast for pure-js code, but would be much faster with libsecp256k1 and other C/C++ crypto in node. Additionally, Fedor's crypto is not very well reviewed and probably contains vulnerabilities that better-reviewed C/C++ code doesn't have. We might even want to consider transpiling C/C++ code for the browser.

Fix worker interface

Each object should have the ability to perform its operations in a worker. e.g., object.asyncFromBuffer(buf). This would be a better interface that the current form which requires passing in string names of classes. It would also be extremely useful for Datt, because it would allow reusing the worker interface.

Audit code against timing attacks

Timing attacks, in a worst case scenario, can be used to recover private keys. See, for instance, this relevant article on timing attacks:

I have not always had timing attacks in mind when implementing cryptography in fullnode. We should audit all the crypto, most especially ECDSA to ensure the code is resistant to timing attacks.

  • Big number comparisons should be constant time.
  • Hash number comparisons should be constant time.
  • Signing operation should be constant time.

...correctly solving all timing vulnerabilities may require importing and rewriting the elliptic curve code because I have no control over the speed of, say, point multiplication when we use an external library.

Audit cryptography

There was recently a serious error discovered in one of fullnode's dependencies. See this commit for information:

dbeab00

This reminds us that the cryptography in fullnode, both in the depencies and in the library itself, largely consist of recently-written cryptography that has not been properly audited. This issue is to contain the problem of "auditing the cryptography" and keep track of the progress made on this goal.

First, let's just list the dependencies that need to be audited:

  • bn.js
  • elliptic (particularly the secp256k1 code)
  • hash.js
  • aes
  • bs58
  • pbkdf2-compat
  • node-crypto
  • browserify-crypto

Second, all of the cryptography in fullnode needs to be audited.

"Auditing" is a somewhat vague goal, but I will propose two passes:

Pass 1: Review every line of source code, identify edge cases, confirm that test vectors exist that test the edge cases, or write new test vectors that test the edge cases. Furthermore, identify all standard test vectors and include those.

Pass 2: Re-implement all of the cryptography a second time, identify edge cases in the new implementation, write tests for them, then confirm that the old code passes the new tests (or fix any issues that arise). If there is reason to believe the new cryptography is better, then replace the old cryptography with the new cryptography.

Both passes should be performed on all cryptography dependencies and for all cryptography directly contained in the library.

PBKDF2-SHA512 is slow

PBKDF2 is deliberately designed to be a slow algorithm in order to make password cracking infeasible. However, we have every reason to make our implementation as fast as possible since we have to run it to generate keys and and even more so to run the tests.

There are three elements of slowness in our PBKDF2 algorithm: the PBKDF2 function itself, the HMAC function, and our implementation of SHA512. I made some minor improvements to HMAC which ever so slightly increased the speed. We are currently using the package sha512 for SHA512, so I've also experimented with using different packages for implementing SHA512 which might be faster:

  • js-sha512
  • sha512crypt-node

Both of those are slightly faster than the sha512 algorithm we're using, but they require minor modifications to work with buffers instead of strings. Another option is to bring the SHA2 family of hash functions, or even all the hash functions, into fullnode so we can control that the interfaces are optimal for this library (particularly using buffers instead of arrays).

Add bitcoin as a topic to this repository

Hello,

This repository is listed on the Awesome Bitcoin list, which is a collection of useful Bitcoin projects. However, it seems that the 'bitcoin' topic is missing from this repository's topics.

Adding the 'bitcoin' topic will help users discover your project more easily and recognize its relevance to the Bitcoin ecosystem. To add the topic, please follow these steps:

  1. Navigate to the main page of the repository.
  2. Click on the gear icon next to "About" on the right side of the page.
  3. In the "Topics" section, type 'bitcoin' and press Enter.
  4. Click "Save changes."

Thank you for your attention and for contributing to the Bitcoin community!

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.