2022 Developer Survey is open! Take survey.

Questions tagged [ruby]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
277 views

How to properly compute the BIP39 checksum bytes?

I'm trying to understand the logic of generating a valid BIP-39 seed phrase. I have read the BIP-39 and trying to implement the section Generating the mnemonic step by step. I have the following ...
user avatar
  • 1,376
1 vote
1 answer
275 views

How to convert xpub ypub and zpub in Ruby

I'm looking to convert a Bitcoin extended public key from one format to another in Ruby. In JS I've found https://github.com/jlopp/xpub-converter/blob/master/js/xpubConvert.js and Python https://...
user avatar
1 vote
2 answers
265 views

How to verify the compressed signature in Bitcoin? It is 138 long in hex

I am using the bicoinjs-message npm module for signature verification. I learned that there are few signatures which are of length 138 in hexadecimal. When I tried to verify such a signature it is ...
user avatar
0 votes
1 answer
109 views

How to convert Script hash into opcodes, in Ruby?

I have a script and it looks like this: 76a914af7a4a30243f2301e6a14a4979ae099d52f560d488ac. How can I create an instance of class Bitcoin::Script from ruby-bitcoin? It has to be parsed, I believe, but ...
user avatar
  • 127
1 vote
1 answer
379 views

How to convert P2PKH to Hash160 (or something else acceptable by Script)?

