Attack vectors for difficulty retargeting with BCH and BTC? Since the existence of BCH, miners can now switch chains to mine on. Assuming they mine greedily based on price and difficulty. Can the following attack happen and how could it be mitigated:

Assuming BCH has a high market cap, in parity with BTC.

Since it take two weeks to adjust for difficulty most miners would mine BCH when bitcoin difficulty is unprofitable. Then lets say 20% of miners keep mining BTC such that the difficulty adjustment is triggered 1.5 months later and re sets to 1/5 difficulty. Then, miners would jump from BCH to BTC and mine 2 weeks worth of supply in 4 days, leave when difficulty readjusts, and BTC basically dies (because most of the time blocks are solved on average every 50mins rather than the usual 10mins, causing slow confirmation times).

How can this attack be mitigated?

Short answer: You can protect with money.

It is an economic problem. First, if the marketcap changes slowly, the difficulty can adopt. Now suppose the marketcap changes suddenly and miners behave rationally for the short term profit.

Since total_reward = block_reward + fee, a sufficient higher fee can attract miners. For example, if the marketcap on one side is double, then the compensation fee should be more than 12.5 BTC. This total fee may seem high, but it had actually happened. During the time lacking miners, there is 13.4 BTC in block #494045, and many other blocks with 11+ BTC. This is around $30 per transaction and people are willing to pay it! Hence, for the "protection", rich people can pay high fee, poor people can make donation transaction, and "irrational" miners can stay by losing profit.

Anyway, you cannot use the blockchain if you cannot pay a high fee. Note that the above strategy is true in both directions: A "protection" on one side is an "attack" on the other side. So the fee on both side may rise exponentially together.


What is the different between Open Transactions and Ripple? I have been watching the Open Transactions project. Since Ripple has recently came up I am curious as to their relation to each other and if they are trying to achieve the same thing but with a different framework.

At first glance they do appear to be doing the same thing (I think) but what are the differences?

I haven't seen the Ripple code so I can't comment on the latest endeavor, but Ripple as a concept (by Ryan Fugger FYI) is the combination of 2 mechanisms:

The ability to extend a credit line to any of your friends, in any currency.
The ability to make payments that hop across these credit lines, P2P, like a "Six degrees of separation" from sender to recipient.

I've always felt like this concept was important because it eliminates exchanges (such as MtGox) as a bottleneck, since it enables people to access the system, and move funds in and out, directly through their own friends.

If the current Ripple venture departs from that in any way, perhaps one of the Ripple guys can post a comment giving further detail. But that's my understanding of it.

Open-Transactions, on the other hand, is a software library for financial cryptography, including a prototype server and a high-level client API (available in most languages.)

The OT server is able to process all sorts of transactions... issuers can issue currencies onto any OT server (or preferably onto many OT servers.) Then users can open accounts in these currencies, and send payments to each other using a variety of financial instruments such as account transfers, cheques, and untraceable digital cash.

Open-Transactions also supports markets (for offers and trading, like you might see on MtGox or other exchanges) as well as basket currencies.

Open-Transactions also features a full client-side scripting engine, so you can create your own financial scripts using the OT API. There are also scriptable contracts ("Smart Contracts"), which can be signed by multiple parties and then activated on an OT server for processing. OT comes with a few sample smart contracts, such as Escrow, and Two-Way Trade.

BTW, it wouldn't be too hard to build Ripple into OT, I already worked it out in my notes here: https://github.com/FellowTraveler/Open-Transactions/wiki/Markets

