Questions tagged [ruby]

The tag has no usage guidance.

0
votes
1answer
58 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 ...
1
vote
1answer
37 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(...
0
votes
1answer
1k 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 = :...
0
votes
1answer
31 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 ...
0
votes
1answer
49 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:...
0
votes
2answers
247 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 = :...
0
votes
2answers
140 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 = ...
2
votes
2answers
3k 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 ...
1
vote
0answers
95 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, ...
1
vote
0answers
189 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, ...
2
votes
0answers
151 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 ...
1
vote
0answers
393 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: ...
1
vote
2answers
431 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 ...
2
votes
1answer
369 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://...
0
votes
1answer
499 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 ...
0
votes
1answer
596 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 ...
0
votes
3answers
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 ...
2
votes
1answer
871 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.....
0
votes
1answer
338 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/...
-1
votes
1answer
894 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 = '...
0
votes
1answer
224 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"=>"...
2
votes
1answer
488 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 ...
0
votes
1answer
589 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'). ...