texts: Fastest way to generate millions of public keys from private keys (Python/C#)

texts:
I have run into a problem when trying to generate public keys from my mnemonics via privatekeys. The mnemonic -> privkey is fairly fast. Although when deriving the m/44./0./0./0/0 public adress it takes about a 1.2s, which is way too slow. I first thought this was typical for the hasing functions, but when generating privatekeys online I see that one can generate 20-30 publickeys per seconds on a simple web-script.

Do anyone have a solution or could point me in the right direction on how to do this? I have a text-document with a couple of million privkeys to go through and would appreciate all help.

Br


texts: Disable update of blocks locally with bitcoind cmdline option

texts:
I'm using blockchain2graph tool to import the Bitcoin blockchain into Neo4j. It uses JSONRPC calls to read block data. For this, I have to have the bitcoind service running. Is it possible to disable the update of the blockchain while bitcoind is running?

I use the cmdline and I've tried -proxy=127.0.0.1:1234 and -debugexclude=proxy options but it continuously outputs connect() to 127.0.0.1:1234 failed after select(): Connection refused. I don't want this output either.


texts: I don't have my 12 word question but I do have my PIN and my computers MAC address

texts:
I have been using my Hivewallet on my laptop for over 3 months and not once has it asked me for my 12 security words. In the past I figured it had picked up my MAC address because all it ever asked for was my PIN. I recently had problem and all my newer folders have been destroyed and cannot be taken.

I was hoping there would be a way I could still get into my folder. It has about $500-$550 worth of bitcoins and I did nothing wrong. I know everything that went on - even $750 worth or BTC that was taken only hours before the $500 of BTC was sent.


texts: Miner username and password - does it need to be unique in the major pools?

texts: Every Bitcoin mining pool relies on Basic Access Authentication to identify the user and credit their account for the work performed. But does this identification in form of username and password have to be unique for each separate machine that performs the mining? How is that problem addressed by the major pools?


texts: Does the satoshi client always send the change of a transaction to a newely generated address?

texts:
Experimentally, this seems to be the case, but is it always like this or depends on some details?
Also, does it generate a new address each time this is done, or first searches the wallet if there is an empty address there already? (And uses that in that case)
Is it likely that this behaviour will change in a later version of the satoshi client?


texts:
I created a coin (hexco.in)

The problem now is, sometimes some user create pools and use rented mining rigs to mine on my coin. But after a while they stop and my blockchain stucks at a certain block.

My question now is, how can I solve this problem? I only have a homserver and a raspi2 running as mining service 24/7 for my coin and a seednode running 24/7.


texts: Why are ardor transactions called via the api not in chronological order by timestamp?

texts: When retrieving data from the Ardor api, why is the data returned not in chronological order?


texts: Is there supposed to be a Chain 1 here also?  My other miner has Chains 1 - 4.  If so, any troubleshooting steps or way to buy new part?  Thanks! :)


texts: A friend owes me cash, how can he pay that debt in btc?

texts: A friend owes me some money and we agreed to settle that debt in bitcoins. How can he transfer some bitcoins to my account, without me having to pay him for it?


texts: Are there multiple representations of the same target value? Are they interchangable?

texts:
The block target in Bitcoin is encoded in block headers as a 24 bit integer raised to an 8 bit exponent:

int(nBits[1:4]) * 2 ** (8 * (int(nBits[0]) - 3))

Are there multiple nBits representations of the same target value? Are they interchangeable? That is, could a miner choose any of them?


texts: How to obtain the content of the field "addr_tag_link" and "addr_tag" without using the api of blockchain.info?

texts:
This is an output item of JSON result obtained by the API of blockchain.info:

        {
         "addr_tag_link":"https:\/\/bitcointalk.org\/index.php?action=profile;u=47767",
         "addr_tag":"DoubleIcaras",
         "spent":true,
         "tx_index":2751327,
         "type":0,
         "addr":"1F6MCoBMwmfpT5fruvCUjirFEybhLe5c1C",
         "value":100000,
         "n":250,
         "script":"76a9149a94b4a9d14807579aa4f9bd3d6a812adb6f7fbf88ac"
      }

Is it possible to obtain the content of the field "addr_tag_link" and "addr_tag" in java without using the API of blockchain.info (such as with bitcoinj)?


texts:
AttackerAlice has a BTC Wallet with 0 BTC.
AccompliceBob has a BTC Wallet.

Is it possible to transfer 100 BTC from AttackerAlice to AccompliceBob?

Suppose a BadMiner accepted this as a valid transaction, and puts this fake transaction into a block, how will it be detected and rejected?


texts: What is the name of the procedure of downloading and checking the ledger for a new node?

texts:
When a new node connects for the first time to the Bitcoin network, it first needs to determine what is in the ledger, and what is not. As far as I understood, it does so by connecting to the Bitcoin overlay network, downloading the blockchain and checking all the proofs of work. In case of multiple blockchains found, it just selects the longest and commits its transactions on top of that one.

Now, I wonder: does this process have a name? The process to start from scratch and determine what the state of the ledger is? I usually call it bootstrap but I am not sure whether or not it is the correct term to use.


texts: Sending bitcoin unconfirmed, now wallet balance is unconfirmed

texts:
I am using Multibit HD 0.4.1. I was trying to send 0.5 bitcoin, but it seems to be unconfirmed for an hour.
I tried repairing my wallet, thinking that was the issue, but now my previous balance became unconfirmed! I had about $340 in my balance but now it says $0, with $340 unconfirmed. Will the balance be confirmed once the sending transaction is confirmed? This is time sensitive, so I need to resolve this issue quickly.


texts: Hi all I have a Bitcoin deposit that stuck I just noticed it has a low mining fee is there anyway to push this or anything I’ve been waiting a few days now


texts: How does Bitcoin Core's Coin Selection prevent change to be a dust output?

texts: Bitcoin Core's Coin Selection optimizes for minimal change outputs. How does Bitcoin Core prevent Change outputs of sizes below dust threshold from occurring?


texts:
I am trying to mine Bitcoin on my CPU in Windows Server 2008 R2 Datacenter. I know about the consequences of CPU-only mining. I have downloaded GUIMiner - title bar looks like this:

However, when I configure it (more info below) and hit 'Start mining!', nothing happens - bottom bar looks like this:

My Setup

Miner: Ufasoft CPU miner

Other Info:

If anyone can help get this working, it would be much appreciated!


texts: Differences and similarities between Paymium, Mt.Gox,BitInstant and other major players, cryptocoins ?

texts:
I start exploring the Bitcoin world and I get confused concerning :

who does what,
different cryptocoins available,

Any specific advantage to use one ? for example, no limit for transfer, low fee,...

In addition, it seems that Mt.Gox is a strong player but there is not challenger in this new growing business ?

Thanks for your help to clarify the basics !


texts: Where does the mining reward in regtest go?

texts: After using the bitcoind -regtest generate 1 command, where does the mining reward go? I tried list accounts and check balance for account "", but the balance always showed 0.000000.


texts: How to find out as soon as possible about a transaction to my payment address?

texts:
I'm running an online store. I added the option to pay using bitcoin, using Mycelium Gear.

Gear can be configured to wait for 0-6 confirmations and up to 48*60*60 seconds from the moment the payment address was generated for a transaction to be paid/confirmed.

There are three potentially interesting moments in the life of a transaction when someone might like to be notified:

A transaction with an output that is being watched has been transmitted on the p2p network.
The transaction has been included in a block.
The transaction is fully confirmed (is 6 blocks deep).

With regular bitcoins, I see that when I configure gear to wait for 6 confirmations and 24h, Gear sends two notifications. One for event #2 (transaction included in block) and one for event #3 (transaction confirmed).

With testnet, when configured the same way it behaves the same way, only the testnet blocks are tiny and sometimes happen frequently. But when configured to not wait for confirmation (and only wait for 15 minutes), Gear sends a single notification, after event #1 (transaction transmitted).

