Bitcore = “Error: More than one instance of bitcore-lib found”

These two lines (and nothing more), create an error:

var exp = require('bitcore-explorers');
var btc = require('bitcore-lib');

Error: More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.

I could see that this issue has been documented here, as well as here, and here. I read these pages, but I am still unable to overcome the issue.

Can someone please help? How do you do when trying to import different modules of bitcore?

rpc cookie authentication

I am getting a message when I start bitcoind :

Config options rpcuser and rpcpassword will soon be deprecated. Locally-run instances may remove rpcuser to use cookie-based auth, or may be replaced with rpcauth. Please see share/rpcuser for rpcauth auth generation

What is cookie based auth and how can I use it ?

Thanks

Bitcoin investment vehicles

I’ve heard of at least 2 financial products which enable people to take positions on bitcoin in the stock market. Here’s a Reuter’s article on one. Can anyone explain what the purpose of these investment vehicles is? Why would someone want to pay a financial institution ~2%/year to hold their bitcoin for them? Not to mention the counterparty risk…

“By listing the ETI on the Gibraltar Stock Exchange, which is an EU-regulated market, we are able to bring a high level of transparency and liquidity to investors”, said Revoltura CEO Ransu Salovaara.

Transparency? How is an opaque financial product – which may or may not be backed by actual bitcoin – going to provide more transparency than trades on a public blockchain?

Is this simply a money grab to exploit the people who don’t have a clue or am I missing something?

Open-source blockchain explorer for regtest mode

I’m trying to find an open-source Bitcoin blockchain explorer that will work in regtest mode, so I can more easily inspect the blockchain, see what transactions are getting processed and included, etc.

I found the following ones, but all of them seem to have issues:

  • blockcypher is “not easily compatible with running your own version locally, and this is no longer recommended (except for expert users).”
  • bitcoinchain is not open-source AFAICT.
  • Bitcore’s insight-ui [1], [2], [3] does not work with bitcoind AFAICT.
  • toshi does not work with bitcoind AFAICT. Not sure how to set it up in regtest mode to connect to another bitcoind full node.
  • bitcoin-abe does not seem to support regtest mode, though it could be as easy as adding a new Abe/Chain/Regtest.py file.
  • blockchain.info: can’t really tell if the My-Wallet-V3-* repos [1], [2] are for the block explorer website or for the wallet-management side of the website.

So, any suggestions for an easy-to-setup blockchain explorer that works with a local bitcoind node ?

The randomness of vanitygen is secure enough?

If two people running vanitygen 1abcdefg What is the chance that both of the person will get the same public key & private key?

I hope that the answer is less than 0.0000001. But for this vanigygen need to use random algorithm (not simple while(true){ i++; test()}).

My question is: Usually when I create wallet, using http://bitaddress.org I need to Move your mouse around to add some extra randomness, but vanitgygen do not do this method.

By inspecting the code of vanitygen in GitHub I see that they use random functions. Can I trust it? Is it really random? How it can be secure? Is it use the machine time or what?

How can I sign transaction hex with Python library

I have a unsigned transaction hex. Now I want to sign this transaction input with my private key in Python. Are there any Python libraries?

Transaction Hex

010000000414ae2264cdbe754b9ae4be18d84bfeb4f578af553b9b9e4f9cb2303d04ee9e45000000001976a91458b6e991b45487df810f4d96d5315da739637f1788acffffffffec15d27b74516fefd921cecbe043ea63124d28a3903aef8fb1682ccc926b1c62000000001976a91458b6e991b45487df810f4d96d5315da739637f1788acffffffff9878f76e1424c1d1eeb6b15d06902dd8f0c78f9bdb61263e4ca3ae68c571a292000000001976a91458b6e991b45487df810f4d96d5315da739637f1788acfffffffffdac7f1c83b01a8924a8965d356b804c2608bc261fc18041116ddb4a143bc499000000001976a91458b6e991b45487df810f4d96d5315da739637f1788acffffffff0336150000000000001976a9141485d9d03b41aaa9dca7d70d7f63ff4a0826100e88ac00000000000000001e6a1c246698efc5d81b78ceadf3179316b5eb6cc5c2c347c0b7b42121a94e92180000000000001976a91458b6e991b45487df810f4d96d5315da739637f1788ac00000000

Decoded Transaction