How to convert a bitcoin address (starts with 1) to the right format acceptable by script (I'm using this Ruby library)? I'm doing this: tx.output do |o| o.value(50000) o.script { |s| s.recipient(...
user avatar
  • 127
0 votes
1 answer
2k views

How to send Bitcoin in the Testnet?

I'm using this library: https://github.com/lian/bitcoin-ruby And here's my code: require 'open-uri' require 'net/http' require 'net/https' require 'json' require 'bitcoin' Bitcoin.network = :...
user avatar
  • 123
0 votes
1 answer
63 views

Bitcoin-ruby returns "nil" value for bitcoin-cli calls

I am new to test "bitcoin-ruby" to parse bitcoin blockchain data. But while testing it, I am having issues to make some bitcoin-cli commands to get this to work. The environment I'm using is : *Linux ...
user avatar
  • 5
0 votes
1 answer
69 views

Getting error while accessing bitcoin client from ruby using Rpc

I am getting the following error while trying RPC call from ruby. bitcoind server is running. I am using bitcoin-ruby library . Code Tried in irb to test: require 'bitcoin' => true irb(main):002:...
user avatar
  • 5
0 votes
2 answers
414 views

Cannot create a raw transaction using bitcoin-ruby

Im using bitcoin-ruby to create a raw transaction then broadcast it through block-cypher. I follow their tutorial # use testnet so you don't accidentally blow your whole money! Bitcoin.network = :...
user avatar
0 votes
2 answers
238 views

Ruby bitcoind JSON RPCCall

I am trying the JSON-RPC call from https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#Ruby require 'net/http' require 'uri' require 'json' class BitcoinRPC def initialize(service_url) @uri = ...
user avatar
3 votes
2 answers
4k views

How to get balance of tens of thousands of addresses?

What is the best way to get balance of large amount of addresses? I tried to use APIs from different providers, but they are limiting the requests. Is there any APIs that give premium service without ...
user avatar
  • 31
1 vote
0 answers
109 views

BIP70 signed payment request

I am using https://github.com/bumi/bip70-example to make signed payment request. I bought COMODO Wildcard certificate. And creating certificates bundle in following order: mydomain_origin.com.crt, ...
user avatar
  • 123
1 vote
0 answers
222 views

PHP Coinbase Securing Callbacks

This is example callback verification code in Ruby (https://developers.coinbase.com/docs/wallet/notifications): CALLBACK_DIGEST = OpenSSL::Digest.new("SHA256") def self.verify_callback(body, ...
user avatar
  • 11
2 votes
0 answers
189 views

create a p2sh_script with btcruby gem

I try to create a custom p2sh script using the btcruby gem. Here is the code I used to generate my script: def self.create_script myscript=BTC::Script.new myscript<<BTC::Script::OP_IF ...
user avatar
1 vote
0 answers
492 views

Is there any library to process scriptSig script in transaction, and other scripts?

I'm trying to parse hex representation of scriptSig, in normal transactions there are variable int, r&s, pubkey. But some are really weird, like those ones: ...
user avatar
1 vote
2 answers
530 views

Ruby: How do I create a wallet and import an electrum seed using money-tree gem

I am looking for a way to use HD wallets with ruby. This is what I have found: https://github.com/GemHQ/money-tree. However I am having trouble generating a wallet and getting the seed to reload it in ...
user avatar
  • 111
2 votes
1 answer
514 views

How to connect bitcoind mainnet node on AWS EC2 by using rpcjson?

I'd like to access bitocind mainnet node on AWS EC2 from ruby. I've written as follows using rpcjson, however it cannot connect, then returned the error client = RPC::JSON::Client.new 'http://...
user avatar
  • 251
0 votes
1 answer
522 views

How to access bitcoin client from ruby using Rpc client?

I'd like to access local bitcoin node from ruby by using RPC client. The following is my code, and it returns the next code. Could you tell me how to call Bitcoin client on ruby? #console ...
user avatar
  • 251
0 votes
1 answer
662 views

Recommended resources or tuts for Bitcoin/Bitcoin Exchange clone using Ruby/Rails?

Are there any reputable resources or tuts for re-building a Bitcoin/Bitcoin Exchange clone using Ruby/Rails (e.g. Michael Hartl tutorial)? I would like to experiment and learn more about blockchain ...
user avatar
0 votes
3 answers
1k views

How to monitor the blockchain for new blocks

I want to scan new transactions as they are added to the block chain. Does anyone have a suggestion on how to do this. Are there any APIs that allow for this? Or is there a way to directly tap into ...
user avatar
  • 31
2 votes
1 answer
1k views

Does a private key always generate the same public key and address?

It seems like depending on the method you get different public keys and addresses when using bitcoin-ruby with the same private key. I am probably doing something wrong, but I am not sure where it is.....
user avatar
  • 31
0 votes
1 answer
424 views

Bitcoin Testnet Trouble with bitcoin-ruby

I am having trouble with the bitcoin-ruby gem. I get the following error when trying to send money to another address I have on the test network: /var/lib/gems/2.2.0/gems/bitcoin-ruby-0.0.7/lib/...
user avatar
  • 31
0 votes
1 answer
2k views

converting RUBY script into PYTHON ( Recovering private key when someone uses the same k twice )

require 'ecdsa' public_key_hex = '02a50eb66887d03fe186b608f477d99bc7631c56e64bb3af7dc97e71b917c5b364' msghash1_hex = '01b125d18422cdfa7b153f5bcf5b01927cf59791d1d9810009c70cd37b14f4e6' msghash2_hex = '...
user avatar
  • 321
0 votes
1 answer
273 views

Sample proof of work in Ruby, what am I doing wrong?

Given the following block, how do I verify the proof of work? I got this data from bitcoin-cli getblock and parsed in to a Ruby hash called data: {"hash"=>"...
user avatar
2 votes
1 answer
572 views

OP_Return in transactions at json_rpc_api at blockchain.info

I am writing a project in Ruby using JSON-RPC to communicate with blockchain.info. The API is available here: https://blockchain.info/api/json_rpc_api Is it possible to create a op_return txout using ...
user avatar
  • 215
0 votes
1 answer
763 views

What does Bitpay's {"error": "Invalid token"} mean?

I'm creating a web app that uses Bitpay for payments. I'm writing it in ruby (but that shouldn't matter), and have a class method bitpay_client with the body BitPay::Client.new('mYs3cretAPIkey'). ...
user avatar