What I actually want is to be notified as soon as possible after the customer has transmitted a transaction (event #1), and be notified within minutes of the transaction being fully confirmed (event #3).

If no transaction was transmitted within the first 15 minutes, consider the order abandoned (and the payment address eligible for reuse).

I think what I want is reasonable. But I don't see how to get it from Gear.

Is there a way to get this from Mycelium Gear? If not, is there an alternative service that does the same thing Gear does, but can send the two notifications I need (event #1 and event #3)?

Alternatively, how do other people do it, without using coinbase/braintree/bitpay and without running a full node client on the server?

My best idea currently is to configure Gear to not wait for confirmation to get the first notification, and then follow up the transaction manually using some blockchain explorer API to find out whether it got included in a block and how many blocks deep, until it's fully confirmed and then I can generate the second notification. But if I have to use a second service (some kind of blockchain exploration API), Gear will be a disappointment.


texts: Is Bitcoin Classic binary-compatible with Bitcoin Core?

texts:
I have three full-nodes running Core 0.12.0 that I'm considering moving over to Classic.

Am I right in thinking that Classic is binary-compatible with an existing blockchain download?

Would I be able to just uninstall bitcoind from the Core PPA and install it again using the Classic PPA?


texts: which is the relationship between ouput adresses and their value in a specific transaction?

texts:
Some days ago, I write a program to extract output addresses and its value in tx messages of a sample bitcoin pcap.
extracted addresses are all valid and we can find them in block explorers.

after that, just for testing, I send a specific value from one wallet to another wallet and capture all input/output packets during this transfer.

When I test my program with this sample traffic, some addresses and values are generated, one of those addresses was my own address and its value was the same value which I transferred, but some other addresses are generated which are all valid addresses and valid values but I don't know their value.

I guess that these values are UTXOs, but how I can sure about that?
Also, I see same value and same address which i sent in my wallet, in multiple packets with different source and destination IP addresses. for example I send A bitcoin from one wallet to another one, and beside that B bitcoin sent to


texts: How to withdraw cash from blockchain wallet

texts: Is exchanging bitcoins with money from other people the only way I can withdraw my money into my bank account??if there is another way please lead me


texts: How do BTC payments work at real-world shops?

texts: At CoinMap, I can find several coffee- and other brick-and-mortar shops that apparently accept bitcoin payments. How do these transactions work? Do I have to stand at the counter for 10 minutes and wait until transaction gets confirmed, do they use some kind of trick to make the transaction time bearable?


texts:
Let's say I have this scenario:

a customer has a bitcoin wallet. He/she shares the public key with a website. The website is a payment processor which lets the customer accept bitcoin payments.

The website generates a new address (based on the customer public key and a nonce) and watches the address for incoming transactions. Is this sufficient for the customer to see a balance increase on his/her wallet?

The customer wallet never sees the nonce so probably something is wrong in my reasoning.

What am I missing here?


texts: Can I reuse blockchain/index files with multiple wallets?

texts:
With the bitcoin-qt client, I'd like to have multiple wallets use a single set of blockchain data files.

Why? Downloading a fresh copy of the blockchain can take days, and each copy of the blockchain seems to be ~ 5GB large.  This feels somewhat wasteful if coins are spread about multiple wallets.

Note: I do not want to run multiple instances of bitcoin-qt simultaneously as I'm sure this would result in a bad time.

I was hoping this could be accomplished using the -datadirs option and symlinking blkindex.dat and blk000X.dat files to a central location.  But it seems like I'd have to create new symlinks in each datadir everytime a new blk000X.dat gets created :(


texts: When using the lightning network, do you have to lock or deposit your coins somewhere?

texts:
Trying to understand the lightning network some more. When using this new 2nd layer on top of bitcoin.

Do you lock your bitcoins on the lightning network so you can get "pegged" equivalent bitcoin tokens in the lightning network?
If these coins are locked and you sent half your coins to another user, now that person has a claim of 50% of your coins from your "locked" coins. So doesn't this mean its the same as depositing your coins into a 3rd party (lightning network) and letting that party deal with the transactions?


texts:
According to http://bravenewcoin.com/news/number-of-bitcoin-miners-far-higher-than-popular-estimates/ there are 100,000 miners and blockchain.info claims a hashrate of 1.42 EH/s.

How is it possible to be mining on Bitcoin at a hashrate of 1.42 EH/s with just 100,000 miners?

That would yield 14.2 TH/s per miner, while best ASICs are performing around 1 TH/s https://en.bitcoin.it/wiki/Mining_hardware_comparison


texts: 5 GH/s Bitcoin Miner from Butterfly Labs can mine Litecoin?

texts:
I was wondering buy this ASIC miner of 5GH/s to mine Litecoin.

I want know, can I mine Litecoin with this powerful tool? If not, there any ASIC miner's that can mine Litecoin?


texts: What's the easiest way to someone to double-spend 0-confirmation transactions?

texts: I heard there is a desktop app today that 'easily double spends 0-conf tx'. Which is it? Is anyone working on a mobile version of this app?


texts:
I know that the very early version of the Bitcoin code had a lot of advanced features, and was already very mature.

But Segwit (storing signatures separately from the transactions in the block) is a very simple change, and so obvious that I'm sure it must have passed Satoshi's mind many times.

So I'm wondering: what could be a reason that Satoshi choose to store the signatures inside the transaction? There is always the possibility that he just made a stupid mistake in the design, but I find that hard to believe.


texts: Is there anywhere I can find detailed LTC historical trade data? BTC-E's API is not well documented and I can only find a live tick API from them. I found historical data on Cryptocoin Charts but the data they output is not very detailed.


texts: added security/safety to multiple blockchain.info wallets

texts: If I want to store a substantial number of Bitcoins, would there be any add security or safety to doing this in multiple blockchain.info hybrid ewallets, in stead of all in one?


texts: Problems decrypting my bitcoin-wallet on android

texts:
So I dropped my phone in the toilet... Of course I immediately turned it off and went with the rice technique. I realized later that I had coins on my phone on the bitcoin-wallet on android . Luckily, i was able to turn the phone back on after a day and the first thing I attempted on doing was backup my wallet. I used the back up function and was prompted to enter a password to encrypt with. I did. Then I wanted to decrypt the password (to prove in case of emergency that I could).

openssl enc -d -aes-256-cbc -a -in <filename>

When trying this I'm asked for the password, which I give. Then I'm given a bunch of garbage.
I have found that I'm using version 3.53  . Thanks in advance for the help.


texts: Adding «Donate» Bitcoin button in README.md file GitHub repository

texts:
1. Summary

I would like to add a «Donate» Bitcoin button on my README.md file located on my GitHub repository.

2. Not helped

2.1. Manually button

HTML-code using bitcoin protocol:

It's work on HTML page of my GitHub Pages site, demonstration.

But in .md GitHub files not one codes of Meta Stack Exchange answer not work for bitcoin protocol, demonstration.

[**![Bitcoin Donate Button**](https://www.drupal.org/files/project-images/bitcoindonate.png)](bitcoin:1DF9jgzftTFn4ZnDV2YEjUtZ3uHtBywj57?label=In%20the%20treatment%20of%20Sasha's%20teeth&amp;amount=0.0037)

![Bitcoin Donate Button](https://www.drupal.org/files/project-images/bitcoindonate.png)

2.2. Third-party

JavaScript not supported on GitHub README.md pages. By this reason doesn't help me:

Bitcoinate
Bitcoin donate
Leo Bogert simple button


texts: How does BitCoin prevent fraud during confirmation period?

texts:
I'm trying my best to understand how bitcoin works and while I've grasped the basics, there's a lingering question:

What's to stop me from spending my bitcoin multiple times during a confirmation period?

Let's say I have a single address that owns 1 BTC. I go to a cafe and use the coin (assume the whole coin for simplicity) to buy a cup of coffee. The transaction is broadcast across the network. The miners then compete with one another to include my transaction in a verified multi-transaction block that will be submitted to the block chain. That process takes around ten minutes. During that ten minute period, I walk to the gas station and reuse my 1 BTC to buy some gas. How could the gas station know that I had already used my 1 BTC to buy coffee a few minutes earlier and my actual balance is zero, since the coffee transaction isn't yet part of the official block chain?

In the end, one of these two transactions will most certainly get rejected by the Bitcoin network but either the cafe or the gas station will get stiffed, correct? It seems the only solution would be for the cafe to wait ten minutes for the confirmation prior to giving me my coffee -- but that's obviously not a practical approach.

What am I missing?


texts: What version of C++ is used in Bitcoin Core?

texts:
I can't find the information on which C++ version is being currently used in bitcoin core project?
Is it decided for future releases somehow? How does the situation looks now?
The only thing I could find was Pieter Wuille's comment:

Bitcoin Core is switching to C++11 in the upcoming 0.13 release. Meanwhile, C++14 is already standardized and C++17 is well underway. Stating that Bitcoin Core always uses the latest features seems like a strange statement.

It may look like some XY problem, so the reason I am asking is my GF is long time C++ dev and I am looking for resources to learn C++ to be able to understand bitcoin code. Her first question was which C++ version it's written in, as it supposedly doesn't make sense to learn older versions.


texts: Is there any way to make a transaction invalid if it is not confirmed before a certain block?

texts:
It seems like it would be useful to avoid replay attacks if your wallet could specify that a transaction must be confirmed before say the (current+100)th block before broadcasting it

I guess there could be a problem with this scheme if the tx was no longer able to be included into a block after a reorg (esp for dependent txs)


texts: Bitcoind running on external HDD trying to resolve cookie from default datadir

texts:
On Elementary OS Loki 0.4.1 I've downloaded and installed bitcoind as per the official guide from bitcoin.org .

However, I in my case I don't have enough space on my internal SSD to store the whole blockchain, so I want to download it and maintain it on an external hooked up HDD.

When I run the bitcoind -daemon -datadir=path_to_external_hdd_folder the Bitcoin server starts up successfully and starts downloading the blockchain to that specified folder (In the logs I can see the height is growing and so is the size of the selected datadir which I passed in as an argument)

My problem is - when I try to run commands by running bitcoin-cli getblockchaininfo for example, I get the error:

error: Could not locate RPC credentials. No authentication cookie could be found, and no rpcpassword is set in the configuration file (/home/martin/.bitcoin/bitcoin.conf)

What's weird is that when I move the .cookie file from my external drive to /home/martin/.bitcoin/bitcoin.conf the commands start working.

This is a temporary solution though, I wouldn't like to move that file everytime I startup the bitcoin server.

Do I maybe need to pass in an extra argument to bitcoind -daemon?

I've tried passing -rpccookiefile=path_to_cookie_file_on_External_hdd to it but that didn't work.

Note: My bitcoin.conf file is empty.

UPDATE 1
I tried setting -conf when starting bitcoind but that didn't work either.


texts: Bitcoin Core LevelDB Index saves forked blocks

texts: I've noticed that bitcoind will permanently save unverified blocks that it receives even if they turn out to be small blockchain forks, likely occurring from the relatively simultaneous discovery of two blocks of equal height. This doesn't cause a problem for Bitcoin Core's functionality, as there is surely a process written into the source that ignores such small forks, however, it's curious to me that the data persists in the data saved to the .dat and .ldb files in .bitcoin/blocks/ and .bitcoin/blocks/index nonetheless. Is there a way to prune these invalid blocks that belong to small forks in the blockchain without -reindexing the entire blockchain? Would -reindex even remove them?


texts: How to make Bitcoin-Qt or other client run off of a flash drive (Mac)

texts:
I work in an office with lots of computers, and I am on a different workstation every day. Is there a bitcoin client I can keep on a FireWire/USB drive?

Bitcoin-Qt on Mac leaves all the files in the home directory - the block chain, the wallet, etc. Someone else is going to be using this computer tomorrow! I want to keep all those files, and even the application itself, on a portable drive.


texts: Would a memory bound POW facilitate decentralization?

texts:
Today I was musing on the complaints that Bitcoin network is too energy greedy and centralized (let's not discuss if this is actually true) and the suggestions that memory bound POW would be improvement for both issues.

My thoughts are that:

regardless of POW mechanism the main cost of mining is operational cost, and operational cost is mostly energy; this is becomes even closer to true assessment as time goes by;
given the above, for the same price (which is mostly demand driven), the same operational costs would be justified, so the same (order of) energy will be spent;
I assume that memory bound hardware to be (much) more expensive than current ASICs (for the same value (as in mined coins) per input energy); this seems to work only for the benefit of HW vendors and increase the threshold for entry, thus working against the decentralization.

In the end (which means after some initial period - exemplified by the raise of ASICs for CPU POW) it seems that we end up with a network that costs roughly the same to the environment, but more centralized because of higher HW costs.

Does this reasoning make sense. Are some assumptions too speculative or outright false?


texts: AT what stage will the blockchain be pruned? With more update of bitcoins the blockchain will start growing exponentially making downloading thereof impractical.


texts: Should make things smoother and result in less oscillation. Is there a reason why retargetting is only every 2016 blocks?


texts:
I currently use a Ledger wallet and find it a hassle to plug it in every time I want to check my balance.

I have access to my master xpub key, how would I find out all the addresses corresponding to it? Is there any site that hosts this service and has an API?

I found a script online that does this, but it's written in PHP and is quite slow. I'm looking for something compatible with python.


texts:
Basically the idea was to create a tiny service such as nodecounter.com.

Now I would appreciate your help on the following questions:

How to determine the Software (Core, Classic, XT, etc.) and quantity on the whole network?
How to determine the last 1k blocks and their Miner Software?

I would start from scratch, but if you know about any open source projects, preferably in NodeJS or PHP, I would really appreciate a hint.


texts: Anyway I can track the guy behind the bitcoin address?

texts:
I have just got a mail from someone called Mike Demarinis  blackmailing me to ask me to send him money. I know it's a joke, because i have got various passwords for different things. The guy simply don't know me.

But is there anyway that i can track the guy, like IP or location and call the police?

I want to find out where this address is from: bc1qz5ufptmvfkm4cjegwrfhqypvzum56phznm5raf

The mail is pretty nasty and frightening


texts:
When I run a lightning node, I have to set up a lightning channel with, for example, a highly connected node.

Here a first question: When I set up a lightning channel with a node, have I need to put some bitcoins in it?

Then, if I wanted to buy something using lightning network (for example, a sticker from Blockstream), will I have to open another lightning channel with Blockcstream? Or the previously synced channel will be used to let me buy from Blockstream?

Thank you.


texts: What exactly does the "fraud management system" of blockchain checks?

texts:
Basically, we are webhosting company and accepting payments through Paypal and 2checkout currently.  Due to risk of service being used for spamming,we manually review orders after payment gateway verifies payment and card owner identity. Likewise, 2checkout verifies payer's identity and history of fraud/stolen card associated with it than mark payment as verified.

We want to start accepting bitcoin but as per my initial research I am afraid with the risk of misuse of service.I know the bitcoin's main advantage is that you don't need to provide any identification which is stopping me to add it as payment gateway.

As far as i researched, blockchain verifies transactions on the basis of # number of confirmations which is correct to legitimate the payment. I believe this verifies the source of bitcion and spendability of it.

Question : are there any other aspects in blockchain's "fraud management system" which can assure merchants that payer is legit?


texts: Can I send balances to Segwit address from non-segwit address?

texts:
I have some balance on my first exchange. It use 1~ address.

I'm trying to withdraw this balance to my Bitcoin Core's 3~ address.(Which is Segwit address, right? I made this by addwitnessaddress command)

Does this situation accepted?

Thanks!


texts: Eclair Lightning Node With Core Version 18

texts:
When attempting to open channels in lightning network I get the following error:

signrawtransaction was removed in v0.18. Clients should transition to signrawtransactionwith key and signrawtransactionwith wallet (code: -32)

I know that signrawtranaction was a deprecated RPC call in version 0.17 but could still be used. However it was removed in version 0.18. Is there a workaround for this this for Eclair v0.2-beta9?


texts: What is the format of the coinbase transaction?

texts: I'm trying to understand the format of the coinbase transaction. I've read that it is arbitrary and not specified. I'm wondering because I need to generate mining work and create an internal pool. As I've found out, you can change the ntime, nonce and extranonce fields. The last one should be suited in the coinbase parameter, right? So, can anyone help me analyze the content of the coinbase transaction and how am I supposed to build one, so all miners in my pool could have different headers for hashing? A step-by-step guide on an existing block would be much appreciated, links and other stuff too.


texts: How to change user permissions on the /blocks/ folder in linux?

texts:
I have three users on my linux system. root, daemonuser, and abeuser.

daemonuser runs bitcoind

abeuser runs ABE

I cannot seem to change the permission of my "blocks" folder so that abeuser can read from it.

I have tried placing the bitcoin data directory in the /opt/ folder and then running the command:

  chmod -R +r /opt/bitcoinBlockchain

with no luck.

/opt/bitcoinBlockchain/blocks is always locked to daemonuser and abeuser cannot read anything inside of it.


texts: Who is funding the Beam mimblewimble development team?

texts: Since there is no-premine with the Beam mimblewimble project. How and who are funding their development?


texts: ElectrumX server as a Tor hidden service

texts:
I am trying to run an ElectrumX server on my PC. I run it on a docker container with the following Dockerfile configuration:
FROM python:3.7-alpine3.11
LABEL maintainer="Luke Childs <lukechilds123@gmail.com>"

COPY ./bin /usr/local/bin
COPY ./VERSION /tmp

RUN VERSION=$(cat /tmp/VERSION) && \
    chmod a+x /usr/local/bin/* && \
    apk add --no-cache git build-base openssl && \
    apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.11/main leveldb-dev && \
    apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing rocksdb-dev && \
    pip install aiohttp pylru plyvel websockets python-rocksdb && \
    git clone -b $VERSION https://github.com/kyuupichan/electrumx.git && \
    cd electrumx && \
    python setup.py install && \
    apk del git build-base && \
    rm -rf /tmp/*

VOLUME ["/data"]
ENV HOME /data
ENV ALLOW_ROOT 1
ENV DB_DIRECTORY /data
ENV SERVICES=tcp://:50001,ssl://:50002,wss://:50004,rpc://0.0.0.0:8000
ENV SSL_CERTFILE ${DB_DIRECTORY}/electrumx.crt
ENV SSL_KEYFILE ${DB_DIRECTORY}/electrumx.key
ENV HOST ""
WORKDIR /data

EXPOSE 50001 50002 50004 8000

CMD ["init"]

I want to advertise the ElectrumX server as a Tor hidden server. My bitcoin-core is also reachable by an .onion address: j3zla562edof65jn.onion. How can I configure the ElectrumX hidden server? What will be the .onion address of the server? I cannot access the ElectrumX from my electrum client using j3zla562edof65jn.onion address. Also, the status of the server is Closed in the Servers list.
Many Thanks.


texts: Segwit transaction from mixed addresses (segwit and non-segwit)

texts:
Is it possible to have partly segwit transactions? I.e. some utxos from segwit addresses and some from non-segwit addresses.

Asking for the situation of Bitcoin core v0.15 wallet with coins in segwit and non-segwit addresses. If you send a transaction will it use one or both address types for the transaction?


texts: What would happen if PoW cost were drastically reduced or eliminated?

texts:
Assuming Bitcoin had a different method for selecting winning nodes and controlling block time creation, please describe step-by-step how the Bitcoin network would be vulnerable to various attacks. How would it play out?

Preferred format:

Bad Actor is selected as winning node
Bad Actor makes changes to an Old Block
Bad Actor re-hashes affected block segments, from Old Block to Last Block — (now possible due to low cost)
Bad Actor processes New Block

Please continue...


texts: Debugging Bitcoin Core with gdb - how to turn off compiler optimizations

texts:
I ran the configure script with the --enable-debug flag, then ran make. I am running unit tests:

gdb --args src/test/test_bitcoin --log_level=all --run_test=script_standard_tests

I'm trying to step through the execution of the source files using gdb, but I am still getting <optimized out> for many variables, and it skips lines here and there. I thought that the --enable-debug flag would turn off optimization, but am I mistaken? I'm wondering if the optimization is always on for the tests or if there is a way to turn them off.


texts: how does node create UTXO from blockchain for the first time?

texts:
Let's say I am a new node.
I try to synch with the full node to grab the whole blockchain. Now, I synced with it .It's time for my node to create UTXO database ..
How does it do this exactly so that it knows which one to put in UTXO database ? since it will need to know which one is unspent. By looking at the blockchain, it can't quickly figure out which one is unspent for the following Reason: 1st height block contains output which has 5btc sent to me. I only spend this in the 400,000th block. This kind of thing happens for every other output. So how does bitcoin build UTXO in an effective way ?
It would also be great if there could be any code from bitcoind or something so i can take a look. Couldn't find it myself.


texts:
In a reorg where a node receives blocks for a longer or equal-length chain than the chain they previously followed as longest, what is the process for that node to handle this situation?
I can imagine that in the situation the new chain is clearly longer, the node would have to revert its UTXO set to the point at which the chains diverged, add back mempool transactions that were used since the chains diverged, and then re validate all blocks in the new chain. I can also imagine that some work that was already done in validating transactions could be reused, but not all of it.
How is the UTXO set reverted? Do nodes maintain a history of UTXO set diffs?
In the case where the length of the chains are not significantly different, I can imagine that a node might want to maintain both chains concurrently until it becomes clear one will be longer. Are nodes programmed to do this?
What is the longest reorg a node can handle without revalidating the entire chain from the genesis block?
These questions are primarily about how the software is currently written, rather than about theoretical ways nodes could handle these cases.


texts: Someone want to mine with my bitcoin (www.elitecoinmine.com) Promises?

texts:
I just signed up to ask this Question. Shoort story about me: I don't know much about crypto currency, just spend 50Eur once to buy some Dash.

Anyway, there's a guy writing me via my instagram and then via whatsapp since almost a year, he always ask me to buy Bitcoin (about 150$ at least) and he will be my manager and www.elitecoinmine.com will be using my bc to mine, and he talks about very fast profit (in about 48 hours).
So I asked one of my close friends who is more into crpyto currency and he was lauginh about it, like "How can someone mine with your bc, thats rediculious".

Now I want to ask you guys, is it even possible that someone mine with my bc?? or is this a bad joke at all, i can see that i might rent some equipment to do mining, which i would never do, but using my bc to mine??

He always talks about that they work with antminers S9 (whatever that means)

and yes it's all about www.elitecoinmine.com, if someone got some expirience please let me know, i'm very puzzled since I don't know that much about it.

Thanks in advance


texts: Can bitcoin pools set a different difficulty value other than the network difficulty

texts: I would like to know if bitcoin pools can give a different difficulty value other than the network difficulty or is the network difficulty the same for everybody


texts: Exchanging BTC (bitcoin) for LTC (litecoin)

texts:
How can I safely exchange BTC for LTC? I've found a website called Changelly. Does anyone have any experience with this website? Are there other websites/ways to safely exchange cryptocurrency?

I want to make sure that if send BTC to a specific person, then they'll send me the corresponding amount of LTC.


texts: In an LND node, what is the max size, in bytes, of a macaroon. If there is no explicit max length, what can you reasonably expect to be the size of your macaroon?


texts: Does a HD Wallet log my IP when i do a transaction?

texts: Companies like BitPay and Electrum, can log my IP when I make a transaction, right? If so, should I use a Web Wallet (plus VPN) for transactions?


texts: How were the transaction fees of 0.00011689 BTC calculated?


texts: Unconfirmed transaction - Non(e) standard input

texts:
A few hours ago, I created an offline transaction using the offline transaction tool available at:
https://www.strongcoin.com/downloads/offlineTransaction.zip

I coped and pasted the resulting transaction into the chain at:
http://blockchain.info/pushtx.

The transaction appears to be stuck. It has a high priority but also says "This transaction has a none standard input."

The transaction # is:
5826ae9e76e2edac733bf9633f5b13de3985dc8989d64ba1780e01d7eac76ee2

I did some googling around, but have found no definitive solution. In the meantime, I imported the private key of the sending address into a wallet at blockchain.info (not sure if this can help - it shows that I sent the bitcoins, but the transaction is unconfirmed.).

What should I do? If I wait a few days, will the transaction simple fail & the funds revert back to the sending address? Will sending a second transaction work (possibly after waiting a few day)?

I'm new to the bitcoin thing. I am pretty technical (part of the reason I went for an offline wallet to begin with), and thought I had a firm grasp of what I was doing. As it were, I should have played around more with smaller transactions.

Any suggestions would be very appreciated. Thanks!


texts:
I restarted my computer and now bitcoin doesnt go further than "verifying database integrity" and staying in until now (about an hour now) also windows tells me that the program isnt responding.

Anyone knows what to do ?


texts: Is a bitcoin address collision possible if generating 90 million addresses every 4 hours?

texts:
I am running a test to see if I can obtain a successful bitcoin address collision after generating billions of addresses. I am not entirely sure how I would check them yet. Basically I have an extra 10TB hard drive and am running supervanitygen on my 32-core, 128gb ram linux work computer. It seems to be generating about 90,000,000 (90 million) addresses (address + private key pair) every 4 hours.

Do you think it's possible or likely to run into an address collision this way? Or perhaps if everyone in the world did the same thing? Or what if I waited 10-20 years, and then checked the addresses?

This is all just a test to see if the bitcoin system is secure enough for big investment decision.


texts: Is writing unit tests a good way to start contributing to Bitcoin core?

texts: I'm considering writing unit tests to Bitcoin core as a first step to C++ development and Bitcoin contribution. Anyone have any suggestions about the journey I'm about to begin and possible files that are needing tests?


texts: I have accidentally sent LTC coin(Using Bitcoin ATM) to my BTC wallet(Luno wallet). I have not received the coins yet. how can i recover it back to my luno BTC wallet.


texts:
BIP-44 compliant HD wallet trees use the m/purpose'/coin_type'/ account'/change/address_index convention to derive private keys and associated addresses. For coin_type, BIP-44 makes a reference to registered coin types.  Will the Darkcoin index of 5 work for Dash?

Compressed DASH private WIF key (Darkcoin v0.6+ stores public keys in compressed format.):
% echo 'very complex gibberish' | bx base16-encode | bx sha256 | bx hd-new | bx hd-private -d -i 44 | bx hd-private -d -i 5 | bx hd-private -d -i 0 | bx hd-private -i 0 | bx hd-private -i 0 | bx hd-to-ec | sed 's/$/01/' | bx base58check-encode -v 204
XH2Yndjv6Ks3XEHGaSMDhUMTAMZTTWv5nEN958Y7VMyQXBCJVQmM

Compressed public address:
% echo 'very complex gibberish' | bx base16-encode | bx sha256 | bx hd-new | bx hd-private -d -i 44 | bx hd-private -d -i 5 | bx hd-private -d -i 0 | bx hd-private -i 0 | bx hd-private -i 0 | bx hd-to-ec | bx ec-to-public    | bx ec-to-address -v 76
Xb9HJy46M9u3SLAWVitS4eV6gEMuVFfZX2

Uncompressed DASH private WIF key:
% echo 'very complex gibberish' | bx base16-encode | bx sha256 | bx hd-new | bx hd-private -d -i 44 | bx hd-private -d -i 5 | bx hd-private -d -i 0 | bx hd-private -i 0 | bx hd-private -i 0 | bx hd-to-ec | bx base58check-encode -v 204
7rrHic4Nzr8iMSfaSFMSXvKgTb7Sw3FHwevGsnD2vYwU5btpXRT

Uncompressed public address:
% echo 'very complex gibberish' | bx base16-encode | bx sha256 | bx hd-new | bx hd-private -d -i 44 | bx hd-private -d -i 5 | bx hd-private -d -i 0 | bx hd-private -i 0 | bx hd-private -i 0 | bx hd-to-ec | bx ec-to-public -u | bx ec-to-address -v 76
XiEsuvDERQJT5S9RF7qcKGrm4omMsJ1PPg


texts: Does anyone know of any of the best Bitcoin Mining Software? I have been looking for mining software for a while, but I can't seem to find any. I'm using Windows 8 if that helps.


texts: Can i combine 2 devices to get more power for mining

texts:
As An example lets say i have 2 USB Miners each one has 16 GH/s
can i combine these 2 to mine with 32 GH/s ?

And if yes pls tell me how.


texts: P2Pool Hardfork 14.0 where and when is it decided?

texts:
I have read on here that hardforks are a point where the pool with the biggest stick gets to decide which course the blockchain will take. Has the hardfork only just begun? When is the fork ultimately decided and has this one already passed the decision of the largest pool? Are most pools based on P2Pool's open source code? Is P2Pool calling for a fork that may not ultimately happen? Or have they worked in code from the other side of a fork into their own code? Do pools gravitate to different standards or always generally find some consensus? This one has the word attack in the fine print. Is this a step to eliminating an exploit? Is there an attack that could exploit the weighting and timing of the share system?

How long does a fork last? How many coins have been lost to forks and is there a tally? Sorry I know, that's a lot of questions.


texts: What are the most historic code changes on bitcoin core?

texts:
I was looking through the pull requests on bitcoin core's github and was looking for some of the major changes to the code.

https://github.com/bitcoin/bitcoin/pulls?page=10&q=is%3Apr+is%3Aopen

The oldest one is from Feb 14, 2016 but I'm sure historically significant changes to the code were done since.

Any one know of any?

Does any one constantly (like everyday) review all commits outside of the bitcoin core team?


texts:
Block 364422 contains a transaction that takes a long time to verify. This transaction design demonstrates a way a denial of service attack could be executed. This prompted Gavin Andresen to propose additional limits to the protocol.

Gavin talks about this issue in this video.

Is it known who mined this particular block? What was their intention? Did they collude with the person who generated the transaction?


texts: How does the full lifecycle of a cryptocurrency trading look like?

texts:
I am new into cryptocurrencies and I am wondering how to trade them. By trading cryptocurrencies I mean:

Transfer fiat currency (ie. USD) from my bank account into some account that enables buying cryptocurrency.
Buy a cryptocurrency like BTC or ETH with fiat currency.
Transfer cryptocurrency back to USD.
Transfer USD back into bank account.

Is there one platform where I could accomplish this full lifecycle of a trade?

From my research I was able to create a cryptocurrency wallet with Atomic wallet. This app allows to transfer USD via credit card into the app and then trade USD with multiple crypto currencies. The fee for transferring USD to a crypto is 12% of the amount. Which does not make much sense for serious trading (I need to pay 112 USD for every 100 USD transferred to Atomic wallet). Are there cheaper ways to trade fiat to crypto?

Additionally, it is only half of the story.

Atomic does not allow to transfer crypto to fiat and send back to bank account. To accomplish this I need to create another account in currency exchange like Bitstamp or Coinbase and verify it with some documents. Then I can trade crypto to USD and finally back to bank account. I did not accomplish this step so I don't know what are the costs of transferring back to bank account.

Apart of this, I've found that some trading platforms, like Ledger Live require particular devices to be bought to be able to trade crypto. Making it useless for other wallet owners.

My question
- what are the most convenient (ideally one platform) and cost efficient ways of trading crypto for fiat and back?

I assume that at the moment there is no single platform that does this but at least two accounts are needed to trade. In this case what are best ones according to cost efficiency and market accessibility?


texts: gettransaction (The remote server returned an error: (500) Internal Server Error.)

texts:
Im trying to get how many confirmations a transaction has. However I just get error when I try to get gettransaction.

http://block-explorer.com/tx/e15e0edd6d6b07531c146a91528ba628b28d37acb28e6a271a563a2284092e16
GetBlock works fine with the transaction here.. also getrawtransaction works.

However when I try gettransaction I get this error.
The remote server returned an error: (500) Internal Server Error.

This is how my request looks like
{"id":"0","method":"gettransaction","params":["e15e0edd6d6b07531c146a91528ba628b28d37acb28e6a271a563a2284092e16"]}

Any ideas of what Im doing wrong here?


texts: On the upcoming potential Bitcoin fork on Aug 1, 2017. Bitcoin seems to be rising while every other coin is falling. Why?

texts: With the upcoming bitcoin fork on Aug 1, 2017. Why would all other coins be falling while Bitcoin is rising? Wouldn't one want to sell bitcoin to hide their coins in like LTC to weather the storm?


texts: Is transaction time correlated to block generation time

texts:
As I unterstood in other answers (see https://bitcoin.stackexchange.com/a/8922/74399), a transaction is added to the blockchain, once a new block has been found/generated.
The average time between two blocks is about 8 minutes regarding the past 24 hours.

Does this mean, that my transaction will take an average of 8 minutes to become visible in the blockchain?
Is it known in the network as an "unconfirmed transaction" (so it's save)?


texts: What is a bitcoin incoming transaction with value = 0.00000546?

texts:
I wrote a script that downloads and parses blocks. I see a lot of incoming payments with value = 0.00000546. Any explanation?

Thanks!


texts: Set fee limit for Lightning Close Channel

texts:
How does a Lightning Network channel initiator set a limit on the fee rate they are willing to accept for the channel close?
And a second question is how can the close fee be negotiated during a collaborative close?


texts: Bitcoin node generating invalid addresses

texts:
I'm running both a bitcoin and a litecoin node, both are generating invalid addresses.

My LTC generated address:
MV6eGvkbkgcDZLDpK1WQeZLMmx3PHZmXC7

My BTC generated address:
2MvuZyhhGHCUcFPHCEUNeBbGEKYJ5wpytjk

I'm generating them in the bitcoin-cli/litecoin-cli with getnewaddress

What am I doing wrong and how to fix it?


texts: Is there a way to access my BItcoins before Bitcoin qt syncs?

texts: I used QT to generate an address, and have received some coins, but they're not showing up because it hasn't synced yet. It looks like syncing will take 2 days. Can I access the coins before then? Maybe dumping the wallet and importing with another client?


texts: Would my ISP consider my Bitcoin client to be a server?

texts:
I was reading about Google's Fiber installations, with first deployment in Kansas City.  There's a controversy where the terms of service restricts what services can run on their Fiber network.

Some relevant items:

http://www.dslreports.com/shownews/Kansas-City-Google-Fiber-Rallies-Take-Off-Running-120594

"Can I run a server from my home?

Google Fiber is intended as a residential Internet service. Our Terms of Service prohibit running a server."

http://fiber.google.com/legal/network.html

Would running the bitcoin node on Google Fiber be considered to be a server, and thus prohibited?


texts:
How would a customer pay either the whole bill, or just the tip in Bitcoin?

What technology is best suited for this? (pay by barcode)

Must the waiter have an iPhone wallet as well?

How would the restaurant associate payments to customers?


texts:
Is a miner just running a full node that is connected with the mining hardware? Or is there such thing as a miner node? Does it use additional software for transaction selection?

Thanks in advance!


texts: Can I claim my bitcoin gold if I have used my bitcoins few days ago?

texts: I had my bitcoins on blockchain.info when the fork happened. A few days ago I sold my bitcoins. Now I am wondering if there is a way I can claim my bitcoin gold? Blockchain.info support has said I can export my private keys and get them but I have no idea on how to do it. Please guide. Thanks.


texts: If someone knows my bitcoin address, does this mean they can spend it or move it?

texts:
What if I wrote down or saved a file with the address on and someone found it, can they take my coins?
How secure is it?


texts: All else being equal which is better for the environment, Litecoin or Bitcoin?

texts: Does scrypt mining inherently confer any environmental benefit or energy efficiency for the same level of service provided?


texts: Litecoin - how to calculate the difficulty from 2^-N

texts:
In the following list I always see difficulty values like 2^-12
How to calculate the actual difficulty from it?

Comparison of mining pools


texts: Is there a "MtGox Live" alternative which supports Euro?

texts:
MtGox Live is a quite pretty live market depth graph.

For some reason it only shows prices in USD.

Does anyone know an equally good alternative which supports EUR instead?


texts:
I am trying to learn how to work with Bitcoin and the Lightning Network from a programming perspective.

I saw that bitcoin-core was using: https://bitcoin.org/en/developer-reference#bitcoin-core-apis in order to allow one to work with RPCs (or APIs).

Is there something similar for the Lightning Network? When using an API for the Lightning Network, would Authentication/Authorization be necessary?

TIA


texts: Does bitcoin deflate or does it appreciate?

texts:
How are these two terms related?

Bit Coin is obviously appreciating in value, but does that alone mean that the economy is deflationary? Or, is deflation and inflation a result of external pressures and not just the perceived value of the commodity?


texts: Unknown key format when importing Private Key from Multibit to Blockchain.info

texts:
I'm trying to import a Private Key from MultiBit into Blockchain.info, but get an error saying "Error importing private key: Unknown Key Format".

Is my MultiBit key in the wrong format or something?


texts: Is Bitcoin stateless? Do miners keep track of current 'state' of bitcoin blockchain?

texts:
In Ethereum or EOS, concept of Accounts make it important to keep track of 'current state'. (e.g.) current balance of Account A is 300 EOS.
Especially in Ethereum, roothash of state tree is stored in every block.

Bitcoin, on the other hand, doesn't care nor store information of current state. I know wallet applications gather block data and derive current balance of the user.

But my question is, do Bitcoin miners keep track of current 'state' of bitcoin blockchain?


texts: Have there been attempts at a Bitcoin-powered general purpose database?

texts:
https://en.bitcoin.it/wiki/Bitcoin-Powered_Database

As far I know, the Bitcoin blockchain is pretty much the only data structure that is both global and tamper-proof.

global - There is one global instance of the blockchain (up to forks ... which are then resolved).
tamper-proof - If a block enters the blockchain, after 6+ confirmations this block can't feasibly be faked or altered.

A Bitcoin-powered database would be an API over the blockchain, that would expose a subset of the usual CRUD database operations. In fact, it would be an append-only data structure, because nothing can ever be really deleted from the blockchain - so only CREATE and READ operations will be implemented. Object Versioning will be used to emulate updates and deletions.

Have there been previous attempts to create such a database? I have seen the MerkleWeb proposal, but I haven't really understood it, so I'm not sure if it answers my question.


texts: How to transfer bitcoins from old wallet to new wallet? Have no wallet.dat info

texts:
I've been researching and trying different things for few weeks now and I hope that you guys will be able to help me out.

I'm attempting to recover my bitcoins from years ago.. but I have no wallet.dat on my backup and was wondering what's the best way to transfer them to a new wallet I've created?

Blockchain does show that I do have some BTC but I have no idea how to get it showing on the Bitcoin Core.

Thanks in advance


texts: Bitcoin is not connected in regtest mode

texts:
I am having trouble using regtest mode on Linux.  Using pre-compiled version 0.9.2.1 for linux and starting regtest mode as instructed on bitcoin.org:

<bitcoin-ver>-linux/bin/64>> ./bitcoind -regtest -daemon

The server starts but doing a getinfo returns 'connections' : 0.  Tried experimenting with various rpc* settings in the .conf file.  What exactly do I need to set in order to use regtest mode?  Do I need to add real nodes via addnode for regtest?  It doesn't seem like I should need to.  I was able to get a few connections by adding several real nodes one time but after a few minutes 'connections' dropped back to 0.  Let me know if any additional info would help.


texts: Bcoiner wallet - balance is showing as zero?

texts: please help! I sent to my wallet 450 dolars of bitcoin, and transactions are confirmed strongly 62 times, but my wallet says that I have 0 bitcoins to spent and I cant sell it!!! What to do? Whats happening? thank you so much for answers!


texts: I was recently looking at the safest way to set up an online bitcoin service. When looking for security concerns I ran across this post on stackexchange What are the risks of running an online store via a bitcoind connection using less than the minimum of 8 connections? under the main question Stephen Gornick talks about how allowing inbound connections on 0 conf could open you up to huge double spends. I looked all over for the reason for this but was hoping someone could explain this vulnerability to me.


texts: What is a correct extranonce2 value in the stratum protocol?

texts:
I'm developing a stratum mining client. I read on stratum v1 docs on braiins.com how mining work is done on the stratum protocol and that the coinbase is done by concatenating coinb1+extranonce1+extranonce2+coinb2. At the end, mining work is submitted by sending this JSON: {"params": ["<worker>", "<job_id>", "<extranonce2>", "<ntime>", "<nonce>"], "id": 4, "method": "mining.submit"}.
It says that the extranonce2 value is generated by the miner but must be based on the extranonce2 size provided by the pool. The extranonce2_size im getting from the pool is: 4 (4 bytes). So an extranonce2 value of 00000001(in hex) can be valid.
However, when i'm trying to submit a random miner work to the pool(just testing) by throwing in random nonce and extraonce2(but of course using the current jobId and ntime provided by the response i got from the pool) i keep getting this error response: 20,incorrect size of extranonce2.
The random extranonce2 i'm sending is '00000002' and random nonce is 'b2957c02'. Shouldn't i get a rejected share and not an incorrect extranonce2 size? I'm still new to this and don't yet understand exactly how everything works so where's my mistake here? or is it a pool problem? I know there's a lot of stuff to do before sending the miner work but here i'm trying to send a random miner work here.
btw is the request id always 4 in stratum for submitting work(or id: 'mining.submit')?
I'm authorizing the miner before submitting.


texts: bitcoind -zmqpubhashtx causes empty raw file

texts:
I call:
bitcoind -zmqpubrawtx=ipc:///tmp/bitcoind.tx.raw
or even call:
bitcoind -zmqpubhashtx=tcp://127.0.0.1:9050 -
zmqpubrawtx=ipc:///tmp/bitcoind.tx.raw
where 9050 is port from bicoin config.
File /tmp/bitcoind.tx.raw is empty i has lenght=0
How can I dump transactions?
I read, this file is websocket and I must subscribe to it:
Client side, then, the ZeroMQ subscriber socket must have the ZMQ_SUBSCRIBE
option set to one or either of these prefixes (for instance, just hash);
without doing so will result in no messages arriving. Please see
contrib/zmq/zmq_sub.py for a working example."

How can I read it programically?
I try create c++ program from Python sources and https://github.com/plq/zmq.git
include
#include <iostream>
#include <cstdlib>
#include <cstring>

#include "zmq.hpp"

using std::cout;
using std::endl;

void recv_multipart(zmq::socket_t &socket) {
    int64_t more=-1;
    size_t more_size = sizeof (more);
    while(more) {
        zmq::message_t response;
        socket.recv(&response);

        std::string response_str((const char *)response.data(),
                                                             response.size());
        cout << response_str << endl;

        socket.getsockopt(ZMQ_RCVMORE, &more, &more_size);
    }
}

int main(int argc, char **argv) {
    zmq::context_t context(1);
    zmq::socket_t socket(context, ZMQ_SUB);
    socket.setsockopt(ZMQ_SUBSCRIBE, "hashblock");
    socket.setsockopt(ZMQ_SUBSCRIBE, "hashtx");
    socket.setsockopt(ZMQ_SUBSCRIBE, "rawblock");
    socket.setsockopt(ZMQ_SUBSCRIBE, "rawtx");
    //socket.connect(/*argv[2]*/"ipc:///tmp/bitcoind.tx.raw");
    socket.connect("tcp://127.0.0.1:28332");

    size_t arg_len= std::strlen("Unknown");
    zmq::message_t message(arg_len);
    std::memcpy(message.data(), "Unknown", arg_len);
    socket.send(message);
    recv_multipart(socket);
    return 0;
}


texts: I would like to manually write a few locking and unlocking scripts to get a deeper feel for that part of the network.  What is the simplest step-by-step set of instructions to set up everything needed to use Script in Windows, on regtest or some other testnet?  Is it possible to do this in Bitcoin-qt, or is working in the command-line a necessity?


texts: How come the block reward keeps only getting halved but there is an upper limit for bitcoins in existance?

texts: The maximum number of bitcoins that can exist is 21 million. New bitcoins are made by confirming that transactions happened. Every 4 years the amount of bitcoins people get when they solve a block is halved. When you keep on halving something you never get zero, so someone will always get paid some amount of bitcoins, but the max number of bitcoins that can exist is 21 million. So how is the total number of bitcoins not going to go over 21 million?


texts: I have not been able to find any method that pools use to verify you've done the work you say you did. So if someone does a solution withholding attack but without actually knowing what the solution is in a PPS pool then can't this attack just get free coins?


texts: If Bitcoin mining is becoming more and more impractical, what then?

texts:
If Bitcoin mining is becoming more and more impractical, where you'll need to buy like a ButterflyLabs unit, and where even eventually a room full of these units might not be enough some day, what then?

Or, am I failing to understand some controls on Bitcoin that make it where eventually the processing power requirements go down again by some market factor? Forgive me, I'm new at this.


texts: Derived address different from CLI to NodeJS

texts:
Basically I'm trying to create a system in which each user has it's own address to deposit on the site, however I'm having issues with monitoring addresses as they appear to be different results within CLI & Node.

Here's the code used to import the private key based on derived user ID:

const { exec } = require('child_process');

const hdNode = bitcoinjs.bip32.fromBase58(config.BIP32_DERIVED_PRIVATE, bitcoinjs.networks.bitcoin);

exec('bitcoin-cli importprivkey "' + hdNode.derive(user.id).toWIF() + '" "' + email + '" false');

Okay, now for the user side of things, the derived key is displayed using the following:

var derivedPubKey = config.BIP32_DERIVED;
if (!derivedPubKey)
    throw new Error('Must set env var BIP32_DERIVED_KEY');

const hdNode = bitcoinjs.bip32.fromBase58(derivedPubKey, bitcoinjs.networks.bitcoin);

exports.deriveAddress = function(index) {
    return bitcoinjs.payments.p2pkh({
        pubkey: hdNode.derive(index).publicKey,
        network: bitcoinjs.networks.bitcoin
    }).address;
};

However both results appear to be completely different? if I type bitcoin-cli listreceivedbyaddress 1 true into my SSH I get the following result:

But then for this same account, on the user interface I get the following:


texts: Why does unspent address index differ between APIs?

texts:
I've been using Blocktrail's API:

https://www.blocktrail.com/api/docs/lang/nodejs#data_overview

to get data for the following unspent address on the testnet:

2N6qMqR9D4BTkD6fS1h6Sq3kRV2FeB1L14j.

Blocktrail's API returns the index as 4, whereas blockexplorer's:

https://testnet.blockexplorer.com/api/addr/2N6qMqR9D4BTkD6fS1h6Sq3kRV2FeB1L14j/utxo

and smartbit's APIs:

https://testnet-api.smartbit.com.au/v1/blockchain/address/2N6qMqR9D4BTkD6fS1h6Sq3kRV2FeB1L14j/unspent

both return an index of 0. Am I missing something here?


texts: Blockchain download stuck on Bitcoin core wallet

texts:
The caching up process was progressing (slowly but still progressing) until it got stuck after processing 436820 blocks:
http://i.imgur.com/4nbP3ML.png

3 days after, I'm still at 70.76%

Says I'm connected though (to 8 peers)

Any clue?
(debug.log: https://pastebin.com/QSaUY2gm)


texts: How can I reclaim my Bitcoin Cash from my Greenaddress wallet?

texts:
I'm new to cryptocurrency in general, and I'm still learning.

Let's say someone moves BTC to a multi-signature wallet with a trusted provider, i.e. Greenaddress, before the split from an exchange.

This now does not provide him with Bitcoin Cash too.

Can someone please explain the process of obtaining the Bitcoin Cash that goes with his wallet's Bitcoin?

It seems that one can move to a wallet that does support Bitcoin Cash.

But I'm not clear on the concept of the transfer of private keys/addresses from a wallet that does not support Bitcoin Cash to a wallet that supports Bitcoin Cash.

Is this possible, and how does it work?

Would this transfer happen by simply converting Bitcoin to BCC, or would the BTC holder keep the BTC balance and gain a BCC balance in addition?


texts: After restarting a node, are missed transactions recovered in mempool? (v0.14.1)

texts:
As of v0.14.0 the mempool is now saved when shutting down a node and reloaded after starting up. If a node has been down for <20 mins lets say, does the bitcoin node attempt to recover the transactions it has missed or does it wait until it sees it in a block before requesting missed transactions from a peer?

Thank you!


texts: How many connections do I have on bitcoind?

texts: How do I find out how many connections bitcoind has made? From terminal.


texts: Blockchain.info and fetching transactions for a address between dates

texts:
I'm trying to fetch transactions for a certain bitcoin address, but I only need to fetch transactions within a specific date range.

Now, I had a look at the blockchain.info api and it seems like the best solution to get transactions for a address is: https://blockchain.info/rawaddr/$bitcoin_address

(as seen on this page: https://blockchain.info/api/blockchain_api )

My problem is that the array of transactions returns all transactions, but I just want to fetch a small subset of transactions within 2 dates.

I know that I can then filter the transactions myself based on the expected date range, but I'd like to reduce the payload for the initial response, otherwise I can end up with hundreds or thousands of transactions that I don't need.

Question: Is there a recommended, easier method to get transactions, belonging to a specific address, but only within a certain date range?


texts:
When using ripple API Prepare Payment method.

GET /v1/accounts/{:source_address}/payments/paths/{:destination_address}/{:amount}

I am struggling with how should I understand paths part of response?

"paths": "[[{\"currency\":\"USD\",\"issuer\":\"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q\",\"type\":48,\"type_hex\":\"0000000000000030\"},{\"account\":\"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q\",\"type\":1,\"type_hex\":\"0000000000000001\"}],[{\"currency\":\"USD\",\"issuer\":\"rpDMez6pm6dBve2TJsmDpv7Yae6V5Pyvy2\",\"type\":48,\"type_hex\":\"0000000000000030\"},{\"account\":\"rpDMez6pm6dBve2TJsmDpv7Yae6V5Pyvy2\",\"type\":1,\"type_hex\":\"0000000000000001\"},{\"account\":\"rHAwwozJw6FHfnJfRQaFXrkGHocGoaNYSy\",\"type\":1,\"type_hex\":\"0000000000000001\"},{\"account\":\"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q\",\"type\":1,\"type_hex\":\"0000000000000001\"}],[{\"currency\":\"USD\",\"issuer\":\"rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc\",\"type\":48,\"type_hex\":\"0000000000000030\"},{\"account\":\"rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc\",\"type\":1,\"type_hex\":\"0000000000000001\"},{\"account\":\"rEtr3Kzh5MmhPbeNu6PDtQZsKBpgFEEEo5\",\"type\":1,\"type_hex\":\"0000000000000001\"},{\"account\":\"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q\",\"type\":1,\"type_hex\":\"0000000000000001\"}],[{\"currency\":\"USD\",\"issuer\":\"rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc\",\"type\":48,\"type_hex\":\"0000000000000030\"},{\"account\":\"rsP3mgGb2tcYUrxiLFiHJiQXhsziegtwBc\",\"type\":1,\"type_hex\":\"0000000000000001\"},{\"account\":\"rKvPTQrD8ap1Y8TSmKjcK6G7q7Kvx7RAqQ\",\"type\":1,\"type_hex\":\"0000000000000001\"},{\"account\":\"rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q\",\"type\":1,\"type_hex\":\"0000000000000001\"}]]",

I know how to read JSON and understand that currencies are being transferred between accounts, what I don't get is in what order? from which to which in what amounts and currencies?

Also what does type stand for (1 or 48 in example), where can I get list of all types?


texts: How do I use electrum on multiple computers?

texts: I would like to use my electrum wallet on multiple computers. Is it just a matter of using my seed to recover the wallet on the other computer, or do I have to do something special to set it up?


texts: Where can I direct download the NXT blockchain data instead of from the client?

texts: When installing the nxt nrs client from scratch I need to redownload the nxt_db database blockchain. Is there a place where I can just download it from directly on a fast connection? It seems that it takes at least 3+ hours to download the nxt blockchain from other peers.


texts: Bitcoin core's estimatesmartfee gives same estimate on ECONOMICAL and CONSERVATIVE mode

texts:
I have observed this behavior several times before now, the commands bitcoin-cli estimatesmartfee 2 ECONOMICAL and bitcoin-cli estimatesmartfee 2 CONSERVATIVE give the same estimates.

For example, now I get:

>bitcoin-cli estimatesmartfee 2 ECONOMICAL
{
  "feerate": 0.00173558,
  "blocks": 2
}

>bitcoin-cli estimatesmartfee 2 CONSERVATIVE
{
  "feerate": 0.00173558,
  "blocks": 2
}

>bitcoin-cli estimatesmartfee 144 ECONOMICAL
{
  "feerate": 0.00036069,
  "blocks": 2
}

>bitcoin-cli estimatesmartfee 144 CONSERVATIVE
{
  "feerate": 0.00036069,
  "blocks": 2
}

I can increase the number of blocks even higher than 144 and I get the same result both. My node has been running uninterrupted for a long time so I found no reason for these values to be wrong. However, what's the point of having two modes of estimating fees if they give the same


texts: What explanations are there for the bubble of 2013 and subsequent Bitcoin price in 2014?

texts:
I'm having a look at the price history of Bitcoin/USD, and there's a significant spike around the end of 2013 (to USD 1137), followed by a very volatile year in 2014 that ended with Bitcoin around USD 330.

Is there anyone who's followed Bitcoin since 2013 who can comment on this volatile price action? In particular, I'm interested to know: what caused the dramatic run up to USD ~1140 at the end of 2013, and why has the price come down to current levels?

Many thanks!


texts: How to update index when payment is received with Blockchain PHP API?

texts:
I want to start accepting Bitcoins payment on my site, I got the callback and the index working fine, the only thing is that it won't update the index once the payment is received, I'd like to give the user some kind of live feedback when the payment is received, how can I do that?

Below is what I got.

  Index.php

<?php

$api_key = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx";

$xpub = "xpubxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";

$secret = "xxxxxxxxxxxxxxxxxxxx";

$rootURL = "https://xxxxxxxxxx.org/BlockChain";

$orderID = uniqid();

$callback_url = $rootURL . "/callback.php?invoice=" . $orderID . "&secret=" . $secret . "&username=Teste" . "&password=qwerty123";
$receive_url = "https://api.blockchain.info/v2/receive?key=" . $api_key . "&xpub=" . $xpub . "&callback=" . urlencode($callback_url);

$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $receive_url);
$ccc = curl_exec($ch);

$json = json_decode($ccc, true);

$payTo = $json['address'];

 echo $payTo;

?>

Callback.php

    $secret = "xxxxxxxxxxxxxxxxxxxx";

    if ($_GET['secret'] != $secret) {
        die("Stop doing that!");
    }

    else {
        //Register new user, insert more days, etc...

        //# START DEBUG #
        $fff = fopen("text.txt", "w");
        $value = $_GET['value'] . " - ";
        $fw = fwrite($fff, $value);

        $txhash = $_GET['transaction_hash'] . " - ";
        $fw = fwrite($fff, $txhash);

        $invoice = $_GET['invoice'] . " - ";
        $fw = fwrite($fff, $invoice);

        $value_in_btc = $_GET['value'] / 100000000 . " - ";
        $fw = fwrite($fff, $value_in_btc);

        $username = $_GET['username'] . " - ";
        $fw = fwrite($fff, $username);

        $password = $_GET['password'] . " - ";
        $fw = fwrite($fff, $password);

        fclose($fff);
        //# END DEBUG #

        echo "*ok*"; //Tell blockchain everything is ok, so they stop.
    }

    ?>


texts:
In the statement of liabilities issued by Mt. Gox after its bankruptcy it shows the following figures as totals:

The statement amount of "Deposited BTC" is 5,202,383,086.88638 bitcoins, which is over 5 billion bitcoins. Since at the time of Mt. Gox's bankruptcy in 2013, there were only about 10 million bitcoins in existence, the statement would seem to be impossible.

Is there something I don't understand about the Japanese number system?


texts: How to completely remove Bitcoin Lightning from Raspberry Pi

texts: I finished the installation of Bitcoin Core and Lightning but somehow i messed up with the certificates and the creation of the wallet and now im struggling to run lightning with the right users and the wallet creation was simply a mess, therefore how to remove all traces of lightning from my pi and start the installation from scratch?


texts: Which source code to make "checksum bits appended"

texts: Can anyone tell me the specified source code to make "checksum bits appended", before doing Base58 conversion? Thanks very much!!!!


texts: can there be a normal wallet that is equivalent to a multisig wallet?

texts:
for a normal wallet : if you own the private key you own the money
can we say that the multisig wallet is just a normal wallet which the private key was derived from others wallets ?


texts:
If you send send a transaction request to a node, what is to to ensure that node doesn't simply log your private key and do nothing?

What is to stop the entry node from taking a transaction intended to transfer 1 bitcoin, and transfer 100 instead? Or to stop the node from changing the receiver of the transaction to someone else?

Lastly, what is to stop a node from sending a completely made up blockchain?

Do you just have to choose a trustworthy node?


texts: How do I receive Bitcoins from my clients who owe me money? I do not have a web site. Currently I send my clients an invoice. They discharge the invoice by sending me a check drawn on their bank checking account. Do I have to send them a Bitcoin "key" or account number of some kind?


texts: estimatesmartfee outputs very different results

texts:
Around block 564815 (2019-02-26 23:40 UTC), the mempool was empty. I noticed that my two nodes are giving very different estimates for transaction fees to be used:

Node 1

Version: 17.1.0
Number of peers: 21
Synched for: about three weeks
Prunned: 3GB

// see how many transactions are there in the mempool
 >bitcoin-cli getrawmempool | wc -l
 4027

>bitcoin-cli estimatesmartfee 5 {
    “feerate”: 0.00021195,
    “blocks”: 5 }

>bitcoin-cli estimatesmartfee 5 ECONOMICAL {
    “feerate”: 0.00009715,
    “blocks”: 5 }

Node 2

Version: Bitcoin core 17.0.0
Number of peers: 8
Synched for: about 5 hours
Prunned: 3GB

# see how many transactions are there in the mempool
>bitcoin-cli getrawmempool | wc -l
3999

>bitcoin-cli estimatesmartfee 5
{
    “feerate”: 0.00008823,
    “blocks”: 5
}

>bitcoin-cli estimatesmartfee 5 ECONOMICAL
{
    “feerate”: 0.00001000,
    “blocks”: 5
}

The node that has been synchronized for only 5 hours and is less well connected seems to be estimating the fee better than the one that has been synchronized for three weeks. Why is the "best" node the one that gives the worst fee? Why are the fee estimates so different and what can be done to make them more accurate?


texts: Is transaction malleability an issue when receiving payments?

texts:
Assume I'm using the original client to receive payments. Is the following scenario possible?

My wallet gets notified of unconfirmed transaction with id 12 in which one of the outputs is an address that belongs to me.

Someone changes the id of the transaction to 13 and relays it to the miner who finds the next block.

My wallet gets notified of block that contains transaction with id 13 in which one of the outputs is an address that belongs to me.

Transaction with id 13 gets 6 confirmations but transaction with 12 gets stuck in my wallet as an unconfirmed transaction.

If I'm showing my customers their unconfirmed transactions, then the customer will see a confirmed transaction with id 13 and an unconfirmed transaction with id 12. Is that correct? Or will QT automatically delete the first transaction?

What can I do to prevent this?


texts: The original client that can be downloaded from www.bitcoin.org is often referred to as the "official client". Similarly many regard www.bitcoin.org as the "official homepage" of the project. So, who runs it? Is it the core developers? Some Bitcoin association? Or just a private person?


texts: Do wallets save a backup of my private keys and seed?

texts:
Let's say that I do not trust a lot in myself and my ability to not screw my computer, so also my private keys.

Knowing the concept of wallet HD and having seeds to recover all your private keys linked to the seed, how does this work, from wallets perspective?:

Does a wallet provider save my private keys (in a secure way) in order to restore them in the future with my seed, if I require it? (Providing paraphrase or information required)
Depends on the wallet provider whether they save a encrypted copy of my private keys to restore them in the future (just in case I remove or lose my local wallet file) or others that they do not save any private data, leaning the entire private keys in my local machine ?

This question is related with some FaQ from.some wallet providers, which they offer the option to restore your private keys providing the seed. This looks like they have a copy of your private keys, otherwise whether you are the only one that have them  and you lose your private keys, there is no way to restore it.


texts: How do I do a manual replace-by-fee in Bitcoin Core?

texts: I made a transaction with too small a fee several days ago; hence, it has not been included in any block. Currently, it is lingering in the mempool. How can I use Bitcoin Core to make a new transaction from the same address but with a higher fee? Essentially, how do I do a manual replace-by-fee?


texts: Do private blockchains need consensus protocols?

texts: My understanding is that in a private blockchain, the participating nodes verify and agree that the block is valid and only then add it to the blockchain.In this scenario, are consensus protocols (such as RAFT, PAXOS, etc.) needed? Am I missing anything here?


texts: Would it be feasible to attack the bitcoin network by buying and deleting large amounts of bitcoin?

texts: Could a government, determined to stop bitcoins, just buy a lot of bitcoins and delete the wallet afterwards? Are the bitcoins gone then?


texts:
Since there are a finite number of Bitcoins that can be created, I am wondering what happens if some of the coins are lost. My questions are three fold:

How do you define a "lost" coin? For example if a bank note that was in my pocket is not there anymore (provided that I did not spend it), I know I lost it.
How does the network know a coin is lost?
How would the remaining coins value if some are lost? For example, assume there are 10 coins in total in circulation each worth 100 usd, the total spending power is 1000 usd. If say 2 of them are lost, are they assumed to be taken out of the circulation for good or someone can pick them up and reuse them. I guess in the first case the value of the remaining coins are worth 125 usd each due to fewer coins in circulation while in the latter case the value of each case would stay the same (this comes back to the second question of if the network is aware of the lost coins).

I come from non-programming background so appreciate clarification.

Thanks


texts: First time bitcoin buyer; been reading, but still not sure how to purchase

texts:
I want to buy bitcoin for the purpose of making a transaction with a business that specified bitcoin. I have a Copay wallet on my desktop, but after doing quite a bit of reading, I'm still not sure about where to go to buy them and how to get them in my wallet. I would be paying with my Visa debit card or through Pay Pal. I've already calculated the amount, which would be 0.025 bitcoin which roughly comes out to $50 US. I know I have to click receive and then to 'request specific account', which takes me to a place where there's a QR code and an address. Not quite sure what the long alpha numeric address is for and about how I purchase the bitcoin and get them into my wallet. I see there is a slower and faster way to do this. Fast is good, but I"m in no particular hurry If you can help, I think that I'm almost there. I"ll keep reading in the interim.

Thanks so much,

John


texts: How will bitcoin stay decentralized when mining becomes extremely expensive?

texts: My understanding of bitcoin is that the miners are the ones keeping bitcoin decentralized. What happens when only the richest of people can afford mining?


texts: How do transactions in the blockchain work

texts:
I'm trying to go through the whitepaper to get a better understanding of bitcoin but I don't understand the block and subsequent blockchain model to create a transaction. The problems that bitcoin seems like it is trying to address is verifying if person A actually has the money to send to person B, and ensuring person B can't alter the amount person A sends.

I get that if A is trying to send money to B, A should sign the transaction with his private key as B wants to ensure A is who is sending the money. What I don't understand is the need for the hashing of B's public key and the previous transaction, and what exactly is being verified/signed.

I read a bit about the problem of "double-spending" but I don't think I understand it entirely because I don't see how the above solves it. Double-spending as I understand it is A giving money to one person, then making the transaction seem like it didn't happen or is invalid in order to spend the same money to someone else.

If transaction i - 1 is being hashed in transaction i, that means only transaction i - 1 is known. It says nothing about transaction i - 2, where the same money that is being spent in transaction i could have already been spent. It doesn't seem like transaction i - 1 or i keeps a list of all previous transactions, so there's no way of verifying where the buyer in i actually has the money.

What is the purpose of hashing the recipients public key and the previous transaction, and what is being verified in the picture above


texts: Can wallet created from Bitcoin core be transferred to an Android device?

texts: I worry that if I install a wallet in my Phone, it would have a different wallet from the one I created in PC.


texts: Private Key in HD Account Bither Watch Only

texts: I have a watch only HD account in Bither and I've got a password of the wallet but I don't have a private Key. I need to send  BTC received in that account to another address in another account


texts: What would happen if the BTC price collapsed and the reward for mining dropped below the cost of mining?

texts:
Miners will only mine bitcoins if the reward they get from mining outweighs the cost of mining it.
The network difficulty is adjusted every 2016 blocks (approximately every 2 weeks).
If the price suddenly collapsed by a large percentage such that the new minted bitcoins would be worth less than the electricity it costs to mint them, what would would happen?
The network difficulty rate would be stuck at the unprofitable rate until 2016 blocks are minted before it gets adjusted.


texts: How do I spend a non-standard P2SH transaction

texts:
I was sent a P2SH puzzle address. I have solved the puzzle, which is to say I have created a script that matches the hash, and I know what to put on the stack before the script. Sadly, what I am having trouble figuring out is how to actually create a valid transaction with this non-standard script and no signature. All the examples and documentation I've found only talk about creating standard signature-based transactions and not ones with arbitrary scripts.

For example, let's say the encoded script is 955787 and someone actually sent bitcoin to the P2SH address for that script, which is 3PijzLhTnkA9S2HDFLrdwX9SCg69W8ggD4

Now I want to spend that by providing the full redeem script:

1 7 955787

or I guess more accurately

OP_1 OP_7 3 0x955787

How do I actually create that transaction using bitcoind or bcoin? I don't see how to get it to create a transaction with that supplied script or transmit it to the network without a signature. I am looking for a list of command-line commands to run (use placeholders for any required data I did not supply above).


texts: How do these OpenSSL commands create a Bitcoin private/key from a ECDSA keypair

texts:
I found the following code online and apparently it works. But I don't understand the lines which extract the Bitcoin compatible private/public key from the created ECDSA keypair.

FILE_NAME=$1
PRIVATE_KEY=${FILE_NAME}_private.pem
PUBLIC_KEY=${FILE_NAME}_public.pem
BITCOIN_PRIVATE_KEY=bitcoin_${FILE_NAME}_private.key
BITCOIN_PUBLIC_KEY=bitcoin_${FILE_NAME}_public.key

echo "Generating private key"
openssl ecparam -genkey -name secp256k1 -rand /dev/urandom -out $PRIVATE_KEY

echo "Generating public key"
openssl ec -in $PRIVATE_KEY -pubout -out $PUBLIC_KEY

echo "Generating BitCoin private key"
openssl ec -in $PRIVATE_KEY -outform DER|tail -c +8|head -c 32|xxd -p -c 32 > $BITCOIN_PRIVATE_KEY

echo "Generating BitCoin public key"
openssl ec -in $PRIVATE_KEY -pubout -outform DER|tail -c 65|xxd -p -c 65 > $BITCOIN_PUBLIC_KEY

echo "Files created!"

If someone could explain, that would be nice


texts: Should I increase my mempool size to accomodate temporary crisis?

texts: I am seeing 68k unconfirmed transactions on blockchain.info. My own bitcoind (v0.13.0) node has 49k transactions in its mempool with memory usage currently at 230mb. Knowing that the memory cap is currently at 300mb, I fear that very soon my node will not be able to keep all unconfirmed transactions. Should I increase this cap as a temporary measure until things get better? if so, how do I do that?


texts: How to get all transactions of address with bitcoin api in node.js?

texts:
I want to find all transactions of address in regtest. How it is possible to do?
I have this solution, but I get response (201) before for ends. I think it's bitcoin timeout false.

    bitcoin.getReceivedByAddress(user_address).then ((current_balance) => {
        //get current address balance\
    //if balance has changed, check latest transactions
    if (current_balance > 0) {
        bitcoin.getBlockCount().then ((n) =>{

            for (let i = n; i > current_balance !== 0 && i > 0; i--) {
            bitcoin.getBlockHash(i).then((hash) => {
                bitcoin.getBlock(hash).then( (block) => {
                for (let j in block.tx) {
                bitcoin.getTransaction(block.tx[j]).then ((transaction) => {
                    if (transaction.details[1].address === user_address
                && transaction.details[1].category === "receive") {
                    current_balance -= transaction.details[1].amount;
                }

            });

            }

        });

        });

        }

    });
    }

}).then(() => {
        res.send(201);
    })


texts: How can I recover the private key for my bitcoin address?

texts: I want to make withdrawal from my Bitcoin address to which I just transferred some bitcoins. The address has changed after I made a transactions to the first address. But it was requesting the private key to create the payment. How can i get the private key to spend fund from the address?


texts: Why bother with 'account' in derivation path?

texts:
After lots of wallet testing, I'm thinking that only account level 0 should be used. Especially, when you consider restoring a wallet from the seed phrase.
m / purpose' / coin_type' / account' / change / address_index
seed phrase: The 12 or 24 word mnemonic. AKA Recovery Seed. BIP39.
passphrase: An optional string that is combined with the seed phrase to create a seed. Sometimes called the 25th word (*cringe*). Also in BIP39.
Because most wallets make it simple to change the passphrase and difficult to change the derivation path for an installed seed, I think changing the passphrase to create new "wallets" from a seed is better/safer than trying to increment account to create new wallets.
Isn't it safer to always use account 0 because restoring a seed phrase will usually default to showing the user account 0?  If you had used account 1, it seems easier to forget this, not know how to specify it, and overlook your bitcoin stored in non-0 accounts.
Instead of generating and securing multiple seed phrases (eg. one for each wallet), there's an argument to securely storing just ONE seed phrase and using that seed phrase for all wallets (even all coin types). This way you wouldn't have to etch new metal plates and visit deep-cold storage as often; if it's a pain to do, you might not do it. The account field would seem like the way to go then: Increment the account number each time you need a new wallet. However, I've not found a wallet that easily restores accounts other than account 0.
Are there wallets that scan for funds in accounts >0?  I'm thinking of something like the gap-limit when scanning addresses for funds.
Instead of using account in the derivation path, it's easy to just restore a wallet with a passphrase. Entering the passphrase is usually a menu option or a dialog box when you connect the hardware wallet. Of course, this means you need to manage passphrases but it seems easier to restore this way, at least to me.
Some wallets require you to re-enter the 12/24-word seed phrase every time you want to change the derivation path. This requires retrieving the seed phrase from a deep-cold vault. If you used passphrases, you would simply enter other passphrases to switch wallets.
What has been your experience with using account in the derivation path?


texts: Gaming Bitcoin by generating millions of wallets

texts: What’s to stop someone from gaming the system and creating millions of wallets, increasing their odds of accidental deposits?  If nothing else you could conceive of a DOS attack of sorts, where the addresses are all burned up.  This seems like a major flaw to me... regardless of how many possibilities there are, it's not infinite.


texts: How to set a payment in Ripple without specifying currency issuers?

texts:
I want to send IOUs from one of my accounts to another through the use of the API. Both of the accounts trust the same IOU issuer, which is a separate address. According to the Transaction Format, I would set the Amount issuer to the receiving account, and the SendMax issuer to the sending account. However, trying this, I get a "path dry" error:

{
  "id": 6,
  "status": "success",
  "type": "response",
  "result": {
    "engine_result": "tecPATH_DRY",
    "engine_result_code": 128,
    "engine_result_message": "Path could not send partial amount.",
    "tx_blob": "1200002280000000240000000E5011000000323031342D30392D32335430313A34373A34303A39383834383635303061D4445EADB112E0000000000000000000000000005442430000000000D3BC678DA1AEC545F393F5B0AFD2B8654CE43DB368400000000000000A69D44469DD823458000000000000000000000000005442430000000000D6C315BE3EADA22F12AC21AC94A5FC38CA5AFADA73210220AFA84AEEE2DD794576E98411946D671F8E1F80E6C432B5ABAAAB2957651CD674473045022100FD0F2FECF958294BEA74876A4E5FE4192EA10EFC55C9B166F9F427861D5CBC42022067AA4B5CDA1BEB1D400937888C7819A412B238C79423A3DDB6F4FC8F45D45D618114D6C315BE3EADA22F12AC21AC94A5FC38CA5AFADA8314D3BC678DA1AEC545F393F5B0AFD2B8654CE43DB3",
    "tx_json": {
      "Account": "rL2ZJ8iTF9w5UGr8MzQSt8GpedNmutpEEQ",
      "Amount": {
        "currency": "TBC",
        "issuer": "rLJZHsAbNZu264dWnPCGgpqePAYfNZR1Zk",
        "value": "0.123"
      },
      "Destination": "rLJZHsAbNZu264dWnPCGgpqePAYfNZR1Zk",
      "Fee": "10",
      "Flags": 2147483648,
      "InvoiceID": "000000323031342D30392D32335430313A34373A34303A393838343836353030",
      "SendMax": {
        "currency": "TBC",
        "issuer": "rL2ZJ8iTF9w5UGr8MzQSt8GpedNmutpEEQ",
        "value": "0.12423"
      },
      "Sequence": 14,
      "SigningPubKey": "0220AFA84AEEE2DD794576E98411946D671F8E1F80E6C432B5ABAAAB2957651CD6",
      "TransactionType": "Payment",
      "TxnSignature": "3045022100FD0F2FECF958294BEA74876A4E5FE4192EA10EFC55C9B166F9F427861D5CBC42022067AA4B5CDA1BEB1D400937888C7819A412B238C79423A3DDB6F4FC8F45D45D61",
      "hash": "6CDB694DF36F4BD3AB928A9D761A9F60C285557B3C1136749DF7BC56A46ED641"
    }
  }
}

Despite rLJZHsAbNZu264dWnPCGgpqePAYfNZR1Zk and rL2ZJ8iTF9w5UGr8MzQSt8GpedNmutpEEQ trusting the same issuer (rTJdjjQ5wWAMh8TL1ToXXD2mZzesa6DSX) and having enough IOUs to cover the transaction.

How can I fix this issue? What am I doing wrong?


texts: Someone (not me) transffered bitcoin from my blockchain app

texts:
Someone has cleared out my bitcoin from blockchain.
Apparently there was a transaction from my account, however i didnt do this.
I have the ID it was sent to, can i recover it?
transaction ID:32564a93b0b78886626b203178ccf91b24c9794aa1792507c1147c8d94af0bf2
hope someone can help.
Thanks


texts: Network admin blocks P2P, Bitcoin clients can't connect

texts:
My university network admins seem to block P2P networks. So I can't download totally legit Linux distros via BitTorrent ;-)

Unfortunately, this also affects Bitcoin wallets such as MultiBit or Bitcoin Wallet on Android.

How can they block all the P2P while leaving other services working? How do I make the client connect?


texts: In altcoins, why is it that sometimes the volume increases when the price stays relatively stable or even goes gown?

texts:
Naturally, if the volume of a market increases, then I would interpret that as increasing demand of that market and expect the price to go up. But it seems that this is not always the case.

I've noticed that sometimes, the volume of an altcoin goes up (over the course of several hours) when the price stays relatively stable or even goes down.

The only case where that I think would happen is when rich people/person is manipulating the market.


texts: Re-insalling Bitcoin Core without re-downloading blockchain

texts: I had Bitcoin qt installed on my C drive and I downloaded the blockchain onto an external hard drive. I recently had to re-image my C drive. What I want to do is reinstall the Bitcoin software on my C drive without having to re-download the entire blockchain again.


texts: Does the alternative stack make Script Turing complete?

texts:
The wiki documents the presence of an "alt stack" in Script:

OP_TOALTSTACK Puts the input onto the top of the alt stack. Removes it from the main stack.
OP_FROMALTSTACK Puts the input onto the top of the main stack. Removes it from the alt stack.

It appears then that Script may qualify as a Two-Stack Pushdown Automaton. And this system is known to be equivalent to a Turing Machine. For example:

  To see the equivalence, just think of the first stack as the contents of the tape to the left of the current position, and the second as the contents to the right. Start by pushing the normal "bottom of stack" markers on both stacks, then we can simulate the TM by popping from the right stack and pushing to the left to move right, and vice versa to move left. If we hit the bottom of the left stack we behave accordingly (halt and reject, or stay where you, depending on the model), if we hit the bottom of the right stack, we just push a blank symbol onto the left.

https://cs.stackexchange.com/questions/2832/is-a-push-down-automaton-with-two-stacks-equivalent-to-a-turing-machine/2833#2833

Wikipedia defines "Turing complete" as:

  In computability theory, a system of data-manipulation rules (such as a computer's instruction set, a programming language, or a cellular automaton) is said to be Turing complete or computationally universal if it can be used to simulate any Turing machine.

https://en.wikipedia.org/wiki/Turing_completeness

This thread makes reference to the alt stack, claiming that its presence makes Script Turing complete:

https://www.reddit.com/r/Bitcoin/comments/7yb3is/where_is_the_evidence_that_bitcoin_is_turing/duf1rt9/

That thread links to this thread, which contains the following:

  While it is a well known CS result that a two-stack push-down automata has the same power as a Turing Machine, Bitcoin Script cannot operate as a two-stack push-down automata. Even though Bitcoin Script has two stacks, Bitcoin Script doesn't have an associated finite state machine that you can create.

https://reddit.com/r/btc/comments/6hjxiy/new_craig_wright_interview_part_2_on/diz9g69/?context=3

In other words, there may be two stacks, but there's no way to sufficiently power them to create a Turing Machine.

Is Bitcoin Script Turing complete given the presence of the alt stack? If not, what specific functionality is missing?


texts: Mycelium: Restore backup from Android to iOS

texts:
I used Mycelium wallet on Android quite a while ago. I created a printed backup which consists of a 15-character password and two QR codes: The bitcoin address and the encrypted private key.

Meanwhile I switched to iOS, installed the iOS app and wanted to import my old wallet (which still contains Bitcoins). However, when I open the app and select "Restore from backup" it asks me to enter my Master Seed separated by spaces.

Sure enough, the backup does not contain a master seed and and entering the 15 character password does not work.

How to import the old wallet?


texts: I operate a very high potential bitcoin faucet. Currently it is the highest paying faucet (only available for mobile). I know faucets are considered passe, but many people still use them. Im curious, what features would you like the most from faucets?


texts: Calculating the witness size of a transaction

texts:
I want to calculate how many % of a block, and thus, transactions that are witness data. I need to calculate the size of the witness data in bytes in every transaction. And as I understand it, I cannot calculate this using existing size variables like vsize.

Will a loop through the "txinwitness" array of hex and do a byte length calculation on every one be enough? (Using NodeJS here)

Buffer.byteLength('03fbcc1c24903bc2fb1d73czef518b859232341c39e4515367653d80536d587b62d6', 'hex');


texts: Can a merchant find my other bitcoin addresses in the same wallet if it sends me money to one?

texts:
I would like to do business with a merchant (deposits and withdrawals) but do not want the merchant to know that I am one person making multiple transactions.

If I have multiple addresses in a wallet and only use each one once, will there be any way for the merchant to link those to addresses that I have previously done business with them at?

If so, what is the best way to stay anonymous as I have described?


texts:
From my understanding of blockchain, I feel the main use of blockchain is to do something in a decentralised way as compared to the traditional centralised way which involves a middle man. Usually, the centralised way is a much simpler way, but use of a more complicated way (blockchain) becomes justified because you are able to decentralise.it.

However, I see a lot of companies which are currently the central party trying to get into Blockchains. For e.g. banks etc. I am not sure what advantage there is here.

For example, take a look at this - ironmountain.com - What-is-blockchain-and-why-should-records-management-professionals-care

In my opinion, regular PKI is best suited for this. A user signs his document with his private key & then submits it to Iron Mountain. This will ensure integrity. So what advantage is it to either Iron Mountain or the user if Blockchain is adopted in this case.

It also seems as if Blockchain is getting forced into places where it's not necessarily the best solution.

Or am I wrong?


texts: When I move an address to another account, and the address contains bitcoins, will the person who gets the address will get the bitcoins that where on the address?