{
   "txid":"6c521937d8fa889d71609ebed2e23b694cbca89778c8b8d967167e5a4c9d5b78",
   "size":381,
   "version":1,
   "locktime":0,
   "vin":[
      {
         "txid":"459eee043d30b29c4f9e9b3b55af78f5b4fe4bd818bee49a4b75becd6422ae14",
         "vout":0,
         "scriptSig":{
            "asm":"OP_DUP OP_HASH160 58b6e991b45487df810f4d96d5315da739637f17 OP_EQUALVERIFY OP_CHECKSIG",
            "hex":"76a91458b6e991b45487df810f4d96d5315da739637f1788ac"
         },
         "sequence":4294967295
      },
      {
         "txid":"621c6b92cc2c68b18fef3a90a3284d1263ea43e0cbce21d9ef6f51747bd215ec",
         "vout":0,
         "scriptSig":{
            "asm":"OP_DUP OP_HASH160 58b6e991b45487df810f4d96d5315da739637f17 OP_EQUALVERIFY OP_CHECKSIG",
            "hex":"76a91458b6e991b45487df810f4d96d5315da739637f1788ac"
         },
         "sequence":4294967295
      },
      {
         "txid":"92a271c568aea34c3e2661db9b8fc7f0d82d90065db1b6eed1c124146ef77898",
         "vout":0,
         "scriptSig":{
            "asm":"OP_DUP OP_HASH160 58b6e991b45487df810f4d96d5315da739637f17 OP_EQUALVERIFY OP_CHECKSIG",
            "hex":"76a91458b6e991b45487df810f4d96d5315da739637f1788ac"
         },
         "sequence":4294967295
      },
      {
         "txid":"99c43b144adb6d114180c11f26bc08264c806b355d96a824891ab0831c7facfd",
         "vout":0,
         "scriptSig":{
            "asm":"OP_DUP OP_HASH160 58b6e991b45487df810f4d96d5315da739637f17 OP_EQUALVERIFY OP_CHECKSIG",
            "hex":"76a91458b6e991b45487df810f4d96d5315da739637f1788ac"
         },
         "sequence":4294967295
      }
   ],
   "vout":[
      {
         "value":5.43e-5,
         "n":0,
         "scriptPubKey":{
            "asm":"OP_DUP OP_HASH160 1485d9d03b41aaa9dca7d70d7f63ff4a0826100e OP_EQUALVERIFY OP_CHECKSIG",
            "hex":"76a9141485d9d03b41aaa9dca7d70d7f63ff4a0826100e88ac",
            "reqSigs":1,
            "type":"pubkeyhash",
            "addresses":[
               "12sWrxRY7E7Nhmuyjbz4TtGE9jRewGqEZD"
            ]
         }
      },
      {
         "value":0,
         "n":1,
         "scriptPubKey":{
            "asm":"OP_RETURN 246698efc5d81b78ceadf3179316b5eb6cc5c2c347c0b7b42121a94e",
            "hex":"6a1c246698efc5d81b78ceadf3179316b5eb6cc5c2c347c0b7b42121a94e",
            "type":"nulldata"
         }
      },
      {
         "value":6.29e-5,
         "n":2,
         "scriptPubKey":{
            "asm":"OP_DUP OP_HASH160 58b6e991b45487df810f4d96d5315da739637f17 OP_EQUALVERIFY OP_CHECKSIG",
            "hex":"76a91458b6e991b45487df810f4d96d5315da739637f1788ac",
            "reqSigs":1,
            "type":"pubkeyhash",
            "addresses":[
               "1965areciqapsuL2hsia2yKkRLfAsH1smG"
            ]
         }
      }
   ]
}

Update 1

Solved thanks to hartmut.

1 Install pybitcointools

git clone https://github.com/vbuterin/pybitcointools.git
cd pybitcointools
sudo python setup.py # I got an error in Python3. So I used Python2.

2 Sign by using pybitcointools

import bitcoin

def signAllIns(aTx, priv, nbIns=None):
    signedTx = aTx
    utxo = nbIns
    if utxo == None:
        utxo = len(bitcoin.unspent(bitcoin.privtoaddr(priv)))
    for i in range(utxo):
        signedTx = bitcoin.sign(signedTx, i, priv)
    return signedTx

deserializeHex = bitcoin.deserialize(HEX)
ins = deserializeHex['ins']
signedTx = signAllIns(HEX, PRIVATE_KEY, len(ins))

# Broadcast signedTx here

Bitcoin system with payins and payouts using bip32

I want to build an automated system, that can accept payments from users in bitcoin and can make payouts to addresses, specified by users, as well.

BIP32 says, that the best way to accept payments is to use HD wallets. But what about payouts? How can I make payouts using funds from account’s external chain addresses with received funds and not introduce security leaks?

Attaching additional data / text message to a Bitcoin transaction?

I’m building an single page web app, where I need to send the users inputted string (email address) along with their bitcoin payment. Say for example I have a single page web app that issues gift certificate barcodes and accept Bitcoin or altcoins. The problem I’m having is that if the user pays to my static bitcoin address, how do I know where to send the barcode information to? I need some form of contact, in my case it’s an email address that the user inputs on to the page. What ways can the user send me their email address?

Some problems I ran into was the static bitcoin address. If multiple people paid to the same bitcoin address, I won’t know who to send the barcode to. But if I have 100 pre-generated addresses. And one of them was chosen at random then combined with the email address. It would less likely have a collision of someone paying at the same time to the same btc address.

Now the issues is getting that email+btc address to me to verify the transaction has been completed.

One of the other solutions I came up with was requiring another altcoin that had messaging ability built in. The only 2 I know of is Florincoin and NXT where you can include a message with each transaction. The only issue with this is that it requires the app owner to hold florincoin or nxt (i don’t believe you can attach a message in ethereum?). Using shapeshift to convert BTC to one of these coins works, but you cannot attach a message during this shapeshift swap. If shapeshift enabled the ability to also attach a message during their conversion this would technically solve the issue by getting the email address to the app owner.

What are some other solutions that might not require a centralized server to collect this data? Centralized server solutions are okay too if you have a solution.

How to denouce a scam exchange?

I was scammed by an exchange called BitNake. It is referenced in the Bitcoin Wiki as a fast and secure exchange seeded in Germany. I could not find any negative comments on the web and decided to try it. I paid the minimum amount but never got any Bitcoin deposited in my wallet. Repeated e-mails to the support address went unanswered.

As it turns out, the BitNake website seems to have been created just last month and is actually installed in California. I guess I am one of the first to fall for this.

The question then is: how do I tell the world this website is a scam? So that others do not fall for it too.

Update I: here is the scam report at CoinTalk.

Update II: BitNake had been previously reported as a scam. However the search engine I use, DuckDuckGo, seems to be blind to BitcoinTalk. Another interesting aspect in this story is PayPal actively protecting the scammer.