Questions tagged [ruby]
27 questions
3
votes
2 answers
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 limiting requests?
Or maybe should I run full…
bl0ck3d
- 81
- 1
- 5
2
votes
0 answers
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<
Pierre Michard
- 121
- 2
2
votes
1 answer
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://rpcuser:rpcpassword@publicIP:8332', 1.1
Operation timed…
Toshi
- 251
- 3
- 11
2
votes
1 answer
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...
I can generate a private key, public key, and…
Ethan
- 31
- 5
2
votes
1 answer
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 the given JSON-RPC API ?
fyquah95
- 215
- 1
- 2
- 6
1
vote
2 answers
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 throwing an error:
Error: Invalid signature…
Shubham Chadokar
- 113
- 6
1
vote
1 answer
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('1GzqkR2zNQUzHLpE7PLPjVNJ51FHC3bpDH') }
end
I'm…
yegor256
- 162
- 8
1
vote
0 answers
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, comodorsadomainvalidationsecureserverca.crt,…
minus1
- 123
- 4
1
vote
0 answers
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, signature)
return false unless…
Eka
- 11
- 2
1
vote
0 answers
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…
nateless
- 33
- 4
1
vote
2 answers
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 the program though that. I would like to be able…
Pabi
- 111
- 2
1
vote
0 answers
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 Crystal code that works very well for a 256-bit seed I…
q9f
- 1,444
- 3
- 22
- 46
1
vote
1 answer
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…
jblanche
- 71
- 4
0
votes
1 answer
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 how? I posted a GitHub ticket too.
yegor256
- 162
- 8
0
votes
1 answer
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 version- Ubuntu 16.04 LTS
*Bitcoin Core version-…
Rubz
- 5
- 2