bitcoinrb

The implementation of the bitcoin protocol for ruby.

MIT License

Downloads
75.8K
Stars
53
Committers
13

Bot releases are hidden (Show)

bitcoinrb - v1.5.0 release Latest Release

Published by azuchi 7 months ago

This release includes the followings:

New features

  • Add implementation of the cryptographic parts of BIP-324 Version 2 P2P Encrypted Transport Protocol. Both ruby and libsepc256k1 implementation.

Other changes

  • libsecp256k1.dylib for macOS used in unit tests has been removed. you want to test using libsecp256k1 in an environment other than Linux, please set the path of the libsecp256k1 library to the environment variable TEST_LIBSECP256K1_PATH.
  • Now compatible with libsecp256k1 v0.4.0.
  • Refactor test case to use shared_example.
  • Update bip-schnorr gem from 0.5.0 to 0.7.0.
  • Update ecdsa_ext gem from 0.5.0 to 0.5.1. Accordingly, the monkey patch for ECDSA::Point#to_hex has been removed.

Bug fix

  • Fix a bug where valid signatures would fail to be verified in Bitcoin::MessageSign#verify_message. This bug only affects you if you use the Ruby implementation of this library instead of libsecp256k1.

Full Changelog: https://github.com/chaintope/bitcoinrb/compare/v1.4.0...v1.5.0

bitcoinrb - v1.4.0 release

Published by azuchi 10 months ago

This release includes the following changes:

New Feature

  • Add Bitcoin::Script#p2pk? method to check whether script is P2PK or not.

Bug Fix

  • Fixed a bug where a Key object with a compressed public key was returned even if TYPES[:uncompressed] was specified for key_type in the Bitcoin::Key#generate method.
  • Fixed a bug where an error occurred in the Bitcoin::Script#multisig? method when the number of signatures was an invalid value.

Removed feature

We have deprecated support for the BIP-70 Payment Protocol, as it has also been removed from Bitcoin Core. Along with this, the dependency on activesupport is removed.

Full Changelog: https://github.com/chaintope/bitcoinrb/compare/v1.3.0...v1.4.0

bitcoinrb - v1.3.0 release

Published by azuchi over 1 year ago

This release includes the following changes:

  • Add Bitcoin::PSBT::Tx#to_h method to output each PSBT data in Hash format.
  • Add decodepsbt option in bitcoinrb-cli to decode Base64-format PSBT into JSON format.
  • Return address of Bitcoin::Script#to_h changed to return a single address.
  • Add BIP-322 message signing.
  • Elliptic curve operations changed to be performed in Jacobian coordinates using ecdsa_ext gem and bip-schnorr gem v 0.5.0.
  • Add private key length check in Bitcoin::Key#new.
    An incorrect public key was derived if a private key was specified with dropped digits that were not exactly 32 bytes and libsecp256k1 was used. This check ensures that an exception is thrown in such cases. The following code, which could also cause such cases, has been corrected:
    • Bitcion::ExtPubkey#derive
    • Bitcion::Taproot#tweak_private_key

Full Changelog: https://github.com/chaintope/bitcoinrb/compare/v1.2.1...v1.3.0

bitcoinrb - v1.2.0 release

Published by azuchi almost 2 years ago

This release contains following changes:

  • Add support for Taproot Fields for PSBT(BIP-371)
  • Add Bitcoin::Script#to_p2tr which creates P2TR script pubkey using xonly public key
  • Add Bitcoin::Key#to_addr which returns address correspond to key_type value and #to_p2tr which generates P2TR address
  • Some refactorings

See below for a complete list of changes:

Full Changelog: https://github.com/chaintope/bitcoinrb/compare/v1.1.1...v1.2.0

bitcoinrb - v1.1.1 release

Published by azuchi over 2 years ago

This release fixes the following issues that occur in Ruby 3.1

psych 4.0.0 is now bundled with Ruby 3.1. Psych.load has been incompatible since psych 4.0.0. Accordingly, YAML.load has also become incompatible.

In bitcoinrb, YAML.load is used to load network settings in Bitcoin::ChainParams. This results in an error in Bitcoin::ChainParams when using bitcoinrb with Ruby 3.1.

This release resolves the error by using YAML.unsafe_load instead of YAML.load in Ruby 3.1+.

Full Changelog: https://github.com/chaintope/bitcoinrb/compare/v1.1.0...v1.1.1

bitcoinrb - v1.1.0 release

Published by azuchi over 2 years ago

The following change are included in this release:

  • Compliant with the BIP-174 specification for PSBT:
    We have been providing PSBT feature for some time now, but several keys have since been added to BIP-174. This release supports the following keys that have been added:
    • PSBT_GLOBAL_PROPRIETARY
    • PSBT_IN_PROPRIETARY
    • PSBT_OUT_PROPRIETARY
    • PSBT_IN_RIPEMD160
    • PSBT_IN_SHA256
    • PSBT_IN_HASH160
    • PSBT_IN_HASH256
  • Replace extension of Object#build_json and to_h by open class with refinement(e4d4968e).

