Questions tagged [ruby]
The ruby tag has no usage guidance.
27
questions
0
votes
2
answers
84
views
Command line generated address can't recover with seed phrase, what am I missing?
I have generated a bitcoin address using the following commands along with a ruby script for compression.
First I generate a key using echo "24 word seed phrase BIP 39" | openssl sha256
Then ...
1
vote
0
answers
2k
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 ...
1
vote
1
answer
442
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://...
1
vote
2
answers
395
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 ...
0
votes
1
answer
118
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
1
answer
526
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(...
-1
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 = :...
0
votes
1
answer
72
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
1
answer
77
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
2
answers
437
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
2
answers
249
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 = ...
3
votes
2
answers
5k
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
0
answers
113
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
0
answers
231
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
0
answers
197
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
0
answers
539
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
2
answers
592
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
1
answer
569
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
1
answer
537
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
1
answer
666
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
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 ...
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.....
0
votes
1
answer
446
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/...
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 = '...
0
votes
1
answer
288
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
1
answer
593
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
1
answer
810
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').
...