(Who knows if/when I'll ever get around to adding that, however.)

*edit: article describing the trust differences between OT and Ripple: http://opentransactions.org/forum/index.php?topic=3759.0


Centos electrum public-key import I have several bitcoin addresses (together with corresponding public keys) from Electrum wallet I've used previously. I moved to another CentOS server and now I need to import this addresses back.
But when I do:

electrum sweep [public key] [btc address] -w [path to wallet]

I get:

Traceback (most recent call last):
File "/usr/local/bin/electrum", line 384, in <module>
result = server.run_cmdline(config_options)
File "/usr/local/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 748, in __call__
return self.__send(self.__name, args)
File "/usr/local/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 630, in _request
check_for_errors(response)
File "/usr/local/lib/python3.7/site-packages/jsonrpclib/jsonrpc.py", line 1321, in check_for_errors
raise ProtocolError((code, message))
jsonrpclib.jsonrpc.ProtocolError: (-32603, 'Server error: File "/usr/local/lib/python3.7/site-packages/electrum/bitcoin.py", line 475, in deserialize_privkey | electrum.util.BitcoinException: cannot deserialize privkey 024..c0\n')

What am I doing wrong?

You need the private key not the public key to do a sweep.

Actually it'll be easier if you simply copied the wallet file to the new system. If you have access to the electrum gui then you can create a copy via file > save copy. If you don't then find the wallet file and copy it over.


Can I test Lightning on Bitcoin regtest? I want to do some Lightning experiments, but want to avoid the burden of synchronizing the blockchain (even testnet). Can I experiment with Lightning using regtest? Is there a manual for setting it up?

Yes this is possible and (at least with clightning) very easy to do. I always use this script by Nadav Ivgi from his spark wallet. The key part is this : (MIT license by Nadav Ivgi)

$ mkdir -p /tmp/spark-env/{btc,ln1,ln2}

$ bitcoind --regtest --datadir=/tmp/spark-env/btc --printtoconsole
$ lightningd --network regtest --lightning-dir /tmp/spark-env/ln1 --bitcoin-datadir /tmp/spark-env/btc --addr 127.0.0.1:9600
$ lightningd --network regtest --lightning-dir /tmp/spark-env/ln2 --bitcoin-datadir /tmp/spark-env/btc --addr 127.0.0.1:9601

$ alias btc='bitcoin-cli --regtest --datadir=/tmp/spark-env/btc' \
        ln1='lightning-cli --lightning-dir /tmp/spark-env/ln1' \
        ln2='lightning-cli --lightning-dir /tmp/spark-env/ln2'

$ btc generate 101 && btc sendtoaddress $(ln1 newaddr | jq -r .address) 5 && btc generate 1

# wait for onchain funds to show up on `ln1 listfunds` (updated every 30s)

$ ln1 connect $(ln2 getinfo | jq -r .id) 127.0.0.1 9601 && \
  ln1 fundchannel $(ln2 getinfo | jq -r .id) 16777215 1100perkb && btc generate 1

If you use docker you can even spin up Nadavs docker image with:

$ docker run -e NETWORK=regtest -e API_TOKEN=1234 -p 9112:9112 shesek/lightning-charge

but if you want more lightning nodes fired up that already form a network you can use lnet by Christian Decker. With that script you can provide a weighed graph and get the lightning nodes as the graph defines.


Largest current merchants accepting Bitcoin? I am writing some rants about the use of Bitcoin, and would like to sum it up by naming some spearpoint examples of companies and service providers that use Bitcoin. Either solely or side-by-side with conventional currency.

But the few lists I came across were either hopelessly outdated or simply false.

Can anyone name me some of the top busters using Bitcoin ? Or maybe some good creative examples of Bitcoin use ?

And please not the Alpaca Socks site. I need some fresh examples to shake off a bit of the dust and make the article seem current.

The Bitcoin wiki contains a rather large list of companies that accept Bitcons. You can also add yourself to it once you started accepting Bitcoins.

The truth is Bitcoin is still in it's early days; soon it will be much easier to accept them.


How many zeros must be in a bitcoin share for a pool to accept it? In the binary representation of the hash.
Now the hash should be about 80 zeros.
In the share - less, but how much exactly?
At the dawn of bitcoin in a share, it was enough to have 32 zeros. Now the difficulty has greatly increased.

What are the share requirements for popular pools?

First of all, Bitcoin does not actually use the number of zeroes for the difficulty. Rather it interprets the hash as a number and checks that the block hash is less than or equal to a particular target. This makes the hash have several leading zeroes, but those zeroes are not being considered directly.

The target for a share varies by pool, and usually, by miner as well. Miners can choose a target that matches their hash rate so that they aren't submitting shares too quickly or too slowly. Of course the shares are weighted by difficulty (i.e. target). So a share with a higher difficulty (lower target) is worth more than a share with a lower difficulty (higher target).

Most pools offer setting the difficulty to many values. For example, Slushpool lets you set it anywhere between 128 and 500,000.


Testnet transaction - OPCODE MISSING OR NOT UNDERSTOOD error I'm trying to broadcast a manually generated raw testnet transaction. I'm getting the following error from SmartBit: PUSH TRANSACTION ERROR: 16: MANDATORY-SCRIPT-VERIFY-FLAG-FAILED (OPCODE MISSING OR NOT UNDERSTOOD).

My raw transaction looks like this:

01000000
01
e6dc926ae5ffd4f6b83376c7df00136cd27284977714f3ab2295f0bb91e13547
00000000
8d
493046022100dc6c14b905647fc0efde3d37079853bb1cedbcdf2cfdecac6665a3b8b8b2395d022100b13412fae64c9b6341096acf3578d93ab450c23dd6361701ceb21cef6d80100201410404f89c713f44615ad5fdc16f1ef8628351a1cce79ee96130a0e4a6eb09d05278cef28cb002a6ad2ad53181b01d03f931538488a7a689d83684e54822305205d5ba
ffffffff
02
75a58c0600000000
1976a91413aa97d12703b051d9b670097bbf07e2cd78de6088ac
23ce010000000000
1976a914a9974100aeee974a20cda9a2f545704a0ab54fdc88ac
00000000

Assuming that the error indicates a problem with the scriptsig, breaking down the scriptSig, it looks like this:

49
30
46022100dc6c14b905647fc0efde3d37079853bb1cedbcdf2cfdecac6665a3b8b8b2395d022100b13412fae64c9b6341096acf3578d93ab450c23dd6361701ceb21cef6d80100201
41
04
04f89c713f44615ad5fdc16f1ef8628351a1cce79ee96130a0e4a6eb09d05278cef28cb002a6ad2ad53181b01d03f931538488a7a689d83684e54822305205d5ba

What am I doing wrong? The spender's address is: mhJwViAyjAdKoEFNPcX96zN2HxZpv69avm.

EDIT:
I dropped the extra 0x04 and adjusted the 1 byte public key length. I'm still getting the same error. ScriptSig looks like this now:

49
304502202c5a951bbfc185ffbe6c8b74f587a4c4b1afbf99ad2c95050c938dbecdf6bc4b022100a3594fa9168bc8030a73f8fa9d277fad1765ec06d71e378e8637df1e367d260f01
41
04f89c713f44615ad5fdc16f1ef8628351a1cce79ee96130a0e4a6eb09d05278cef28cb002a6ad2ad53181b01d03f931538488a7a689d83684e54822305205d5ba

quickly verifying:

410404f89c713f44615ad5fdc16f1ef8628351a1cce79ee96130a0e4a6eb09d05278cef28cb002a6ad2ad53181b01d03f931538488a7a689d83684e54822305205d5ba

41 hex equals 65. So the following string should be 65 bytes, but it is 66 bytes. As arubi lined out, there is an error with the double "04" - it only needs one.

Quick proof: when I verify the pubkey, I get the right address:
    04f89c713f44615ad5fdc16f1ef8628351a1cce79ee96130a0e4a6eb09d05278cef28cb002a6ad2ad53181b01d03f931538488a7a689d83684e54822305205d5ba

SHA-256 hash of PUBKEY
EF14CA0F83CCDA08F81806AEFADF80BA58CCCD12B149E028EF86F7B00C04C293

RIPEMD-160 Hash
13AA97D12703B051D9B670097BBF07E2CD78DE60

Adding network bytes
6F13AA97D12703B051D9B670097BBF07E2CD78DE60

SHA-256
AD3575F9D5422C0BD5AE472DA035E54601085FA5F018F4F72EF2ED5E96602B0C

another SHA-256
02D633422E210032443A4F5595C443C311CD64A5C762A7E354CCB6E510F1196B

First four bytes
02D63342

Adding 4 Bytes at the end of the network bytes line
6F13AA97D12703B051D9B670097BBF07E2CD78DE6002D63342

Base58 encoding
mhJwViAyjAdKoEFNPcX96zN2HxZpv69avm

so the pub key is wrongly assembled into the sigscipt.
On the S-value: I can see, that it was extended with a double "0", but the value still remains "high":

checking S-value is less than N/2, no...
    --> S is not smaller than N/2, need new S-Value (new_s = N - s)
    new S=4ECBED0519B3649CBEF69530CA8726C4065E1AA8D9128939F120419D62B6313F

when changing the S-Value, the length fields might need to be adapted...
Just for curiosity: what tool are you using to assemble the tx?


Is there any point mixing coins if I were to use an online wallet? Because when using an online wallet there isn't an address tied to your identity, would there be any reason to mix coins when making a transaction?

Assuming that you'd like to protect your privacy by mixing coins, then yes, there would be a reason. Using an 'online wallet' (I am assuming you mean an online wallet-service, that has a website you log in through, or something similar to that) does not protect you in any way that using a locally generated wallet wouldn't. In fact, it is probably a poorer security model in most cases, since your private keys will be generated in an online device.

Further, the service running the wallet may have logs of your IP, etc, so it may also be worse for your privacy.

A coinjoin helps obfuscate the traceable history of a bitcoin through time, an online wallet does no such thing.


Automatic transfer of funds between exchanges I need to circulate money between exchanges automatically. I want to transfer cryptocurrency (BTC, LTC) between exchanges. I find that these exchanges have API calls for withdrawal options: Cryptsy, Poloniex, Bitstamp, Bittrex and Bleutrade.

Is there any other way to implement this for the exchanges which does not provide withdrawal options via API? I also want to transfer USD between exchanges. Can I implement it programmatically i.e via API?

It's easy to transfer cryptocurrencies between exchanges, but there is no way to transfer USD without withdrawing to your bank account or some kind of e-wallet first. All exchanges I've seen do not allow withdrawals to third parties.


Converting a bitcoin miner for other use Is it possible if you purchased a bitcoin miner such as an antminer that cracks sha256 and edit the software so it could just crack normal sha256 hashes such as that you could use it with things like johntheripper or hashcat? I know us over in the hash cracking community would love to see such a great improvement in speed even if it's only for one specific hash type.

A bit of googleing landed me here: https://rya.nc/asic-cracking.html

Basically he says there are two main differences between mining and cracking.

knowing when your done
moving onto the next try

If just one of these things are implemented in the hardware, then there wont be much of a performance gain. But if they're both implemented in the firmware, you could potentially re-write it to suit your needs. So you'd really have to ask the manufacturer of the hardware.


Do you have to pay income taxes on Cryptocurrency in Canada? Cryptocurrency

Will i have to pay the income tax for that?

If so, how much will it be?
I can withdraw it here and it's not taxed. and then convert to CAD.

Yes, you have to pay income tax on Cryptocurrency in Canada.
Cryptocurrency is taxed like any other investment in Canada. 50% of the gains are taxable and added to your income for that year. Let’s say you bought a cryptocurrency for $1,000 and sold it later for $3,000. You would have to report a capital gain of $1,000 (50% of $2,000) which would be added to your income and taxed at your marginal tax rate.


Is it possible to definitely lose bitcoins? The maximum number of Bitcoin is 21 000 000.
However this number of Bitcoin may never exist.

Supposing someone have 5 BTC in their wallet. In order to protect them, they encrypted it and then forgot the passphrase, or die (sorry, this example is sad).
In this case, the real maximum number of usable Bitcoin would be 20 999 995...

Is that understanding correct? What do you think about this?

Yes it's possible to lose bitcoins forever.  There are even ways to "provably destroy" them by sending them to an address that can't possibly have a private key.


Questions about sendmany json-rpc 1 - Whats is the limit for sendmany?
2 - Can i batch a large number of payments (several hundreds)?
3 - Does an error in processing any address would interrupt the whole process?

There is no hard limit on the size of the amounts objects you pass, but you may at some point reach the standardness limits on transaction weight.
As only one transaction will be created, an error processing any address will interrupt the whole process.

For the sake of the example here is a regtest transaction with 802 outputs (could not copy paste here as it reached the characters limit).


Wouldn't compromised crypto require entire block chain to be recomputed? If one of the cryptographic building blocks of Bitcoin were to be broken, couldn't that result in the entire block chain needing to be recomputed? And how would that work, given the computational expense involved?

If one of the cryptographic building blocks of Bitcoin were to be broken

This is a difficult question to answer because Bitcoin uses so many.
SHA256d
This is Bitcoin's main hashing algorithm. It uses it for proof-of-work, building merkle trees, and lots of other stuff.
Collision resistance
If broken, you could create two blocks that hashed to the same thing. This would be bad because you could give both out, and nodes would think that they agreed, but they were actually talking about different blocks.
Preimage resistance
If broken, you'd have essentially infinite hashpower, and you could do the previous attack on blocks that had already been mined.
Mining faster than brute force
Currently, the fastest known way to get a hash that starts with lots of zeros is to just run through that hash lots of times. However, if you could figure out at the start that certain ranges of nonces weren't going to result in a block, you'd have a significant advantage over ASIC miners, who wouldn't be able to change the way they mined.
HASH160
Collision resistance
Irrelevant.
Preimage resistance
If broken, you could steal bitcoins.
ECDSA
If broken, you could steal bitcoins.
Final remarks
It's unlikely that every crypto primitive that bitcoin relies on would be broken. If they were, there are usually better primitives that could replace them.


Multibit balance per address I have a Multibit wallet with 2 receiving addresses and of course 2 associated private keys.

I am shown the current balance contained in the wallet but there is no breakdown of this balance according to which address/key holds exactly how much of it.  It seems like a strange oversight not to show this information?

I can go through the transaction log and see the transactions relating to each address and thereby work out how much of the balance is associated with each address, but this is arduous work for a person and a walk in the park for a computer!  So why doesn't it do it?

Or have I missed something?

Any ideas?

All transactions are added to the blockchain. If you need to use the bitcoins associated with a single address for payment, it will refer to the particular transaction from which it has received the bitcoins. The wallet stores each transaction separate so that you can see the transaction details (txid, sender, receiver, etc). Even though it shows the cumulative value of all the addresses, you don't have to worry of how much each address stores since the software will take care of combining multiple transaction outputs if need be. It would be easier to see the combined value of each address but then it makes it tougher to store individual transactions.


How many channels of Lightning Network can I open in one transaction? To open channel I should create a transaction with a special script and at least one output to P2WSH address. Is it possible to open more than one channel in one transaction if I created transaction with two or more outputs to different P2WSH addresses and relevant scripts?

Theoretically this would be possible but the entire work flow of channel creation would be disturbed as you would have to wait for the commitment signed message of each channel before broadcasting the funding TX.

Also currently the funding TX is used to verify the existence of a channel in the gossip protocol.

So yes theoretically this would work. Practicalky this would yield quite some protocol changes


Priv Key with 58 characters to WIF I have an old paper wallet with Private Keys of 58 characters (all starting with a 6). These can be imported e.g. on blockchain.com, but since I still have BSV on this key, I have to import/sweep it in ElectronCash or ElectrumSV, which doesn't take this format.
So, does anyone know, how to convert this key into WIF (without coding if possible)? Thanks in advance!

A private key starting with a 6... and being 58 characters long.. sounds to me like you encrypted another private key with BIP38?

Simply decode the private key using a third party tool and then import the decrypted private key into ElectrumSV.

consider the following  private key; L4GPduQvHAhFrpnF5x29N7UV8x5iLqxKRWArfHvJn4PwtZu35Uur and subsequent adress - 1He7vZABE7Um1dZG8b1sRCZLnXD3DX4ebB

which encrypted with password ppg gives the following 58 char bip 38 private key:
6PYKwd9VQNQsmEzy4UqKBDLQ6DhMUxzLGjgzmqzZSAuqm82EPg9HhRM6Qd

To decrypt this without coding, i suggest you use something like Ian coleman's templates, or those of bitaddress.
https://www.bitaddress.org/ download the repository, https://github.com/pointbiz/bitaddress.org , verify it, then run the HTML file.

Go to wallet details = > enter your encrypted private key ( in my case ; 6PYKwd9VQNQsmEzy4UqKBDLQ6DhMUxzLGjgzmqzZSAuqm82EPg9HhRM6Qd and tick the "BIP38" encrypt box and fill in the password; which for me is " ppg "
then; you get a couple private keys; compressed || uncompressed in your case.

in my case; i simply see the compressed private key i encrypted, and the uncompressed key; which i wouldn't need in this case, as my balance was on 1He7vZABE7Um1dZG8b1sRCZLnXD3DX4ebB (belonging to the compressed key.)

See which one match the adress holding the balance, and import that private key into electrumSV. You'll have to figure which derivation paths to use yourself i'm afraid.


How can you send a transaction directly to the memory pool? Is it possible to send a transaction to the bitcoin memory pool directly to have it mined without validating it?

There is no such thing as "the bitcoin memory pool". Every node has its own memory pool; it is not shared across all nodes in the network. A node can certainly add a transaction to its own mempool without validating it, but you cannot force other nodes to add a transaction to its mempool without validation. In fact, you can't force a node to add a transaction to its mempool, nor can you force a node to accept anything.


Does Litecoin have a higher chance of address collision than Bitcoin? I assume Litecoin has different rules of generating addresses with Bitcoin, since all Litecoin addresses are 34-characters long which is different than Bitcoin.

Given that the rules for generating addresses are different, does Litecoin have a higher chance of address collision than Bitcoin?

When encoding the 20 byte public key hash with base-58, a prefix for the version byte is prepended. In Bitcoin, this version byte is 0x00 so that bitcoin addresses always start with a 1. In Litecoin, this version byte is 0x48 so that addresses always start with an L. This also has the side effect that the base58 encoding of these hashes is 26-34 characters for Bitcoin, and always 34 characters for Litecoin. See https://en.bitcoin.it/wiki/List_of_address_prefixes

But this doesn't change the fact that there is 20 bytes of information being encoded (addresses are really just human readable short-hand for this 20 bytes of data), and each possible combination has a unique encoding. Therefore, the chance of address collision is exactly the same in the two coins.


Importing private key for watched address in bitcoind, rescan necessary? If I have a watch only address in my wallet and then I import the private key corresponding to it, will I need to do a rescan or will it automatically update my available balance with any UTXOs for that address (at least those created since I began watching it)? It seems to me like it shouldn't require a rescan but I'm wondering if anyone has actually done this successfully.

If I don't get an answer here after a while I can test it out myself and report back.

No additional rescan is required in that case.

Though there is a little bug in Bitcoin-Qt: the balance will not get properly updated if you import a private keys where you already have a watch-only script.

Bitcoind (listtransactions, getbalance, etc.) are not affected.


Do forum or website exist where can buy things not usually sold with bitcoin? Something like "wanted" classified advertisements is needed. Silk Road only sell offensive merchandise, no method to post wanted ads. Interested in purchase electronics, other legal unobjectionable products. Does website like this exist?

The Marketplace on BitcoinTalk can be used.  Simply prefix your post's title with "[WTB]" which means "Want To Buy".

Discussion:

http://bitcointalk.org/index.php?topic=64607.0

Marketplace board:

http://bitcointalk.org/index.php?board=5.0

Also, the Bitcoin-otc marketplace can be used to place requests, if you are looking to buy.

http://bitcoin-otc.com/vieworderbook.php


Is their any way to identify whether the miner is using renewable or non renewable energy for mining? Is their any way to identify whether the miner is using renewable or non renewable energy for mining ? in decentralized way?

No, this is not possible. Energy sources are not part of the blockchain.


Trading Bitcoins through binary miner I don't really understand how binary options work and someone recommended a company called empireoptionstrading.com for me to invest in.

I tried to find more information on the company but I don't really know what to check against the company before I give them my money to trade for me.
Is it a safe, reputable, legitimate, and reliable company to invest in?

Please advise.

Their homepage advertises them as:

  WORLD'S BEST RISK FREE FOREX, BINARY AND BITCOIN INVESTMENT

Any entity that advertises any form of trading as risk free is a scam. Essentially all binary options, mining investment, "automated trading" platforms are scams in the crypto space.

The only legitimate way to make money here is to (correctly) speculate yourself, invest in mining hardware that you operate directly, or build profitable services around the crypto ecosystem. Anything besides that is a scam.


January 19th, 2038: RIP Unix Timestamps Is there a plan in place for when the inevitable 32-bit overflow of Unix timestamps occurs?

How much will this impact existing blocks that are timestamped with Unix Epoch times?

The 32-bit signed integer timestamp runs out in 2038. But Bitcoin uses a 32-bit unsigned integer for the timestamp. That runs out it the year 2106. We'll have to find a solution by then, not by 2038. Since that is still a long ways off, there is no plan for changing the timestamps yet.

Whatever happens would not affect existing blocks. The same thing would happen as with any other fork: blocks prior to the activation block are verified with the old rules, and blocks following activation are verified with the new ones. So old blocks would use the current timestamp stuff and new ones would use whatever new scheme is created.


Bitcoin Core JSONRPC only accept requests with 0.0.0.0 in configs I've lunched a Bitcoin Core server, and trying to connect to it via JSON-RPC.
This is my configuration settings:

server=1
rpcuser=admin
rpcpassword=password
rpcport=1234
rpcallowip=94.183.32.151

But all cURL connections to this server via the IP 94.183.32.151 has the same error result as:

cURL error 7: Failed to connect to 94.183.32.151 port 1234: Connection refused

I tried adding this option too, but it did not solve the problem:
rpcbind:94.183.32.151

Only when I put 0.0.0.0 as a bined RPC IP, Bitcoin core returns true response. I've checked many pages but did not find any other appropriate way to allow some certain IPs to Bitcoind. May you help me please?

Note: IP, Port number, username and password are changed from real values.

If your server is behind a NAT or otherwise does not have 94.183.32.151 as the IP address for one of the network interfaces, then rpcbind=94.183.32.151 won't work. You can check what IP addresses your node actually has using ifconfig and then rpcbind=<ip> for one of those.

For example, because my node is behind my router's NAT, I have to do rpcbind=192.168.1.2 instead of binding to my external IP of 12.34.56.78.


Bitcoin cash testnet core crash Everytime when i run bitcoin cash testnet core on raspberry pi 3, it just stops for some reason and debug logs end at loading wallet.

So does the raspberry pi 3 cant handle bitcoin cash testnet wallet?

Here is the log that ends everytime:
2018-01-29 00:53:20 init message: Loading wallet...

Since it works without your wallet file, it is likely that your wallet has some sort of corruption which is causing Bitcoin ABC to error on start. Try starting Bitcoin ABC with -salvagewallet and see if it is able to recover the wallet to a working state.


How to set custom segwit change address in v0.15 Core via config We generated segwit addressess via addwitnessaddress command in v0.15 core client. Therefore receiving funds to our segwit addresses.

When spending those segwit UTXO, wallet creates a standard change address starting with 1. Is there a way to set custom change address (segwit preferable) in bitcoin core via config or some parameter (not via GUI). We wanted to contribute to segwit addoption, but this behavior is contraproductive. Any thoughts how to solve this?

The other problem is related to coin control feature on segwit addresses:
I used coin control feature to consolidate UTXO and send it to a single address (saving data on the blockchain becasue no change was created). However when using the wallet with segwit addresses it does not calculate size of transaction correctly - causing dust change.

Is there a way how to report this to core developers or any plans to solve this with core v16.?

Is there a way to set custom change address (segwit preferable) in bitcoin core via config or some parameter (not via GUI).

Not in 0.15 I believe, you would have to create a raw transaction manually with the change being sent to the address you wanted. Better support for segwit addresses is coming in 0.16

  Is there a way how to report this to core developers

Yes, you can submit bug reports to the issue tracker on GitHub here: https://github.com/bitcoin/bitcoin/issues


Including transactions in a block - rules and time / technical aspect I’ve a question regarding block and transactions included in the next block that is solved.

Let us assume theoretically that there is newly propagated solved block.

And now there are:
tx0 and tx1 – not included in propagated block with time of transaction earlier that solved block.

Tx2 – which was propagated 10 second after solving previous block

Tx3 -  which was propagated 60 second after solving previous block

Does the miners take only Tx0 and tx1, make hash and start to mine (already have hash of those) or (I presume this is not the case) are adding those tx2 and tx3 which was propagated in this “10 minute” window?

Presumably they would need to start all over again, but it would mean that when miner receive info about  new block that was solved by another miner stops working, puts all of transaction form block which he was solving, all transaction in pool (tx0 and tx1 in my example), check what transaction is already in solved block takes all reminding tx makes hash and start solving. Is that correct?

So basically my question is,  does the next block includes only those transactions that  were propagated BEFORE solving of current block and AFTER miners starting to find current block (so in this “10 minute window” or there are some other rules? I tried to find solution in docs but no success. (if anyone knows some source I would be grateful)

Best regards

There are no real rules, per se, just various optimizations.

ASICs are fast. They can burn through the entire 2^32 possible nonces for a given block in seconds, which requires miners to use the extra nonce field in the coinbase transaction to generate a new block header (since altering the coinbase transaction changes the merkle root) and try again.

This process can be done in parallel - a miner can prepare the N+1 block header by changing the extra nonce in the coinbase transaction while they are checking the Nth block header's 2^32 nonce values.

Similarly, transaction selection can also be done in parallel - a new block template can be created while a miner is operating on the previous one, and the new template's block header can simply be used when the miner swaps out the previous one after exhausting the nonce space (unless they find a valid block, in which case the template must be updated again).

This is what most mining pools do - the block template generate is done in parallel by the mining pool, and they continuously pass updated block templates to all of their miners. This allows them to quickly include high fee transactions in potential blocks while still ensuring that they are looking for a solution at all times.


Choosing Rights Host For Dependency Make I am working on on creating builds for windows, mac, and Unix. I am working on Ubuntu 18.04 but on a windows OS. I figured  out host-platform-triplets for windows and mac and generated prefixes for them but not sure how to determine the best Unix prefix. I was hoping to run this in a unix container out in gcp as a test harness. Any recommendations or guidance?

The following triplets are currently supported by Bitcoin Core's "depends" build system, assuming that's what you're talking about (and even if not, these are fairly standard). From https://github.com/bitcoin/bitcoin/blob/master/depends/README.md:

i686-pc-linux-gnu for Linux 32 bit
x86_64-pc-linux-gnu for x86 Linux
x86_64-w64-mingw32 for Win64
x86_64-apple-darwin18 for macOS
arm-linux-gnueabihf for Linux ARM 32 bit
aarch64-linux-gnu for Linux ARM 64 bit
powerpc64-linux-gnu for Linux POWER 64-bit (big endian)
powerpc64le-linux-gnu for Linux POWER 64-bit (little endian)
riscv32-linux-gnu for Linux RISC-V 32 bit
riscv64-linux-gnu for Linux RISC-V 64 bit
s390x-linux-gnu for Linux S390X

Added in master (which will become release version 22.0):

armv7a-linux-android for Android ARM 32 bit
aarch64-linux-android for Android ARM 64 bit
i686-linux-android for Android x86 32 bit
x86_64-linux-android for Android x86 64 bit

x86_64-pc-linux-gnu would be the most common one (targetting 64-bit x86 systems).


How to send requests to a testnet faucet to collect coins at my address? I am really new to Bitcoin and have just started reading about it.

From what I understand testnet Bitcoin can only be requested every 12 hours or so and yields a very low quantity. I would like to build a bot, so to say, which sends a request every 12 hours or so to a testnet faucet.

What I am looking for is a way to send a get/post request, so I can use shell script  or javascript to source the tBTC.

Could anybody point the right direction out to me.

What is the link? How to send the request? If there's a github repo about something related? Any documentation?

Any of these answers would be really helpful to me!

I don't know the github projects for this argument (also the question on the project here is off topic).

  I would like to build a bot

Why do you want to create a bot to request the tBitcoin? you have needed a big quantity of bitcoin for your application test?
if yes I think this is not a correct street, the Bitcoin testnet is a network for the developers and in this network, the money is mined my a low difficulty.
So for the respect of other developers if you have neet big quantity of tBitcoin to do mine it. (a reference for do it).

Another possibility is using the regtest network od bitcoin, (you can build your local network, a reference of regtest)

  What is the link? How to send the request? If there's a github repo about something related? Any documentation?

However, these reference of the faucet bitcoin testnet are available here but the request depend of the site that implements the faucet


Is there a precise open specification for the peercoin protocol? I searched for an open specification of the peercoin protocol (more precise than the white paper) and I couldn't find one. Is it possible to find something similar to the bitcoin protocol specification available on bitcoin wiki but for peercoin ?

Since most crypto-currencies are a fork of Bitcoin, you can get nitty gritty technical details from the Bitcoin wiki, specifically from the technical category.

Say you want to know the specifications for communication, the Protocol Specification article will help you out with how packets should be formatted down to the bit. It will have all sorts of details on things like how to calculate difficulty or what a block chain is.

Peercoin share a lot of concepts with Bitcoin and thus most Bitcoin wiki articles will apply. Peercoin concepts such as its Proof-of-Stake may not be found in the Bitcoin wiki so refer to the whitepaper for differences.


Blochchains that support data privacy and/or strengthen parties pseudonymity Question  1:  Is there any blockchain that allows users to store their private data in the chain? For instance, the transactions and amount of Bitcoin one has is hidden from others.

Question  2: Is there any blockchain that strengthens participants pseudonymity? so it won't be very easy to associate an owner of ID/transaction to a real person.

In terms of question 1, I'm aware that hyperledger does it, but the problem with this framework is that data and blockchain are encrypted using a single key and this key is distributed among the participants, but I think it's
not a sophisticated approach.

In terms of question 2, I've heard that there's a blockchain (I think it's called Zikas) that somehow mixes transactiontors but I'm not sure about it.

For question 1 and 2, ZCash (not Zikas) provides some solutions.
It's based on Bitcoin's code and has 2 types of addresses:

non-shielded: they behave exactly like normal Bitcoin addresses
shielded: you can't know how much they are transacting nor to whom they're sending funds (unless it's to non shielded addresses).

If you only use shielded addresses, and only send funds to shielded addresses, it's impossible (just from looking at the blockchain) to know how much zcash you have, nor with whom you're transacting with. However, creating shielded transactions is slow (it takes minutes IIRC), and your wallet has to scan the full blockchain to know if you've received payments.

OTOH, shielded transactions give you the possibility to attach a custom memo to them which will be private between you and the recipient.


What wallets are affected by the NPM package vulnerability? Recently, a vulnerability was found in an open-source project used by some bitcoin wallet software (such as CoPay and BitPay).

Are there any other wallets known to be affected by this vulnerability?

If I am a user of this software, what steps can I take to secure my bitcoin?

Only Copay is affected by this vulnerability.

Although the package was included by many, many projects (both within and outside the crypto space), the attack payload was encrypted, and used the package description as a decryption key. They key in question was found to be (via brute force) A Secure Bitcoin Wallet, which is the npm description for the copay-dash package.

Thus, packages which did not have that as their description would be unable to decrypt, and hence execute, the payload.

Note that such attacks are feasible on any package that does not verify and pin its dependencies, even outside the nodejs ecosystem. Developers should work to ensure that they are importing vetted code, and pin (or even vendor) their dependencies. This is especially important for programs that deal with private keys.


For Application Development is bitcoind RPC the Only Way? I am looking at building an application using Bitcoins, and being a newbie the only real resources I have found regarding how to interact with the network is to issue RPC commands to the bitcoin-qt client running as a service.

I've played with this a bit and I am curious if there are other clients that do the same thing? Or is this client the only game in town?

You have many options but Bitcoind is a popular one due to its initial ease.

Use Bitcoind
Use an API such as Coinbase or Blockchain.info be careful as these can be slow and not as secure.
Use one of the many libraries made for various languages. Bitcoinj for Java, Libbitcoin for C++, Gocoin for Golang, and for other languages like Python and Javascript you can always find tools in a github search. This is the search for Python libraries in python.


What are the consequences of donating bitcoins to WikiLeaks? The WikiLeaks website provides a bitcoin donation address 1HB5XMLmzFVj8ALj6mfBsbifRoD4miY36v

According to this article from the Sydney Morning Herald, Julian Assange of WikiLeaks has been declared an "enemy of the state" by the US.

  Declassified US Air Force counter-intelligence documents, released under US freedom-of-information laws, reveal that military personnel who contact WikiLeaks or WikiLeaks supporters may be at risk of being charged with "communicating with the enemy", a military crime that carries a maximum sentence of death.

Has there been any clarification or further analysis by US govt (or anyone) as to what the consequences would be of sending bitcoins to WikiLeaks?

Having been in the Army and understanding the stance that the US government has taken, I'm sure t will be up to the commanders.  Many of whom will not look kindly on the gesture.  The official stance will be known when they take action.

As you know the transactions are public and there are a number of efforts to build visualization and data mining tool sets.  This article address the anonymity of transactions and describes nicely why there is no real anonymity if someone wants to dig.

http://anonymity-in-bitcoin.blogspot.com/2011/07/bitcoin-is-not-anonymous.html

You'll also notice two other important things about the article.  One is that it focuses on WikiLeaks and that they are using Visualization tool sets.  this tells me someone is already looking to make connections.


Why does bitcoin use AES-256-CBC? Why does bitcoin use AES-256-CBC? Why not some other block cipher operation mode? Is there a specific reason?

Encryption isn't part of Bitcoin at all. Nothing on the blockchain is encrypted. There is no encryption in consensus or the P2P network.
Only wallets have encryption for protecting private keys. Bitcoin Core specifically uses AES-256-CBC because it is not known to be insecure and is widely used. Other wallets may choose to use other encryption schemes.


Antminer U1 running on raspberry pi not accepting shares I'm new to bitcoin mining and am trying to figure everything out still. My Antminer U1 running on my raspberry pi using cgminer is not accepting any shares, and doesn't appear inside of the mining pool's (bitminter) dashboard. Also my antminer which was advertised at 1.6 GH has only ever gotten up to 600 MH. Can anyone tell me why this is happening?

The line connected to mint.bitminter.com diff 512 means that the remote pool will only accept shares with an effective difficulty of 512 or above. Your miner has not yet found any shares with satisfy this rule, as noted by the line best share 57. It may take a number of hours at this speed to find a significantly difficult share that the pool will accept, when you do the log will print a line saying accepted or rejected depending on the pools response.

diff 947/128 in this case means the remote pool was asking for minimum difficulty 128, and the miner managed to find a difficulty 947 share which satisfied this requirement.


If your wallet.dat back up is outdated, do you lose your coins since the back-up? My last back up of wallet.dat was from the beginning of the year. My computer crashed recently and I don't have the most recent wallet.dat after receiving bitcoins. If I use my outdated wallet.dat, do I lose the new bitcoins I received?

If you made more than 100 transactions and individual receiving addresses combined, yes.

Best way to find out is to try.


Dark wallet stealth address Please can anyone recover my coins from a dark wallet stealth address, how do i go about recovering the private key?? i have the seed but i don't know what derivation path the stealth addresses are stored, please help me

Dark wallet (https://github.com/darkwallet) is essentially inactive and was alphaware, never meant to be used for production use. It was a grand experiment. Its architectural integration vision with libbitcoin is shown here at this deprecated webpage.

Take a look at https://monero.stackexchange.com/questions/1500/what-is-a-stealth-address/1506#1506 to understand what a stealth address really is.  Funds sent to a stealth address will require scanning a blockchain for appropriate OP_RETURN address to complete Diffie-Hellman key exchages to calculate private keys. There will be different private keys for each transaction sent using a wallet that supports stealth transactions. The libbitcoin-server (bs) indexes stealth transactions, see https://github.com/libbitcoin/libbitcoin-server/wiki/How-to-Initialize. The libbitcoin-explorer (bx) also supports bs stealth interactions, see https://github.com/libbitcoin/libbitcoin-explorer/wiki/Stealth-Commands. Good luck.


Robustness of bitcoin I am wondering about the consequences of a potential 51% CPU attack on the bitcoin blockchain. Imagine that a state invests enough computational power to rewrite from scratch an entire blockchain, longer than the current bitcoin blockchain (maybe because the state wants to control money). In this forged blockain all blocks would be empty (no transactions), which means the state  owns all bitcoins as the result of mining.

In that case would it really be the end of bitcoin ? I have the impression that it would be easy to patch the nodes on the network to dismiss the forged blockchain, for example by banning the state's public key.

That would violate the intent of bitcoin that mathematics and cryptography replace trust in a third-party, but eventually bitcoin is used by people who need to trust it. They wouldn't want all their money destroyed by an attack.

Or are there 51% attacks harder to detect and to patch ? I am not asking about  short-chains attacks that would only rob a few merchants, rather about the global stability of bitcoin.

The start of @Saxtheowl's answer is correct, such an attack requires a huge amount of capital and investment to pull off, as the attacker will need to invest in a huge number of ASIC miners, and gain access to a huge amount of energy. Once the attacker is set up, they face the dilemma of just mining honestly and gaining a reward for doing so (block reward + fees), so there is a large opportunity cost in attacking that must be considered as well.

You can take a look at the [majority-attack] tag to learn more.

  I have the impression that it would be easy to patch the nodes on the network to dismiss the forged blockchain, for example by banning the state's public key.

It is not possible to ban a miner from the network, because miners are not required to register with any authority/the network in order to submit blocks. A block does not contain a miner's public key, and in any case there is nothing stopping the miner from just creating a new key for every block.

There is no way to just 'switch to another chain', there is no mechanism in the software to do so, without human intervention. Human intervention requires trust (that you're going to choose the correct new chain), and it provides no clear means of determining which new chain is the correct one. This is the function of the PoW, after all, if people could just agree on which chain is legit without PoW, then we wouldn't need PoW in the first place! To make matters worse, the attacker can just as easily switch to mining on the new chain.

The only 'solution' is for the rest of the network to contribute enough hashpower to bring the attacker below 51%. Perhaps a change to the PoW algorithm could happen, but that is a very messy fix which will cause a lot of collateral damage (loss of confidence, drop in price, etc). A PoW change could also be attacked, so it is unclear if this is a reasonable approach.


Based on the coinmarket cap api, how do they calculate the bitcoin percent change I am trying to figure out how coinmarketcap calculates the bitcoin percent change for other coins. For example on ethereum:

I'm trying to figure out how they calculate that bottom BTC percent change 3.85%.

Their api (https://api.coinmarketcap.com/v1/ticker/?limit=100) spits out this data:

{
    "id": "bitcoin",
    "name": "Bitcoin",
    "symbol": "BTC",
    "rank": "1",
    "price_usd": "8397.08",
    "price_btc": "1.0",
    "24h_volume_usd": "8190950000.0",
    "market_cap_usd": "141531834530",
    "available_supply": "16854887.0",
    "total_supply": "16854887.0",
    "max_supply": "21000000.0",
    "percent_change_1h": "-0.51",
    "percent_change_24h": "1.0",
    "percent_change_7d": "-1.88",
    "last_updated": "1518191066"
},
{
    "id": "ethereum",
    "name": "Ethereum",
    "symbol": "ETH",
    "rank": "2",
    "price_usd": "846.675",
    "price_btc": "0.101377",
    "24h_volume_usd": "3096660000.0",
    "market_cap_usd": "82559453770.0",
    "available_supply": "97510206.0",
    "total_supply": "97510206.0",
    "max_supply": null,
    "percent_change_1h": "-0.2",
    "percent_change_24h": "4.14",
    "percent_change_7d": "-5.14",
    "last_updated": "1518191052"
}

The first number is stated in this "percent_change_24h": "4.14" but they dont show how they came up with that second number ( 3.85% ).

Is there some formula I can create with the data they provide?

Thanks

Well, you have all the information you need:

Compute the price of your coin 24h ago (in USD)
Get the price of the bitcoin 24h ago (in USD)
Compute how much bitcoin your coin was worth in BTC 24h ago using the two previous results
Compare with the current BTC value of your coin

Done :)


Why are there such huge differences between commissions on different exchanges? Why are there such huge differences between the commissions applied by sites like Bitstamp.org (0.5-1%) and other sites (I have seen 5-10% fees)?

It varies from exchange to exchange because people running exchange are different with different thinking. Me and my brother runs a website where we sell coins in exchange of USD(we are not a exchange anyway just small dealer) we do charge some fees but the difference here is my brother will charge a customer upto 20% higher than actual rate on the other hand(u have different fingers) I charge only that amount which is reasonable.


How to tell if Lightning nodes are lnd, c-lightning, eclair I am performing some experiments on the Lightning Testnet Network. I would like to perform the experiment on the 3 main lightning implementations, for which I would like to be able to connect and open a channel with an lnd, c-lightning and eclair node.

Is there a list of lnd, c-lightning, eclair nodes that are announced? even if just in testnet?
Is there a way of knowing this?

As far as I know there is no way of knowing this on a protocol level... What you could do is to set up your own nodes (each node with a certain implementation) or some people say publicly which nodes they run. For example my node is c Lightning, ACINQ is using eclair and I believe rompert is running on lnd.
Also on 1ml.com some owners register their nodes and tell what they are running. Of course they could lie...


Number of nodes and channels in Lightning Network? (1) Is there any tool by which we can know the current number of nodes (participants as payer/payee) and number of channels in Lightning Network with an accurate estimation?

(2) As a more advanced query, is it also possible to know the topology of this graph? (vertices as participants and edges as channels)

As for (1) yes you can use tools like the recksplorer as suggested by JBaczuk but you can also query the gossip store of your lightning node directly. Each node has to know the entire topology of the network for source based routing. C-Lightning provides a command line interface to retrieve this data.

However nodes can have private channels or be even private themselves. So with the Recksplorer which utilizes the Gossipstore and with the Gossip store you will only get a fraction of the Lightning Network. People Using Bitcoin Lightning Wallet or Eclaire mobile Wallet will currently not be public.

As for (2) I have created an autopilot for c-lightning with the python client library which analyzed the graph with the networkx module of python. you can check out the code at this pull request: https://github.com/ElementsProject/lightning/pull/1888 This should give you a starting point for doing more statistics about the topology.


Why DARPA wants blockchain based secure messaging system DARPA (US Defense Advanced Research Projects Agency) has released a Request for Proposal for a Secure Messaging Platform using a blockchain framework.

The following is the Objective paragraph from DARPA's call for proposal:

  OBJECTIVE: Create a secure messaging and transaction platform that separates the message creation, from the transfer (transport) and reception of the message using a decentralized messaging backbone to allow anyone anywhere the ability to send a secure message or conduct other transactions across multiple channels traceable in a decentralized ledger.

The request for proposal is available in full, here:
DARPA Call for Proposal for Secure Messaging Platform.

Why are contemporary secure messaging platforms like TextSecure, Cryptocat, XMPP/OTR, Bitmessaging and so many more NOT enough?

What do these contemporary solutions lack, as the Secure Messaging Scorecard suggests many applications have all these features?

What does blockchain provide when it comes to Secure Messaging and why it is necessary?

How can Military Interdepartmental Purchase Requests (MIPR) be implmented using the secure ledger or blockchain?

In particular, this paragraph of the proposal is not making sense to me

The messaging platform would act as the transport for a cyptographically sound record of all transactions whether they be MIPRs, contracts, troop movements or intelligence. Troops on the ground in denied communications environments would have a way to securely communicate back to HQ and DoD back office executives could rest assured that their logistics system is efficient, timely and safe from hackers. The benefits are broad and could even be applied to domains such as space. With crowded skies it’s important to maintain situational awareness of all satellites and those concerned with space situational awareness/telemetry or air traffic control could instantly share data between nations using a separate but equivalent ledger implementation thus removing questions as to the authenticity and integrity of the data.

What does transport mean here?
How does blockchain help troops communicate in denied communication environment help?
I am also not clear about the argument on situational awareness of satellites and how does blockchain enable sharing data between nations.

Simple answers would really help me and others like me. Thanks

As I see it, the key part is at the very end: "traceable in a decentralized ledger".  That feature isn't described in the EFF page you cite, and I'm not aware that any of the services listed provide it.

To see why this is important, imagine a scenario like the following:

Major Smith receives a message at 0400 hours from Battalion HQ about impending enemy action.  But he's too busy playing Angry Birds and doesn't bother to pass it along to his units in the field.  The enemy attacks at 1100 hours, the field units are unprepared, and they are defeated with heavy casualties.  Major Smith is afraid he will be court-martialed for failing to share the intelligence with his troops.  So he writes a message, backdated to 0500 hours, addressed to Captain Jones and ordering him to contact the field units and give them the information.  He also secretly orders (or bribes) Corporal Johnson, an IT administrator, to alter the message system's logs to show his forged message as having been sent at the appropriate time.  This way, he can blame Captain Jones for failing to act on the message, or at a minimum, plausibly claim there must have been some sort of communication failure that kept Jones from receiving it.

If there is a secure decentralized ledger of all messages sent, then Smith can't insert his fake backdated message in it, and there's no single person he can bribe in order to get it done.  So he can't dodge responsibility for shirking his duty.

A secure decentralized ledger is precisely what a blockchain provides.


I bought a bitcoin before my client sychronization was finished. Will I get the coin? I bought a bitcoin before my client synchronization was finished.

Will this stop me from getting the coin or will it just come later when the wallet is synchronized?

No, it will not matter.  Sync only affects the readiness of your client.  The purchase is reflected on the public blockchain, which has nothing to do with whether your client is ready or not.


Are bitcoins INHERENTLY fungible? Does each bitcoin has a unique identifier, like currency notes have serial numbers? If so, could you trace a particular bitcoin's ownership chain (ie find the current owner of a particular bitcoin by its identifier)? The answer I'm finding is no:

  There are also specific features of Bitcoin that make this difficult. Transactions put all the input Bitcoins into a big pile which they dole out as outputs. There's no concept of particular output Bitcoins corresponding to particular inputs. Bitcoins don't have a serial number that can be traced through the block chain. So any such tracking rules would be basically arbitrary.

  https://bitcoin.stackexchange.com/a/2139/894

Is this accurate?

That is accurate. Let me start explaining how Bitcoins work from the beginning:

Bitcoins are first created when they are mined by solving a block. The first transaction in the block is basically you saying "I'm giving myself 50 Bitcoins to my address A" (plus transaction fees from the block).
When you want to spend Bitcoins, you have to point to one or more transactions that show where you got them from, and say how many Bitcoins you are transferring where. It's like saying "I got Bitcoins at transaction X. I'm sending 20 coins to address B."
The point is that more often than not you don't want to send all the coins you got from the transaction, so you also specify how much change you are sending to another address, usually controlled by yourself: "I got Bitcoins at transaction X. I'm sending 20 coins to address B and 30 coins to address A."
Since all of the above is cryptographically signed, one can be sure nobody can spend coins they don't have (spending more than they have, spending someone else's coins, etc).
To make sure nobody is cheating, everyone is looking at everyone's hands by checking each transaction that comes their way. If you cheat, your transaction does not get forwarded.

I hope that explains the concept of how Bitcoin works in regards to your question. Just to be clear:

"Does each bitcoin has a unique identifier, like currency notes have serial numbers?"

Not like currency (that each bill has a serial number and you can't break them apart), more like bank statements (the identifier identifies the transaction on a certain amount of Bitcoins), but that's still a simplification.

"If so, could you trace a particular bitcoin's ownership chain (ie. find the current owner of a particular bitcoin by its identifier)?"

You can trace the history of transactions on the set of Bitcoins up to who mined them, but not on a particular 1BTC. It's like saying "Alice paid Jill $10. Jill got $20 from Bob. Bob got $50 from the mint."


How does Ripple ensure that transactions take place I am struggling with some concepts in the Ripple system.

As I understand it:

After an American user goes to  a gateway and loads $ into the Ripple system that he wants to send to Cambodia, the money will be sent through the Ripple Network by modifying the accounts of ripple users between the sender and the receiver of the money. At the point it reaches the Cambodian, if he wants to access the real world fiat money, he will go to another Gateway and redeem the money so long as they have a store of $.

The questions that I have are:

How do individuals set who they 'trust' to ensure that accounts remain active and the flow of debts remains valid?

How does the system respond if a user goes bankrupt and becomes unable to pay any debts that he has?

What happens in the situation where there is no line between the sender and the receiver of money or where there is no Gateway that the receiver can use to redeem money?

How do individuals set who they 'trust'

Not sure what this means; each individual decides on his own who to trust. For example, I already (in a general sense) trust Bitstamp if I have USD or BTC deposits with them. Ripple just allows you to make this trust explicit in an open ledger. The meaning of this trust is, if I specify a trust level of $100, that the system will allow me to hold up to $100 of Bitstamp IOUs.

  How does the system respond if a user goes bankrupt

The system doesn't respond at all, as it merely keeps track of the IOU amounts - it does not, and cannot, enforce these claims. If one is willing to hold the IOU, it's probably because they believe it represents a claim that's enforceable in a court of law.

  What happens in the situation where there is no line between the sender and the receiver of money

Where there is no trust line, a transfer is not possible at all. If finding a trust path is difficult, one option is for them to offer liquidity in XRP - the only Ripple asset without counterparty risk. Then anyone who, on his own end, has path access to XRP will be able to send funds - the XRP acts as the 'trustless' bridge or vehicle currency.

Note that this is the role played by bitcoin in many situations today; for example bitcoin is used as a vehicle currency in various remittance models, and is able to offer advantages precisely because of its low trust requirements.

In the end, XRP and BTC will compete for liquidity; whoever has the higher liquidity will have the lower costs.


How to calculate the average worker hashrate on a pool? I just calculated the average hashrate of all poolminers on Slushpool by dividing the Pool Scoring Hash Rate by the amount of active workers:

So with current values that is: 641.1 Ph/s / 30287 ~= 21,2 TH/s

Is this the right way to do it, or am I missing something?
That seems to be pretty high ...

This seems correct, as far as I understand.


Why does BIP141 define both virtual transaction size and weight? Why does BIP 141 (segwit) define both virtual transaction size and weight?

Weight seems to be just four times virtual transaction size (or vice versa, depending on what you define first). Why are both needed?

The transaction limit under segwit is derived solely from the transaction weight and the block weight limit of 4,000,000 weight units.

Virtual transaction size was not used for the limit calculation because it is fractional when computed accurately. Bitcoin Core only uses integers in the consensus code and thus transitioned to transaction weight.

Virtual transaction size is merely provided as a convenient way of comparing segwit's effective transaction size to current transaction sizes.

Adding a quote of the section to clarify: BIP141 specifies the following terms in regard to transaction size:

  Transaction weight
  is defined as Base transaction size * 3 + Total
  transaction size (ie. the same method as calculating Block weight from
  Base size and Total size).

  Virtual transaction size
  is defined as Transaction weight / 4 (rounded
  up to the next integer).

  Base transaction size
  is the size of the transaction serialised with
  the witness data stripped.

  Total transaction size
  is the transaction size in bytes serialized as
  described in BIP144, including base data and witness data.


Is there a way to know the type of dogecoin wallet through the receiver address? I am confused right now! I mistakenly withdrew my dogecoins to an old wallet that I have no memory of. So I want to know if there is a way one can guess a wallet type through the receiver address.

This is my receiver address:
D6zUZ42K8bo7qwbHXsMEerjuEYbdqvFAHK

This is not possible. Addresses are indistinguishable, and there is no way to determine which wallet generated any address, since the process is wallet agnostic.


Issue with the BitcoinJ for Litecoin. Which dependency can be used for Litecoin? I've created a crypto-currency wallet for Bitcoin using BitcoinJ. Now I want to add Litecoin in this wallet. How to implement BitcoinJ dependency for Litecoin?
While using BitcoinJ for both Litecoin and Bitcoin, I was getting blockchain of Bitcoin for both the addresses. What should I do so that I can get Bicoin blockchain for Bitcoin address and Litecoin blockchain for Litecoin address?

here is dependency which is I used>>>

  implementation 'org.bitcoinj:bitcoinj-core:0.14.7'

here is my code for bitcoin blockchain download initialisation>>>

  public void initWallet() {
    ECKey key;
    String btcpri =
     "cxxxxxre75ENAnpGjUr8EEdP2kxtvk1r65nTydnM954n4WxxxxxM";
    if (btcpri.length() == 51 || btcpri.length() == 52) {
        DumpedPrivateKey dumpedPrivateKey =
        DumpedPrivateKey.fromBase58(params, btcpri);
        key = dumpedPrivateKey.getKey();
    } else {
        BigInteger privKey = Base58.decodeToBigInteger(btcpri);
        key = ECKey.fromPrivate(privKey);
    }
    Log.e("key ", String.valueOf(key));
    setBtcSDKThread();
    BriefLogFormatter.init();

    kit = new WalletAppKit(params, file, "btc_justbitcoin") {
        @Override
        protected void onSetupCompleted() {
            wallet().importKey(key);
            setupWalletListeners(wallet());
            Log.e("Address ",
            String.valueOf(wallet().freshReceiveAddress()));
        }
    };
    kit.setBlockingStartup(false);
    kit.startAsync();
    kit.awaitRunning();
 }

use an alternative library to me I like this gives you more flexibility and uses bitcoinj

https://github.com/dogecoin/libdohj


When using bitcoin-cli I get an error regarding fallback fees when trying to send regtest Bitcoin. How do I resolve this? I have been doing an assignment on Bitcoin Core 0.20. Now every time I try to do a transaction:
Apples-iMac:bitcoin apple$ bitcoin-cli -regtest sendtoaddress bcrt1qd3jck0lv87yuk25tk3xy5rqq67apwasee874xk 25
error code: -4
error message:
Fee estimation failed. Fallbackfee is disabled. Wait a few blocks or enable -fallbackfee.

Can some one help me - what should I change? Please give a step by step guide as I am a complete newcomer.

bitcoind uses transactions it relays (and later see as mined) to estimate the feerate to set for transactions its wallet creates.
On regtest, you don't relay then mine enough transactions so bitcoind's estimation buckets are not filled enough to give a reliable estimate. Without such an estimate the wallet, out of safety, prefer not to create any transaction unless you explicitly tell it what fee to use when fee estimation isn't available.
This "fall back feerate" can be set up at bitcoind's startup with the fallbackfee startup option, expressed in BTC/kB.

   -fallbackfee=<amt>

         A fee rate (in BTC/kB) that will be used when fee estimation has
         insufficient data. 0 to entirely disable  the  fallbackfee  fea‐
         ture.  (default: 0.00)

Alternatively, crafting transactions on different nodes of your regtest network and getting them mined will result in estimation buckets to be filled.


Bitcoin 51% majority miner attack - question on the role of user activated soft forks as defense tactic If one mining entity has alone 52% hash power of the overall network, then this party can block transactions for example and try to "build" up a forked, longer chain while time passes, right?. As I understand this may take several weeks with only 52% hash power...

Can someone please explain, how the feature of "user activated soft fork" may be an instrument for the network users to rescue and keep the "current" blockchain version, and escape from the attacker? How would this play out ideally from perspective of the users (full node users)

Thank you

A soft fork describes a situation in which the consensus rules of the network are tightened: in simple terms, something that was allowed before is no longer allowed.

After a soft fork, old nodes will still be a part of the network, even if they are unaware of this rule-tightening. However, miners will need to craft blocks according to the new rules, or else the nodes running the new code will ignore their blocks.

The term ‘user activated soft fork’ more specifically refers to a soft fork that is initiated by nodes, instead of miners.

With that in mind, a user activated soft fork cannot protect against a 51% attack, because there is no way to tighten the rules which would exclude a single miner from being able to create blocks. A valid block requires no identifying information from the miner, it is simply seen by the network to either be valid, or invalid.

Proof of work is the method by which the network’s history is secured. If this method fails, it is unclear how the network’s nodes could coordinate to continue onwards honestly. Some people have suggest changing to a different proof of work algorithm, but if an attacker can gain enough resources to outrun the entire honest network of SHA256 miners, I’m not sure I see any reason why they couldn’t just do the same for the next algorithm as well.

Forking to a different consensus algorithm (ie, not proof of work) is another option, but I am yet to see an algorithm that provides the same security and economic guarantees that proof of work does, so this option has an unclear future at best. Such a change would likely require a hard fork to execute cleanly anyways, so it seems to be outside the scope of this question.


How does bitcoin core choose which node to broadcast to? Any vulnerability? I suppose the nodes would only listen and re-broadcast new block from and to a limited subset of other nodes (assuming the block is valid).

How is this subset chosen? Does Bitcoin Core software choose them? (if one uses it)

I'm thinking if most of the nodes are listening to only the "popular" sources, then these sources would have too much power to influence what nodes will or will not hear. (Like how the media in real life affects people)

Thanks

The Bitcoin Core connected outbound nodes are chosen using a random method. The only time that they are very predictable is if nodes are manually added.


When does bitcoin wallet subtracts the coins spent by that particular address? After how many confirmations does the bitcoin wallet subtracts/updates the account balance in respect of respective wallet address.

Bitcoin Core does not have a concept of address balances.

It has a concept of a wallet balance. The wallet balance is the sum of the values of all the transaction outputs that are:

Not serving as input to any (confirmed or unconfirmed) transactions that are not abandoned.
Either:

Confirmed (at least one confirmation)
Unconfirmed, but produced by a transaction that we signed ourselves ("change").


When will a block not be forwarded? I'm currently trying to detect blockchain forks and I noticed that even when dumping all blocks I get to a separate file I seem to miss a few.

Specifically I'm looking for the blocks marked as orphans in blockchain.info/orphaned-blocks in my dump and I'm missing quite a few.

Now I'm wondering whether nodes stop forwarding blocks that they believe to be orphans (because they currently have the concurring block as their blockchain head)? Shouldn't all concurring blocks be distributed?

Blockchain.info stores information in a database, it does not show only the information that is currently in it's Bitcoin. It is connected to many nodes, so it may see information your Bitcoin doesn't, and will store data after a normal Bitcoin client would discard it.

Bitcoin uses a basic rule "I'm going to use the first block I receive as the current best block". The duplicate numbered orphaned block was usually broadcast too late to everybody. If the "unpopular" later block is somehow the one that is next built upon, there will be many requests between clients for the correct blockchain up to the new block.


Payee identity verification When reading the Bitcoin paper by Satoshi, I noticed that he didn't mention any protocol by which the payer can verify the payee's identity, i.e. he is indeed paying the intended recipient. I would be much obliged if somebody can give me an idea on how does it work in real-life transactions or point me towards some definitive article. Since as far as I know, bitcoin doesn't use any central trusted party, so basic digital signature can be vulnerable to MITM attack.

Thank you.

BIP 70 addresses the issue in merchant/customer use cases:

https://github.com/bitcoin/bips/blob/master/bip-0070.mediawiki

As to individuals I guess there's still room for improvement. Meanwhile check out the following website:

http://onename.io

It's worth noting that by using a single address anonymity is basically thrown away (e.g. everybody can see your balance).


How to create a receiving address using the Bitcoin Core client? Im new on bitcoin 1-2 years ago I used bitpay and coinbase but now Im trying to get the wallet directly on my macbook.Downloaded the bitcoin core from bitcoin.com

So, Im registered on https://gourl.io to use a plugin for the wordpress but in their site, a field in the form is asking me for the external wallet address.

Any one is selling digital products using edd and gourl.io ?
Can some one explain what should I do and where can I find my wallet address?

Thank you!

Click "Receive" tab >>> Click "Request payment" button

Note: "Label", "Amount" and "Message" fields are optional

View Receiving Addresses: "File" >>> "Receiving addresses..."


Is bitcoin actually some sort of private key? I read about bitcoins, block chain etc, but i am confused in one basic element.

What actually a bitcoin, is bitcoin actually a pseudo-random private key that is assigned to miner as a reward when he solves computational puzzle?

When person A sends bitcoin transaction to person B, actually means he gives private key of those bitcoins to person B?

Really there are no bitcoins, just transactions. A transaction will have outputs of specific amounts, and if you have the key to spend a certain output but haven't spent it yet, it is known as your unspent transaction output (UTXO), and the amount of all your UTXOs is known as your balance. The private key is what allows you to spend a transaction output, it provides the proof you own it. And you don't send your private key when you make a new transaction, you simply sign a new transaction with your key to spend the UTXO you 'own', and create new outputs owned by the recipient, usually by assigning the outputs of the new transaction to their public key / bitcoin address.

The miners are also given bitcoins through special transactions known as coinbase transactions, which don't have inputs because they are creating brand new coins, but still have outputs to be spent by the miner.


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

This is on the to-do list for the developers.  One proposal is to remove transactions that have been completely spent if they are fairly deep in the block chain (that is, there is minimal chance that a block chain reorganization could occur which would affect the transaction)


call to bip39_mnemonic_from_bytes in libwally-core returns NULL what am I doing wrong? it always returns with error -2... I included libwallycore to my project and my IDE tells me it it is available after I also did include <wally_bib39.h>

I tried mainting a wordlist myself but then I run into even more mistakes so I guess I am missusing the API. Ca anyone help out pls?

static void display_mnemonic_word_list(void){
    char **mnemonic_secret=NULL;
    //wordlist_init(bip39_wordlist)
    const unsigned char myArray[] = { 0x00, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22,  0x33 };
    int ret = bip39_mnemonic_from_bytes(NULL,myArray,32,mnemonic_secret);
    if (ret!=WALLY_OK){
        printf("mnemonic did not work. error: %d",ret);
    }
    printf("HSM: your should remember / write down the following words do recover your funds!");
    if (mnemonic_secret){
        int i = 0;
        while ( *mnemonic_secret )
            printf( "%d. %s", ++i, *mnemonic_secret++ );
    }
}

There are a few problems, you are passing mnemonic_secret incorrectly resulting in the API call getting a NULL pointer hence returning WALLY_EINVAL. Here is a corrected version, although note that your myArray is still the wrong size:

#include <stdio.h>
#include <wally_bip39.h>

int main()
{
    /* Note that this array is 34 elements long which seems incorrect, it should be 32 */
    const unsigned char myArray[] = { 0x00, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22, 0x11, 0x22,  0x33 };
    char *mnemonic_secret;

    int ret = bip39_mnemonic_from_bytes(0, myArray, 32, &mnemonic_secret);
    if (ret != WALLY_OK) {
        printf("mnemonic did not work. error: %d",ret);
        return 1;
    }
    printf("HSM: your should remember / write down the following words do recover your funds!\n");
    printf("%s", mnemonic_secret);
    wally_free_string(mnemonic_secret);
    return 0;
}

You may get a faster response with wally question by asking on their github at https://github.com/elementsproject/libwally-core.


Are transaction fees required now? Is there any way to avoid them? I have been using blockchain.info's my wallet to perform transactions, one of the reason I liked it was because I could choose to not pay a transaction fee. But recently I noticed blockchain.info's interface has changed, there's no way to not include a transaction fee now? (or am I wrong about that?).

Was there a change in the Bitcoin protocol to require transaction fee? or are there still clients available that has the function of not paying a transaction fee?

Use Send Custom for full control over fees.

Click Send Money tab, then on the left menu under Transaction Type click Custom.

This URL might get you there.

https://blockchain.info/wallet/login#send-custom


How can I get UTXO for a specific address? Are there API's I can use to get this information?

You can use Electrum servers via blockchain.address.listunspent

An example implentation: [1] that calls [2] (Note: this is an altcoin implementation)


The short answer is no, because you can run Bitcoin Core with -nocheckpoints, and different versions may have different checkpoints.

The long answer is that it doesn't matter. If checkpoints ever actually prevent a reorganization of a fully synchronized client, it means that the assumptions on which Bitcoin's security relies (collusion of a majority of hashpower to rewrite the blockchain is too uneconomical to ever be a problem) are fundamentally broken. Checkpoints are not a security feature for this reason, and are often mistaken for one.


Does a new nodes verify all transactions or only blocks When a node downloads the genesis and all blocks, does it verify all past transactions, or just the blocks (eg check the nonce/hash relation, thereby assuming the containing transactions must be right?)

New full nodes verify both blocks and transactions within those blocks. New SPV clients verify only block headers.

Bitcoin Core avoids checking signatures on blocks before the most recent checkpoint. Checking signatures is one of the most time-consuming parts of checking a block. (As of writing, the last checkpoint was on April 2014, 2.5 years ago.) This can be disabled by setting the option checkpoints=0.


What happens to cash used to buy bitcoins? Are there any requirements to Bitcoin exchanges [USD/EUR/etc], as to for what the [USD/EUR/etc] may be used? Or is the [USD/EUR/etc] received property of issuer of bitcoins?

Unfortunately, this is not decribed anywhere.

Bitcoin exchanges, like stock exchanges, act as a middleman for people that want to trade bitcoins. They do not sell/buy their own bitcoins or US Dollars.

Suppose that I have 10 bitcoins and I want to sell them at $5 each. In order to do that, I can use a bitcoin exchange and put a sell order at $5 for 10 coins. This is a way of "announcing to the world" that I will sell 10 coins to anyone who is willing to pay me $50. If you want to buy them, just login to the exchange and put a buy order at $5. The exchange will match our orders and I will receive your $50 and you will receive my 10 bitcoins.
When a buy order matches a sell order, a trade is made. This is how the bitcoin price is defined.

Now suppose that you want to buy bitcoins, but you are only willing to pay $4.9 for each bitcoin. You will put your buy order at $4.9, but it will not match mine because I only sell if you pay me $5 per coin. The amount of pending orders defines market depth.

For example, you can see here the market depth for MtGox. The bids table show the price people are willing to buy at and the asks table show price people are selling at. MtGox Live is also a nice way to visualize these concepts.

Note that bitcoin exchanges charge a small fee (currently around 0.5%) each time they match an order. So in the previous example I would receive $49.75 and you would receive 9.95 bitcoins. The rest is kept by the exchange for their services.


Which fuzzer should I use to fuzz test Bitcoin Core? In the Bitcoin Core fuzzing docs there are setup instructions for three different fuzzers: libFuzzer, american fuzzy lop (afl-fuzz) and Honggfuzz. Presumably I should try them in this order. How do they compare? Should I use one particular fuzzer in one scenario and a different fuzzer in another scenario? When I engage in fuzz testing should I run all of them one after each other?

This is a work in progress answer with some content currently taken from the Google fuzzing docs.
libFuzzer
libFuzzer is a tool which allows you to write fuzz tests in a similar style to unit tests. For developers setting up fuzzing for the first time, the Google fuzzing team recommends it for its simplicity.

[It] might be a good choice for testing libraries that have relatively small inputs, each input takes < 10ms to run, and the library code is not expected to crash on invalid inputs. Examples: regular expression matchers, text or binary format parsers, compression, network, crypto.

See http://llvm.org/docs/LibFuzzer.html#q-so-what-exactly-this-fuzzer-is-good-for for more information on how libFuzzer compares to other fuzzers.
AFL
AFL is the tool that did the most to drive the early success of coverage-guided fuzzing. The Google fuzzing team does not recommend AFL for new projects since it is not as well-maintained as Honggfuzz or libFuzzer. That said, because of its widespread it is common to encounter existing projects which rely on it for fuzzing.

Compared to other instrumented fuzzers, afl-fuzz is designed to be
practical: it has modest performance overhead, uses a variety of
highly effective fuzzing strategies and effort minimization tricks,
requires essentially no configuration, and seamlessly handles complex,
real-world use cases - say, common image parsing or file compression
libraries.

See https://lcamtuf.coredump.cx/afl/ for more information on how afl-fuzz compares to other fuzzers.
Honggfuzz
Honggfuzz is another fuzzing tool with a rich set of features available to it. The Google fuzzing team recommends it for security researchers looking for more customization options in their fuzzers, or developers on complex projects where working within libFuzzer's unit-test-like style is difficult. It allows users to specify how input files should be fed to a target program (e.g. on the command line, on stdin) or allows more complicated customizations such as feeding input to a network server directly.


How did the FBI "seize 260000 BTC"? http://www.zerohedge.com/news/2013-10-08/bitcoin-1-0-fbi

How did the FBI seize 26000 BTC? I thought that all wallets are supposed to be safe. Can you give the technical details?

To participate in Silk Road, users had to deposit funds with Silk Road. The FBI gained access to the private keys corresponding to these user balances. Thus, the FBI was able to transmit the funds to an FBI controlled wallet and confiscate the assets.
Following up on the question how they might have gained access:
The software running on the Silk Road server must have had spending access to the Silk Road users' internal balances. Therefore, there must have been a mechanism to unlock the wallet (assuming an encrypted wallet was used). The passphrase would have been available to the program, concluding from the outcome, likely in the files on the server. As the server was probably running when it was seized, the FBI might have been able to access the files directly and thus gain access.


Can decentralized blockchain technology like bitcoin be used to store medical information? For example patients get private key, providers get public key?

The blockchain is used for more than just storage of data. To store data, all you need is a harddrive of some sort. What kind of things would you like to be able to do with this 'medical blockchain'?

I think that in general, everything medical would be considered confidential, so even if it could be stored in a blockchain, no one would want to.


During Bitcoin Script execution, what is the significance of the signature verification in the stack? During execution of the script i.e. ScriptSig + ScriptPub , the last step is the verification of the Signature against the public key provided by the recipient. How does this work and what is the significance of verifying two entities which belong to the same user?

How does this work

Bitcoin uses the Elliptic Curve Digital Signature Algorithm. The algorithm is described on Wikipedia (linked). Bitcoin specifically uses the secp256k1 elliptic curve.

  what is the significance of verifying two entities which belong to the same user?

There are not two entities.

The signature proves that the owner of the private key which corresponds to the public key created the signature over a given message. In the case of Bitcoin, the message is the hash of the transaction (excluding the signatures themselves because they don't exist yet). This ensures that the person spending the output is allowed to do so and ensures the integrity of the spending transaction itself.


What happens an order and offer are matched but there is a significant gap between them? I wonder the implications of the following scenario.

Let's assume I offered one coin with the price 1k (by mistake or for experiment), while the highest order in the market is 2k. What are the prices I'm going to pay and the matching order is going to receive. How would this affect the current price of the market? Thanks

It depends on the exchange; they will have rules for how order matching is handled.

On at least one of the exchanges I have used, if there existed a buy order for 1 coin for $2000 and you added a sell order with a $1000 limit, then you would get $2000. If however, the buy order at $2000 was only for 0.6 coins then you would sell 0.6 coins at $2000 and the remainder of your sell order (0.4 coins) would be matched by the next highest buy order, eg $1950, provided that another buy order existed at or over $1000.

I would expect this behaviour to be more common amongst exchanges that what @chytrik described in his answer.


Radeon RX 580 8GB vs 4GB. Does memory matter? Does GPU with more memory provide better mining for Ethereum? Here is a Quora an answer:

  In general, 4GB is sufficient for even the most demanding hashing
  algorithms and you will not see any performance gains just by having
  more memory. This is where the speed and quality of the memory comes
  into play. The 8GB RX 480 has a higher memory clock speed which gives
  it a slight edge while running memory intensive algorithms such as
  Ethash (used by Ethereum). When running at the same core clock, the
  hashing speed of a 8GB RX 480 can be higher by 25–30 hash/sec compared
  to the 4GB RX 480.

  However, hashing speed also depends on the quality of the GDDR5
  memory. Samsung based chips seem to perform little better (20–25
  hash/sec) compared to Hynix or Elpida. They are also easier to
  overclock.

What about Radeon RX 580, which one is better? In what cases should I consider memory?

Memory size does not affect mining speed.

To mine you need DAG file to be loaded into card's memory. DAG file grows in time. So when (and if) it will superpass 4GB - you could mine no more with these cards. Current Eth DAG size is ~2.3Gb. 4Gb is expected roughly on 06/FEB/2021 - after that date you will not be able to use 4Gb cards to mine Eth (and Im not even considering PoS here)


Can bitcoin accounts be imported? I have a DAT file which I generated using the backup feature of Bitcoin Core, I think. I'm not sure if it's possible ***to get Bitcoin Core to import the file so that it becomes a hot wallet.

Yes - from the bitcoin wiki:

"The original Bitcoin client stores private key information in a file named wallet.dat following the so called "bitkeys" format.

It contains:

keypairs for each of your addresses
transactions done from/to your addresses
user preferences
default key
reserve keys
accounts
a version number
Key pool
Since 0.3.21: information about the current best chain, to be able to rescan automatically when restoring from a backup.
The wallet.dat file is located in the Bitcoin data directory.

It is intended that a wallet file be used on only one installation of Bitcoin at a time. Attempting to clone a wallet file for use on multiple computers will result in "weird behavior"[1].

The format of this file is Berkeley DB. Tools that can manipulate wallet files include pywallet."

Also, there is a tool for viewing these files directly; https://code.google.com/archive/p/bdbvu/


Are there mixing services or online wallets that are explicitly compliant with anti-laundering laws? I'm interested in mixing services (0% taint) that are compliant with the most conservative anti-money laundering laws.

My goal is to have anonymity between peers in a transaction, but to remain accountable to government oversight.

"AML-compliant" bitcoins are not anonymous/anonymizable by definition since most AML laws require the origin of funds to be traceable to real person, at least for bigger transactions. The "tainted" bitcoins are completely different thing, you should be completely fine accepting them in good faith if you have sender's real life ID. Law does know nothing about "taint", that's completely bitcoin-related invention, since cash nor goods usually have it. It's yet to be proven how it would be considered by jury.

IANAL, you should do some own research on this.


Trying to understand parent fingerprint in HD wallets I'm trying to implement a barebones HD wallet generator in C#.  I'm starting with a mnemonic and derivation path m/0' and want to generate BIP141 p2wpkh-in-p2sh addresses.  Obviously for the Master Node the fingerprint is 0x00000000, but when I get to depth 1 (0'), I need to calculate the fingerprint of the parent key.  My question is, is the formula RipeMD160(parentPrivKey) or RipeMD160(SHA256(parentPrivKey))?  I've been looking at Ian Coleman's implementation in javascript (https://iancoleman.io/bip39/) and he seems to do the latter one.  However, on this site under "Parent Fingerprint", it says it's the former.

It's ripemd160(sha256(parentpriv)) also known as hash160(parentpriv) source. There is also a python implementation here


How can I make Bitcoin start with a simple `bitcoind` in the terminal? When I want to start Bitcoin I have to use /opt/bitcoin/bin/bitcoind to start it. How can I use simply  bitcoind to start it?

I am using centOS 7.

The answer above is correct but doesn't explain anything to the user as to why they can't just type bitcoind in the first place. This doesn't help people at all and future people will just follow this blindly.

To understand why some commands can be typed in without the full path you must understand the $PATH environment variable. A very good writeup on it was done here http://www.linfo.org/path_env_var.html.

A short explination is that $PATH lets you define what paths on your computer are searched for executable files. You can see what the current searched paths are by typing echo $PATH into your terminal. Here is an example from mine.

echo $PATH
/Users/mschuett/Uber/phacility/arcanist/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/mschuett/bin:/usr/local/bin

Each directory is separated by a : and if a path at /Users/mschuett/bin and /usr/local/bin both included a binary called test-command it would always use the test command found in /Users/mschuett/bin since it comes first in the $PATH string. To add more directories to your $PATH you can simply write..

export $PATH=$PATH:/opt/bitcoin/bin

Now all executables at this path are available without typing the full path. To see what path an executable is being run from you can use which bitcoind and it will output the full path that is used when you run bitcoind.

Hope this helps actually explain what is going on.


How often do miners recalculate the merkle root they're working on? I think that I understood most of the things about Bitcoin but there is still a mystery.

We can see on https://blockchain.info/ that there are up to 4/5 new transactions every seconds.
My question are :
Do miners recalculate the Merkle root 4 to 5 times per second ?
What happens to transactions made exactly as the same time a block is released?

I have seen that miners can choose the transactions they want to accept, but if it was the case I would be a miner, then accept maybe 2 or 3 transactions, find the nonce and get the 25 bitcoins reward. Why is that not possible?

I thank you a lot for your answers and I hope you will be able to help me. Thank you.

There are indeed many new transactions every second. The way miners deal with it is two-fold:

If an appropriate proof-of-work is found on any merkle root, simply publish that block and any transactions that did not make it into the block go into the next block (assuming sufficient fees)
Otherwise, calculate a new merkle root every so often (varies per miner, but let's say for the sake of argument that it's 5 seconds) and try to calculate the proof-of-work with the transactions included.

The reason why miners don't accept just 2 or 3 transactions is that it's just as much work to find the nonce for the proof-of-work whether there's 1 transaction or 1000 transactions. The probabilities remain the same. The nice thing about including more transactions as a miner is that you get more mining fees out of them.


Can the mining pool with the most mining power always win? Suppose we have three mining pools, one with 40% of computing power, and the other two having 30% of computing power each. Will the node with 40% power, be able to solve the puzzle for each node always quicker than the others?

No.  Everything else being equal, the node with 40% of the computational power will 'solve the puzzle' 40% of the time, and each of the nodes with 30% of the computational power will 'solve the puzzle' 30% of the time.

By 'solving puzzle', we mean mining a block by finding a nonce that (when combined with the rest of the information in the block header) produces a SHA256 hash that meets the difficulty requirements of the network at that time.


If BTC.com has the highest hash rate, then why is it not the only pool prodcuing the blocks? with respect to : https://blockchain.info/pools

BTC.com pool seems to have the highest hashpower of 5648.00  PH/s[as per https://btc.com/] .Then how is it that other pools are also able find the correct blocks before btc.com ?

Because it is like a lottery. You're not bound to win all the time, even if you "bought" the majority of tickets.

Everyone basically has a % chance of finding a new block ( which correlates with the amount of hashpower you have  ofcourse.)

Unless ofcourse you do a 51% attack, https://www.investopedia.com/terms/1/51-attack.asp, where certain blocks would be orphaned (not confirmed, since nodes are bound to follow the longest chain.

You could basically prevent other miners from mining any blocks, since you hypothetically will always find a block before they do ( and thus creating the longest chain.)


P2sh redeem script hash What are the contents of a redeem script hash in a p2sh transaction?

From what i read it's similar to the pubkey script but does it only contain the receiver's address?