Full Changelog: https://github.com/chaintope/bitcoinrb/compare/v1.0.0...v1.1.0

bitcoinrb - v1.0.0 release

Published by azuchi almost 3 years ago

The following change are included in this release:

Taproot-related flags are now standard

The following flags when processing scripts are now standard flags:

  • SCRIPT_VERIFY_TAPROOT
  • SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_TAPROOT_VERSION
  • SCRIPT_VERIFY_DISCOURAGE_OP_SUCCESS
  • SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_PUBKEYTYPE

In previous versions, these flags had to be explicitly set when evaluating Taproot-related scripts.

bitcoinrb - v0.9.0 release

Published by azuchi almost 3 years ago

The following fixes and improvements are included in this release:

  • Bitcoin::PSBT supports PSBT data read from file and write to file.
  • Bitcoin::Taproot::SimpleBuilder change following:
    • The interface that receives script and leaf version has been changed to an interface that receives Bitcoin::Taproot::LeafNode.
    • Bitcoin::Taproot provides some utility methods to help spending P2TR.

For more detail about how to build and spend P2TR, see the Wiki page.

bitcoinrb - v0.8.0 release

Published by azuchi over 3 years ago

The following fixes and improvements are included in this release:

  • Add strict data check for transaction parsing(8e3f985)
  • Accelerating taproot testing through parallel execution
  • Speed up to use libsecp256k1 with Bitcoin::ExtPubkey#derive same as ExtKey#derive(b3b2ec9)
  • Implement Bitcoin::MessageSign that sign any message using key(see wiki)
  • Add Bitcoin::Script#p2tr? which check script whether P2TR or not(f164afe)
  • Add Bitcoin::Taproot::SimpleBuilder to support building Taproot P2TR and creating transactions when spending it.
bitcoinrb - v0.7.0 release

Published by azuchi over 3 years ago

This release includes the following improvements and features:

P2P

The new P2P messages sendaddrv2 and addrv2 defined in BIP-155 have been added.

  • Bitcoin::Message::SendAddrV2
  • Bitcoin::Message::AddrV2

In addition, the following features have been added that are useful for handling P2P messages.

  • Bitcoin::Message::Base#from_pkt(message): This method decodes a single P2P message containing the magic bytes and creates an instance of the corresponding message class.
  • Bitcoin::Message#decode(command, payload): This method creates an instance of the corresponding message class from the P2P command and payload specified in the arguments.

Improvements

  • Improve String#opcode performance: The performance of String#opcode, which is extended with open classes, has been improved. It used to convert all data to bytes, but now String#ord is executed after specifying the character encoding. This change is not expected to have any impact, but if it does, please report it.
  • Update the dependent library bech32rb: The version of the dependent library bech32rb has been updated to v1.1.0. It now supports bech32m, the Taproot address encoding.
bitcoinrb - bitcoinrb v0.6.0 release

Published by azuchi over 3 years ago

Notable Changes

This release includes following new features, various bug fixes:

  • Support schnorr signature(BIP340).
  • Support taproot and taprscrpt consensus(BIP341 and BIP342).
  • Support ruby 3.0 environment.
  • Add signet chain parameter. (1a701c3)
  • Fix Bitcoin::RPC::BitcoinCoreClient exception message string to JSON format. (1054307)
  • Add public key full validation when initializing Bitcoin::Key. (09bd128)
bitcoinrb - bitcoinrb v0.5.0

Published by azuchi about 4 years ago

Notable changes

Support BIP74 payment code

Support BIP74 (Payment code) in Bitcoin::PaymentCode

Add BIP157 messages

Add BIP157 messages.

Support BIP85

Support BIP85 in Bitcoin::BIP85Entropy

Bitcoin::Script

  • Fix #to_s display bug when an empty string is set from the stack.

PSBT

Due to CVE-2020-14199, Bitcoin::PSBT::Tx now includes and allow both non_witness_utxo and witness_utxo for segwit inputs.

Miscellaneous

  • Change peer discovery to find peer which supports NODE_BLOOM
  • Change coinbase script loading logic in Bitcoin::TxIn
  • Remove rest-client gem dependency.
  • Add ECDSA::Point#to_hex method which convert Elliptic Curve Point to hex string.
bitcoinrb - bitcoinrb v0.4.0

Published by azuchi almost 5 years ago

Notable changes

  • Remove fork coin support: Fork_ID of Bitcoin Cash was supported, but fork coin support was removed because the difference in specifications with Bitcoin including the addition of opcode became large.
  • Add Bitcoin::Script#to_addr method to replace Bitcoin::Script#addresses.
  • Fix testnet extended public key version byte for p2wsh-p2sh.
  • Add depth limit check for Extended Key. If you try to derive a key with more than 256 depth, you will get an error.