What was the very initial value of OP_RETURN? My understanding is that OP_RETURN was first introduced in v0.9.0 (https://bitcoin.org/en/release/v0.9.0).

This link (https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2014-November/006917.html) mentions "initially supposed to be 80 bytes, but got reduced to 40".

This link (https://github.com/bitcoin/bitcoin/pull/5286) says: "The maximum size for OP_RETURN outputs used to be 80 bytes, then got changed to 40 bytes to be on the safe side".

Pull request https://github.com/bitcoin/bitcoin/pull/3737 talks about reducing it to 40 bytes. Was it ever in the code at 80 bytes prior?

My understanding is that OP_RETURN was first introduced in v0.9.0

No, it was just changed to be standard in 0.9.0. If a transaction is nonstandard, miners running Bitcoin Core with default settings will not mine the transaction.

OP_RETURN has been around since the beginning, in 0.1.0. This was the fragment that implemented OP_RETURN in 0.1.0:

        case OP_RETURN:
        {
            pc = pend;
        }
        break;

Back then, OP_RETURN didn't necessarily cause a script to fail. You could also use it in the scriptSig of a transaction, meaning that you could steal anyone's Bitcoins by pushing a non-zero value and calling OP_RETURN. Ah, those were the days.


What's going on with my node traffic? Any idea why there is a such a distinct staircase pattern that ends with a giant spike of received data?

Normally the network graph looks random:

The green spikes indicate when you receive a new block, on average every 10 minutes. Then your node is busy for a little while to verify the block and then it starts uploading it to other nodes (red).

I think there's TCP congestion collapse happening when your link is saturated by the high amount of traffic when a new block comes in. After that all TCP sessions start speeding up again slowly. Another keyword to look for is bufferbloat.

Sometimes QOS settings on your router might prevent this. If you have the ability to specify a maximum bandwidth use which is ~5% below the theoretical limit, usually that helps a lot.

If I'm not mistaken, the upcoming version of bitcoind will have some rudimentary bandwidth control options, then it might help to restrict it a little bit.


Derive symmetric keys Is there some means by which I could derive symmetric keys using bitcoin public keys or HD Wallet public key which I have shared with a second user.

You can use Elliptic Curve Diffie-Hellman, assuming you have the public keys, and not just addresses.  Bitcoin addresses are derived from public keys, not public keys themselves, so you'd be required to share the raw public keys.

Here's another resource, which links to a python example creating a shared symmetric key with the secp256k1 curve used by Bitcoin.


ETC vs ETH how do I know the difference? How do I know if Ethereum is ETH or ETC, when the exchange just offers "Ethereum"

Ethereum is usually ETH, Ethereum Classic is ETC.


How to recover a deterministic wallet offline? I know that in the case of electrum there is a gap limit and it will keep generating addresses until it finds a number of consecutive empty addresses equal to the gap limit.

What about if I want to recover my wallet using my seed offline, suppose that electrum servers are not working and I want to recover my wallet. How can electrum know when to stop generating addresses noting that it has no access to the blockchain since the servers are down.

Let's assume a BIP-32 compliant HD wallet is also BIP-39 and BIP-44 compliant.

Let's next assume that when you first configured your BIP-39 compliant HD wallet it provided you the following set of words to be used to reconstitute your master seed: small cereal crazy ahead move never galaxy draft draw plunge sort identify embark clerk hard wagon clever torch cruel income episode any debris puppy.  Additionally, let's also assume the wallet requested that you enter an additional BIP-39 related salted password that will be set to I'mAbadASS for discussion purposes.

A 512 bit root seed m could be obtained for the situation above by issuing the following bitcoin-explorer (bx) command:

% echo "small cereal crazy ahead move never galaxy draft draw plunge sort identify embark clerk hard wagon clever torch cruel income episode any debris puppy" | bx mnemonic-to-seed -l en -p "I'mAbadASS"
c64364d5a4175ff506620c3b788633063a2b3808579cd0f074503a365d283fc3a0bfb50d98f1293828e868e865054eff94261c206d35138689ce97efef9ada9c

BIP-44 compliant HD trees use the m/purpose'/coin_type'/ account'/change/address_index convention to derive private keys and associated addresses.  Let's then assume the wallet only has one account 0.  For the Bitcoin the coin_type the private key tree would look like m/44'/0'/0'/c/i where c can be 0 or 1 and i is an index used to synthesize the i-th extended private key, i-th extended public key or address.

m/44'/0'/0'/1/0 could then be synthesized as follows:

% echo $root_seed | bx hd-new | bx hd-private -i 44 -d | bx hd-private -i 0 -d | bx hd-private -i 0 -d | bx hd-private -i 1 | bx hd-private -i 0
xprvA3zHj8cyzFJiKAXiqdLqrdjUvMqdxUbrpSpDGfxHA15uk2j3fUknu2GN6rSYpPc3QDhALvLBNtKfNGQTLYLNFJD5FKnuFbDPRoBp5TAHFba

From the resulting extended private key (ext_prv_key) above, the corresponding public address and private key can be found.

% echo $ext_prv_key | bx hd-to-address
1BLQ28VdYxJ4Y89fjpbNP5ihUvy2hMkGgq

Then determine if any funds have been sent to the address above by issuing % bx fetch-balance 1BLQ28VdYxJ4Y89fjpbNP5ihUvy2hMkGgq on a computer attached to the Internet or have a very fresh bitcoin-server full node server available for your bx on your private computer that is offline.

If funds are present, to obtain the private keys to import into another wallet try:

% echo $ext_prv_key | bx hd-to-wif
L3KsdTwat69cMtLTJE4W2G77SgazLGqhzfvMkYQsuwMC96tr3Tj8

The qrencode command can receive the piped text output immediately above to synthesize a QR image for a smart cell phone or tablet based wallet to easily import from an offline key synthesis computer that retains a network air-gap.

% echo $ext_prv_key | bx hd-to-wif | qrencode -o QRwif.png

See how-to-import-a-hd-wallet-from-an-extended-private-key for more Electrum specific details.


How might I create a new Electrum wallet programmatically? I want to create a new wallet using Electrum-apis. I have gone through the documentation given here but I haven't found any method to create a new wallet or an address.
Would someone guide me in this?

There is nothing special about an electrum wallet. The electrum API will allow you to query address balances, and build transactions, for any address, regardless of how they were created.

Electrum itself does use a special key derivation scheme, but that does not affect the usability from an API point of view. If you are using electrum servers as a backend, you should be able to generate wallets using any BIP39 library in your language of choice, and simply querying with the resulting addresses.


Bitcoin-qt -how does it choose the address to take money from when sending btcs I don't have any bitcoins yet, but I have the the wallet program called bitcoin-qt. I am wondering about the send feature. It does not seem to let me choose which address to deduct the coins from. How does that work?

Let's say I have 5 addresses and one coin in each and I want to send 5 coins. Does it automatically take 1 coin from each of the addresses? What if I want to take coins only from specific addresses?

Actually now looking at it more closely it doesn't even show which address contains coins and which one doesn't. Isn't this a bit oversimplified?

There's a patch awaiting merging into the Satoshi client which allows you to see the balance on each address and pick which address(es) you want to pay from.

See here for more description and a video of it in action.

Lots of people have been showing their support for this feature by posting "+1" comments on the pull request despite requests that they stop doing so.


How do transaction costs compare between Bech32 addresses and legacy Bitcoin addresses? Now that Electrum 3 supports Bech32 addresses for segwit, when sending coins to a legacy address are fees higher or cheaper?

Transfer from Legacy ⟶ SegWit: pay full fee (doesn't benefit from SegWit discount)
Transfer from SegWit  ⟶ Legacy or SegWit: discounted.

Note: SegWit addresses can be Bech32 bc1... or they can be nested in a legacy P2SH 3... address which are backwards-compatible (although less efficient). Many exchanges, wallets support the legacy "nested" form only.


Determining the genesis transaction value or genesis_tx Is there a way to determine the genesis transaction (genesis_tx) hash? I know the genesis block number but how do you determine genesis_tx? I am looking for this hash for an altcoin which was forked from litecoin.

The genesis block's coinbase transaction hash will be the same as the blocks merkle root because the coinbase transaction should be the only transaction in the genesis block. You should be able to find it in chainparams.cpp if the codebase is still similar to bitcoin, like so:
https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L125

assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));


Create BitCoin address for each registered user I am working on a PokerGame where I need to implement BitCoins. For each registered user, I need a unique bitcoin address generated, toward which they can make payments and I make them show it when they access their game account. How can implement this? I am using Java.

Thanks

You will want to look into this implementation of bitcoin.

https://bitcoinj.github.io/

The documentation will provide all required information for generating bitcoin addresses.

It is generally unwise to reuse addresses, also very expensive to be constantly moving small amounts on the main chain. You may want to consider other implementation options rather than one address per user.


Is there a way to distinguish miner nodes from other nodes? In the bitcoin network, there are many different types of nodes. One of these types are miners and in the bitcoin network, is there any way to distinguish a miner node from a non-mining node? I'm asking because part of some research I'm doing, it would be great help to me if I knew which nodes were the mining nodes

Yes, but only in a probabilistic way: If you run many different nodes and try not to leave any node in the network that isn't connected by any of your nodes, you'll be able to track and visualize the relaying of the new blocks. After a while, you'll have the whole network graph, looking at which might obviously show the miners.

By the way, using the same method, it's possible to find the authors of transactions, which is what Dandelion is aiming to solve.


How do I get network propagation of an unconfirmed transaction? (e.g. the number of nodes which have seen it) I am running a business in which I receive ~10$ transactions. since the amount is too small I believe I will be safe just verifying the transaction has properly propagated through network and includes a proper fee.

My problem is how do I get network propagation of my transactions? (e.g. the number of nodes which have seen it)

You cannot reliably get such information. The best that you can do is ask individual nodes whether they have seen your transaction (by sending getdata messages and seeing if they respond) but even then, not all nodes will respond. It is impossible to ask all nodes (as not all nodes are listening so you cannot connect to all of them) nor is it possible to "ask the network".

If you are concerned that someone will try to double spend a transaction that they sent to you, then you can broadcast it yourself and try to get it to as many nodes as possible. Instead of trying to figure out how it has propagated, you just make sure that it has propagated by relaying the transaction yourself.

Also, this method is not a reliable way to protect against double spends. Even if the fee is good and the transaction is propagated, a double spend is always possible and potentially trivial if the fee on the double spend is high enough.


Block Confirmation Speed - Bitcoin vs Litecoin vs Potcoin I understand that a Bitcoin confirmation takes 10 minutes and I believe I understand the reasons behind that.
Litecoin claims a transaction speed of 2.5 minutes.
Potcoin claim it can be used for point of service transactions at a store with a confirmation speed of 40 seconds  (Potcoin FAQ).

Why does Bitcoin take so much longer? Does Potcoin's claim of 40 seconds make the transaction less secure?

Short answer, bitcoin was first. altcoins that came after thought that took too long and shortened it. Litecoin was one of the first ones that came after bitcoin and they made it 1/4 of the 10 minutes in bitcoin.

Long answer, there's a balance that each coin tries to make between block propagation and speed of confirmation. Satoshi was pretty conservative in choosing 10 minutes as there weren't any other digital currencies like bitcoin. Other coins have since tried shorter times, some as short as 10 seconds and have found that it works fine. There have been suggestions by former core devs that a hard fork could be executed in the future to shorten the confirmation time to 2.5 minutes or less for bitcoin.


How do Blockchain.info recovery mnemonics encrypt wallet data and what prevents hacking of the algorithm? How do mnemonics encrypt wallet data and what prevents hacking of the algorithm?

For example Blockchain seems to encrypt all data using a mnemonic yet doesn't hold customer data server side.

What prevents creating numerous Blockchain wallets, recording the mnemonics and discovering the algorithm?

NB. The BCI mnemonic recovery protocol is NOT the same as BIP39

Edit:
Blockchain.info is open source, the algorithm is public. The mnemonic that they use stores information about your wallet id and your password only.

Previous answer: You should read into BIP 39 this covers how mnemonics map to the values that are used to create a HD wallet the algorithm is very well known and corresponds to the size of the key space needed for wallet generation.  There are generally 2048 words in the wordlist used to create a wallet. A 12 word seed generates 128 bits of information (and 4 check bits). That's 11 bits per word from a list of 2048 words.


How to pass parameters for multisignature addresses from Perl to the JSON::RPC::Client? I'm trying to create a multisig address with JSON::RPC::Client but I don't know how to pass the parameters. I can pass simple params such as in validateaddress that requires only <bitcoinaddress>. Working example:

$obj = { method  => 'validateaddress', params => ["$just_a_bit_address_in_string"],};
$res = $client->call($uri, $obj);

But when it comes to other types of parameters such as in createmultisig,  that the required params are < nrequired > <'["key,"key"]'>, I don't know to pass it to $obj. How do I do that?

The ["key,"key"] part of the documentation means that it expects an array.

You need to call it like this:

$obj = {method  => 'createmultisig', params => [2, ["$key1", "$key2"]],};
$res = $client->call($uri, $obj);


Malicious full nodes causing denial of service attacks To control >51% of the mining power in bitcoin is impractical due to the immense investment that will be required. Also, The Bitcoin Core client has DoS protection against malicious nodes forwarding a flood of transactions. But what would happen if an attacker who has placed several full nodes across the world, does not forward the transactions to the other honest nodes? There are over 10K full nodes on the bitcoin network. An attacker can place 10x the amount of these nodes spread very efficiently in terms of geographic dispersion so that they are one of the first to see the transactions broadcasted. In order to prevent the malicious node from getting dropped by the honest node, it can relay transaction once in a while so as to keep the connection active. Given, that there are 10x more malicious nodes than honest ones, it might highly likely be the case that miners do not see the broadcasted transactions and they do not include them in the block. Has any research been done to prevent such scenario?

There are significantly more than 10k full nodes on the network. The 10k figure is simply the number of reachable nodes which listen publicly for new connections. There are many more times that amount which do not have open ports. Luke-jr publishes information about nodes his own knows about[1], suggesting there are in the order of 100k nodes.

It only takes one honest connection to make any dishonest connections become apparent. The default setting in the bitcoin core software is that a node will make 8 outgoing connections to other peers. By default, the software will also accept up to 125 incoming connections, but miners in particular will increase this figure. (Miners also use separate p2p networks such as fibre).

If a malicious party controls 90% of nodes in the global network, then the probability that any single outgoing connection will reach them, assuming chosen at random, would be 0.9. The probability that all 8 outgoing connections will connect to the malicious nodes then, would be 0.9^8. 10x the nodes wouldn't be sufficient.

There is a paper, Eclipse Attacks on Bitcoin’s Peer-to-Peer Network which addresses the issue and also presents several countermeasures which can limit the chance that an attacker could pull this off, even if they were to manage to spin up the vast numbers of nodes required.


How to calculate nbits from powlimit I remember some where was table and python scrypt for do this , when reinstall my debian i was lose this script.

Example we hv uint256S("00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
what is = 0x1d00ffff

The formula for the conversion can be found on the bitcoin wiki.

Essentially, the first byte indicates the number of trailing 0 bytes (minus 3 for some reason). The remaining 3 bytes are the next 3 bytes of the target.

So 0x1d00fffff has 0x00ffff followed by 0x1d - 3 = 26 trailing 0 bytes with the whole thing padded out to 32 bytes. So the final result is 0x00000000ffff00000000000000000000000000000000000000000000000000000.


Hello, i wanna help? I have question and problem. Im from Poland, installed Bitcoin Core, wanna send money from my bank account in Poland to my bitcoin core wallet, but how i can do that ?

You cannot send anything other than bitcoin to (or out of) your Bitcoin Core wallet. You'd need to acquire bitcoin somewhere else first, then you will be able to send it to your Bitcoin Core wallet.


Can I find out on which website I got my Litoshi address? I can't remember where I got my Litoshi address. Is there a way I can find it because boxlit transferred my litoshis already?

I saw the transaction through block.io. I don't think I got it there (block.io). I did not write it down because I always save my username and password in websites I register and sign, but the problem is, I can't remember what website.

Look at a list of Litecoin web wallets to see if any one them sound familiar to you:

LiteVault - Online Litecoin Wallet; private keys encrypted locally
Hive Web Wallet - Online BTC/LTC wallet; private keys encrypted locally
Liteaddress.org - Litecoin address generation tools (BIP38)
Reddit LiteTip Bot - Give and receive Litecoin tips from reddit users
Coinkite - Coinkite is a web wallet with merchant services, Point-of-Sale
terminals and debit cards.
CoinWallet.co - Online wallet
Harborly - Online wallet that can be linked with any US bank account
HolyTransaction - Online wallet, multi-currency support
Celery - Online wallet
Cryptonator - Multi coin wallet

https://litecoin.info/Category:Services#Wallet_services

If you are able to locate your account, please send your LTC to an offline wallet with a strong password that you do not use on multiple sites.

Web wallets are not the most secure and your practice of reusing passwords on many websites is a horrible security practice.


What financial instruments are under development for Bitcoin? I'm thinking here specifically of instruments that take a Bitcoin-like approach to trusted parties, eliminating them wherever possible and typically built with Bitcoin as their platform.  (As opposed to simply having a real-world trusted entity issue a Bitcoin-containing or Bitcoin-related financial instrument in the traditional method).

Financial instruments include things like bonds, stocks, contracts, additional currencies, etc.

For example, I know jgarzik was working on smartcoin for a while (has development stopped?) and there are things like this you can do with coloured coins.  Can anyone offer some insight on what is actually being developed re: these and other approaches, and especially what has reached an implemented, usable level?

Lots of people that we know about and probably many more that we don't know about are developing a diversity of financial instruments for bitcoin. What instruments exactly will depend on your definition of instrument.

Here is an interesting one:

cvToken:
An effort to stabilize the bitcoin price by pegging a token backed by a basket of commodities to it.


Is 12-word seed phrase safe enough? Is 12-word seed phrase (as used by Electrum for example) safe enough for generating an offline wallet?

My understanding is this: 2048 words pool make 11 bits of entrophy per word. 12 words in seed make total 132 bits of entrophy.

Is this considered safe enough?

I'm not talking about being quantum-computing-resistent, just being infeasible to crack using brute force given the expected computing power in the foreseeable future.

Is this considered safe enough?

Nothing is "safe enough" if we do not know the cost.

OK, if you have $100k in bitcoins the 12-words phrase is safe enough.

If the 12-words phrase is the seed to the "Method of destroying the Universe" I would recommend to add at least 11 bits of entropy and use 13 words.


Mining pool software for home use I have tried to set up a mining pool with my home computers. I am running bitcoind on one machine, and the others, also running bitcoind, were started with --url and --userpass to my central bitcoind server.

Now, are these machines already forming a mining pool? Or am I missing something?

What other software should considered for a home mining pool?

From what I understand, you only need one bitcoind instance on one machine, while other ones would only run miners that would connect to the bitcoind machine. Running more bitcoind than that is not necessary.

As for the software, you should look into P2Pool - it allows you to earn smaller amount of Bitcoins more often, meaning you'll get smaller variance. It won't decrease the amount of Bitcoins you earn on average though, meaning it doesn't cost you anything to use.


Can ASIC miners easily be used to guess brainwallet passphrases? After reading the Bitcoin wiki page for brainwallets it seems to me that mining equipment can be used to brute force brainwallet passphrases. Is this correct?

  "...so hackers can collectively try multiple trillions of passwords every second in the privacy of their own homes with the very same equipment they use for mining bitcoins (in the usual sense)."

How would one use an ASIC miner to brute force the blockchain with a dictionary attack?
What would the application logic look like?
Can a standalone(The Antminer S1 for instance) miner be "tricked" into believing it is doing normal work for a pool when actually just hashing random strings or would it need custom drivers?

What follows is an educated guess, not certain statements, and is based on Electrum's brainwallet phrases (just figured it'd be a good example), not other schemes or human-generated ones.

No, a miner can't easily be tricked into doing it (e.g. solely by a rogue pool), but can be programmed to try to crack brainwallet phrases. This is because ordinary hashing involves totally different inputs (a block header and nonce, hashed twice) than brainwallet cracking (a random 128 bit seed, hashed 100,000 times).

You'd do this by trying random 128-bit seeds, through Electrum's algorithm, which involves taking the seed and running 100,000 SHA256 hashes on it (maybe some other stuff I'm missing would make it more difficult). You can then do a few more calculations to come up with the addresses that the key generates, and check the blockchain to see if any of these match.

The current network hashrate is ~50,000,000 GH/s. If all of that were instead put towards breaking everybody's Electrum keys, and all it takes is the 100K hashes, there'd be 5*10^11 out of 2^128 checked every second. You could check all of the keys in about 2*10^19 years, or 1.6*10^9 times the age of the universe. While you'd probably get collisions long before this (dependent on how many Electrum-generated addresses are in use), I think this gives you an idea of the infeasibility of this sort of attack.


Will there be a testnet4? Or do we not need a testnet reset once we have Signet? The last testnet reset was for the current testnet3 back in 2012 (not including segnet which was a testnet for SegWit before SegWit was activated on mainnet). Are we due another testnet reset? Or is there no need for testnet anymore with the introduction of Signet?

I don't think there is a clear answer to this yet. I suspect many are waiting to see whether Signet proves an effective replacement for testnet. (Signet is not yet merged into Bitcoin Core as of the time of writing in August 2020.)
There has been discussion on the Bitcoin dev mailing list and in the Bitcoin Core repo about a testnet reset at multiple points.
There are various problems with testnet of which many are addressed with the introduction of Signet. Testnet coins are supposed to be for testing and are not supposed to have any value. However, the hash rate directed towards the testnet chain fluctuates and at some points the difficulty of mining a block is much higher than you would expect for a coin that is supposed to have no value. This also means that the variance of block discovery time is wildly different to the average ten minutes on mainnet. (At one point 16,000 blocks were found in one day.) It is difficult to know what is happening during these fluctuations. It may just be that the testing of one application (e.g. a new ASIC manufacturer) is inadvertently disrupting the testing of other applications.
Signet resolves this by introducing centralized control over when and how regularly blocks are mined. Newly mined blocks need to be signed by at least one authority to be added to the blockchain. For some use cases (e.g. testing the latest Taproot scripts) it will be a relief to not have to deal with wildly fluctuating block times. However, for other use cases such as mining, IBD (initial block download), P2P etc this artificial stability may not provide the desired staging ground before moving to mainnet.
It is possible to simulate a block generation policy similar to mainnet on Signet or combine proof of work with centralized signing. However, I suspect that for a limited set of use cases a totally unrestrained, open and permissionless testnet will still be required. Hence once the dust settles, Signet is merged into Bitcoin Core and we have explored to what degree Signet meets the testing needs of all the various applications I think we will still require a new testnet reset. But I can't predict the future and others may disagree!


Receive payments in BTC or USD, but get paid in Bitcoin? I need to receive payments on my site. I wish to give users the option to either send money in bitcoins or US Dollars.
However, I always want to get paid out in bitcoins. So I need to have an auto-converter for the USD payments to my Bitcoin account.
Is there a service that offers such an option, preferably with an API?

NO . . .  you cannot sell Bitcoins to a customer to pay yourself Bitcoins.  They - the  customer need to buy Bitcoins to have ready to pay for the website item and you need to send a bitcoin price and address to them based on a price you have converted to bitcoin from USD.

The question whether you want to keep the bitcoin as bitcoin will be determined by whether the price of bitcoin is rising or falling.

It is not as easy as you think - our website accepts bitcoin - and we have to cancel the order in a given time frame because the price of bitcoin keeps changing so fast - and either we would loose or the customer would be be pissed because they pay at the quoted rate and by the time they do pay it has gone up - and then they want "change" back based on the time they pay.

Yes . . . there are API's yes - and it is a complicated process to use them because of just what I said above - and you need to be a database programmer in some language like PHP etc to write the code for your site usually becasue cron is going to be involved and you will need elevated privileges an "el cheapo website from GoDaddy or Hostgator etc will not have and even their VPS packages normally will not do - and it matters then whose exchange you are tied to by the API you use because their prices vary even between the current pricing


Can't install Bitcoin I have a laptop with Windows8.1
Intel Core i3 2.60 GHz
64-bit OS x64-based processor
4 GB memory
584 GB free space

Bitcoin Core minimum recommended is
Windows 7/8.x
1 GB memory
80 GB disk space

Downloaded Bitcoin Core and attempted to install and I get the message “Incompatible Program”

What can I do to install the program or get a compatible program?

download it from the official website :

https://bitcoin.org/en/download

for windows 64 bit:  https://bitcoin.org/bin/bitcoin-core-0.13.1/bitcoin-0.13.1-win64-setup.exe


Compiled Bitcoin Client as Testnet with bitcoin.conf I'm quite new to bitcoin. I've been compiling the client from github and I want to run on a server as testnet and make some API requests. As I see in the documentation I should create a bitcoin.conf file. But where do I create this in case of compiled client

The location of your bitcoin.conf file depends on your operating system: https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File

Note that you can also pass any configuration value as command line argument.


Which Namecoin block was the first one to be generated by merged mining? For a definitive record is it possible to determine if a namecoin block was generated via merged mining?  Is so which was the first one.

Which is the first bitcoin block to have namecoin information in coinbase transaction?

Yes, block 19200 was mined using MM, by slush's pool. AFAIK first Bitcoin block with merged-mining information was 00000000000002c727047296ee20b628599031c6ea5c09292513fddbb11d34df (block 148557), also mined by slush's pool.


Understanding IP address tracing via Bitcoin Transaction I recently met a person who helped police track the IP address of a Bitcoin transaction. I wanted to learn more about it but he didn't have time to discuss about this topic in the meet.

I am curious in understanding how cryptocurrency transactions can lead to trace back of the IP address from which the transaction originated.

How does this stuff work?

EDIT

IP address is bold because I do not mean wallet transaction address.

I know originating wallet address can be traced back with blockchain.

If an entity runs a large amount of relay nodes on the network, they could figure out which of their nodes was the first to see a transaction, and which peer that transaction came from.  That does not necessarily tell them the originating IP, as it could have been a a node relaying a transaction rather than sending one.

This leaves a large amount of uncertainty in the trace.  Due to the decentralized nature of Bitcoin, no single entity is likely to be in control of the majority of relay nodes.  Let's say, for arguments sake, that there is a company that runs 40% of all relay nodes.  They have a very good chance that a wallet sending a transaction is directly connected to one of their nodes, and therefore they can work out the originating IP.  But what about the other 60% of nodes?  Can they ever say for sure that a transaction didn't bounce around the other 60% for a few hops before they saw it?  No, and odds are petty high that just that happens often.  And to my knowledge, no single entity runs that many nodes.

Point is, the more relay nodes there are, the less possible it is to trace an originating IP address.


Failing communication with Bitcoin node: Only one usage of each socket address (protocol/network address/port) is normally permitted I use the cryptean's BitcoinLib to make RPC calls to a Bitcoin node on another computer. Seemingly at random, the connection fails and I get a System.Net.Sockets.SocketException with the error code Only one usage of each socket address (protocol/network address/port) is normally permitted. I don't know if this is due to a race condition on the port number distribution on the local machine or a bug in BitcoinLib.

Here is the complete stack trace

2018-08-15 08:48:12.5570 Fetching transaction from Bitcoin node,
txid=3586d46be7bb1875fede4349849b89daf5ed73320979da211a54146c7bd90bfb.
2018-08-15 08:48:12.5831 Failed during communication with Bitcoin
node.
2018-08-15 08:48:12.5831 An unknown web exception occured
while trying to read the JSON response
2018-08-15 08:48:12.5831
System.Net.WebException: Only one usage of each socket address
(protocol/network address/port) is normally permitted Only one usage
of each socket address (protocol/network address/port) is normally
permitted ---> System.Net.Http.HttpRequestException: Only one usage
of each socket address (protocol/network address/port) is normally
permitted ---> System.Net.Sockets.SocketException: Only one usage of
each socket address (protocol/network address/port) is normally
permitted    at System.Net.Http.ConnectHelper.ConnectAsync(String
host, Int32 port, CancellationToken cancellationToken)    --- End of
inner exception stack trace ---    at
System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port,
CancellationToken cancellationToken)    at
System.Threading.Tasks.ValueTask1.get_Result()    at
System.Net.Http.HttpConnectionPool.CreateConnectionAsync(HttpRequestMessage
request, CancellationToken cancellationToken)    at
System.Threading.Tasks.ValueTask1.get_Result()    at
System.Net.Http.HttpConnectionPool.WaitForCreatedConnectionAsync(ValueTask 1
creationTask)    at System.Threading.Tasks.ValueTask 1.get_Result()
at
System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage
request, Boolean doRequestAuth, CancellationToken cancellationToken)
at
System.Net.Http.AuthenticationHelper.SendWithAuthAsync(HttpRequestMessage
request, Uri authUri, ICredentials credentials, Boolean
preAuthenticate, Boolean isProxyAuth, Boolean doRequestAuth,
HttpConnectionPool pool, CancellationToken cancellationToken)    at
System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request,
CancellationToken cancellationToken)    at
System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task1 sendTask,
HttpRequestMessage request, CancellationTokenSource cts, Boolean
disposeCts)    at System.Net.HttpWebRequest.SendRequest()    at
System.Net.HttpWebRequest.GetResponse()    --- End of inner exception
stack trace ---    at System.Net.HttpWebRequest.GetResponse()    at
BitcoinLib.RPC.Connector.RpcConnector.MakeRequest[T](RpcMethods
rpcMethod, Object[] parameters)
2018-08-15 08:48:12.5831    at
BitcoinLib.RPC.Connector.RpcConnector.MakeRequest[T](RpcMethods
rpcMethod, Object[] parameters)

The problem was caused by my server making too many simultaneous requests to the same node.  The computer making the requests imply ran out of ports to use.


What methods could a government use to shutdown Bitcoin? Let's say that a government decided to shut down the Bitcoin network. What options would they have to achieve this? Would they need to convince other governments? All governments?

Let's set as a precondition that they were able to scare away all the developers, so the Bitcoin community could not adjust the software.

Honestly, I think the best way for the government to shut down Bitcoin would be as a secret project. Simply construct a VLSI ASIC miner built using 40nm/1Gtransistor technology and build 100,000 of them. Effectively make them appear distributed around the world using VPNs, the bandwidth is low. Then execute frequent 51% attacks on the Bitcoin chain to "unconfirm" transactions to major sites. Confidence in the Bitcoin system would drop to nothing.

Another trick would be to switch the miners off and on unpredictably. If done right, this could lead to hours between confirmations at some times.

One can imagine the community responding to this in a coordinated way to develop a workaround. But if you assume subversion and interference in that process, such a response could be avoided.

Of course, they could also summarily execute anyone found using Bitcoins. It's effective too, but also pretty unlikely.


What is lnprototest exactly? Can it be used to test an individual Lightning implementation or just interoperability between implementations? What is lnprototest exactly? Can it be used to test an individual Lightning implementation or just interoperability between implementations? What does an implementation need to do to use lnprototest?

Rusty Russell discussed lnprototest (repo link) during the August 2020 Sydney Socratic Seminar.
What is lnprototest exactly?

It is a pure Python3 test system and some packages to interface with
the spec that currently live in the c-lightning repository. You run
lnprototest and it has these scripts that go “I will send this” and
you will send back this. It can keep state and does some quite
sophisticated things. It has a whole heap of scaffolding to understand
commitment transactions, anchor outputs and a whole heap of other
things. Then you write these scripts that say “If I send this it
should send this” or “If I send this instead…”. You create this DAG, a
graph of possible things that could happen and it runs through all of
them and checks that happens.

Can it be used to test an individual Lightning implementation or just interoperability between implementations?

It is really good for protocol development too not just testing
existing stuff. When you want to modify the spec you can write that
half and run it against your own node.

In addition there is an open PR at the time of writing in the c-lightning repo from Lisa Neigut to run lnprototest with every c-lightning CI build.
What does an implementation need to do to use lnprototest?

They need their own runner. Take the c-lightning one, it fires up a
bitcoind in regtest mode and fires up a c-lightning node. It is kind
of dumb. You have to have c-lightning run in developer mode because it
uses some weird hacks. We are slowly pulling those out. Ideally you’d
be able to run it in any off the shelf implementation. You have to get
your hands dirty a bit and write some Python for your implementation,
that is true.


Bitcoin-qt bitcoin.conf location? I have Bitcoin-qt installed and running on an external Hard Drive.  Where should I put the bitcoin.conf file so I can configure it with the server setting, user, and password?

It depends on what OS you've got. Windows, Linux, Mac OS?

That said, one of the many possible solutions is somehow OS-independent:
move everything to one single directory on your external disk including the wallet.dat file, the .conf file, the executable, and the blockchain data. Then make sure you always start your Bitcoin-Qt client from the console and include the parameters -datadir and -conf in your command line. Here is an example for Linux:

cd /my_external_harddisk/bitcoin/
./Bitcoin-Qt -datadir=. -conf=./bitcoin.conf -printtoconsole

(I added the optional -printtoconsole parameter. This prevents inflating the debug.log file somewhere on your OS disk all the time.)

In MS-Windows it would look very similar, I guess (I haven't got access to a Windows PC at the moment).

In Mac OS you may want to keep everything in a directory containing Bitcoin-Qt.app for practical reasons, but the principle is the same:

cd /Volumes/my_external_harddisk/bitcoin/
Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -datadir=. -conf=./bitcoin.conf -printtoconsole

If you later inadvertently start Bitcoin-Qt without any parameters then it simply creates an empty wallet.dat file in Bitcoin's standard directory somewhere on the OS disk. At first glance this looks as if you suddenly lost all your precious Bitcoins. Don't worry, your original wallet.dat file is still there on your external HD in perfect condition. Just exit the program and restart from the console with the parameters as explained above.


Can I use curl to call getInfo from a the Bitcoin server? I am wondering if its possible to use curl to getinfo from the bitcoin server thanks.

<?php
// init the resource
$ch = curl_init();

// set a single option...
$username = 'usernamefromconfig';
$pwd = 'passwordfromconfig';

curl_setopt_array(
    $ch, array(
    CURLOPT_URL => "$username:$pwd@127.0.0.1:8336",
    CURLOPT_RETURNTRANSFER => true
));

$output = curl_exec($ch);
echo $output;

// free
curl_close($ch);
?>

You can use the command-line curl or any of the various JSON-RPC examples listed here.
In particular, you can use curl like this:
$ curl --user <username>:<password> --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

For PHP, you can use this library and do:
require_once 'jsonRPCClient.php';

$bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');

echo "<pre>\n";
print_r($bitcoin->getinfo()); echo "\n";
echo "Received: ".$bitcoin->getreceivedbylabel("Your Address")."\n";
echo "</pre>";


Difference between transaction chain vs blockchain What are the difference between transaction chain in bitcoin and blockchain used in bitcoin?

Is it sufficient to say to each transaction refers to previous transactions in the transaction chain and also each transaction is part of a block which is a part of blockchain?

The blockchain consists of blocks which are collections of transactions. The blockchain is a linked list; each block has 0 or 1 previous blocks and 0 or 1 following blocks.

A transaction chain is a chain of transactions which is completely independent of the blockchain. A transaction chain is a directed acyclic graph; each transaction must have one or more previous transactions and zero or more following transactions.


How do you perform double-SHA-256 encoding? The Bitcoin Protocol-specification gives an example of double-SHA-256 encoding.

  hello
  2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 (first round of sha-256)
  9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50 (second round of sha-256)

I've tried various SHA256 calculators and the first encoding matches no problem, but the second always resolves to

  d7914fe546b684688bb95f4f888a92dfc680603a75f23eb823658031fff766d9

I've also tried UPPERCASE and swapping the byte endianness.

You're hashing the hexadecimal representation of the first hash. You need to hash the actual hash -- the binary data that the hex represents.

Try this:

$ echo -n hello |openssl dgst -sha256 -binary |openssl dgst -sha256


Will Lightning Network still require a confirmation from the network? I have studies the Lightning Network, and although I understand the concept, I have not understood the following:
Let's assume that a network channel is opened between parties and all transactions have been completed successfully (no cancellations whatsoever).
For the transaction balance to 'escape' the network channel, would a confirmation from the network (meaning the network as it is now) still be required?

As an example:
John gives Nathan 0.20 BTC (transaction occurred withing the Lightning Network) - no fees:perfect
- Nathan wants to send 0.20 BTC to an exchange - a confirmation from the network will be required, right?

So basically, the biggest benefit is reduced transaction time & zero fees between trusted parties, right? Confirming a transaction will still be inevitable?

Lightning Network (LN) payment channels are anchored on the blockchain by their owners cooperatively creating a 2-of-2 multisig address and sending funds to it. The funding usually comes from one party, but one channel owner can for example pay the other channel owner with the funding transaction by allocating the payment amount to them in the channel's initial balances. The channel anchor then remains unchanged on the blockchain until the payment channel is closed.
Payments on the LN are subsequently performed by the channel owners renegotiating their balance shares of the anchor's funds. Thus, as long as all payments are processed on LN, no on-chain action is required. When one of the two parties wants to use funds from the channel to send an on-chain transaction there are three possibilities:

Close: closing the channel and using the funds on-chain
Splice-out: cooperatively sending part of the funds out of the channel and re-committing the rest of the funds to a new channel with each other
Loop-out/submarine swap: paying a third party via LN to make an on-chain payment on their behalf


Words to seed translation In bitcoin wallet that support bip39 mnemonic code, is there a way to get the 12/24 words from the seed generated by them?
Or the translation is one-way only (from words to seed)?

There is no way to convert the resulting seed back to the original mnemonic.

As stated in the BIP 39 proposal:

  To create a binary seed from the mnemonic, we use the PBKDF2 function
  with a mnemonic sentence (in UTF-8 NFKD) used as the password and the
  string "mnemonic" + passphrase (again in UTF-8 NFKD) used as the salt.

The seed (and optional passphrase) are passed through pbkdf2, which is not reversible.


Why doesn't Bitcoin return lost coins back into the block reward? The idea of putting back lost Bitcoins back onto block rewards seems like a great idea.

I acknowledge that there were quite a handful of early adopters who were generating blocks daily, but had no idea what they were doing. Time passes, they forget about Bitcoin and they format their hard drive or whatever. Their coins enter the nether, never to be seen again.

I wouldn't be surprised if >5% of the current coins in circulation were lost due to mishandling. My question is, why isn't there something implemented for this? I can't find any disadvantage for this feature, it would simple as invalidating coins that haven't been transferred in x amount of time, which is probable for only sorting lost coins.

As Stephen points out it would force people to spend coins. Age is not a proper measure of lostness. A common recommendation for savings accounts is to put them on physical backups such as printed QR codes that you add to while the account itself remains offline. People may even will their Bitcoin savings to their children. To force people to shuffle these coins around from time to time to keep them from being taken undoes one of the major safety features of Bitcoin. Namely that transactions can not be reversed, and your accounts can not be frozen or taken from you by any mechanism.

Also there is no reason. The entire Bitcoin economy could be run on a single bitcoin because of its divisibility. There simply is no reason to break other important Bitcoin features to regain those coins. It wouldn't even actually increase the miners' rewards because for every extra coin brought back the wealth is distributed over more coins reducing the value of each coin with inflation. A million dollars of value spread over 1000 bitcoins if there are 1000 bitcoins in circulation, is the same one million dollars of value spread over 1 bitcoin if there is only 1 bitcoin in circulation.


Is it worth it to mine while using my laptop for misc. purposes? I have never mined any cryptocurrency and know nothing about the market or how the earnings from mining fluctuate, but I do have my computer turned on a lot of hours a day while studying, watching series or simply wasting time on Facebook. My computer is an hp laptop with a core i5 2540M processor, no dedicated gpu and 10 gigs of ram running windows 7 (I know, I'm about to update to 8.1). Would it be worth it to have it mine something on the background while I use it or would it just deteriorate it for no reason while not even matching the increased electricity consumption cost?

It is unlikely you would make any profit CPU mining unless you have free electricity. Even then the potential for shortening the life of your laptop would likely reduce profitability. There are a few altcoins that aim to allow people to mine with a CPU but its unlikely you will make more than a few cents per day.

Mining on the laptop will make the CPU operate at 100% capacity all the time. This will increase the temperature, decrease the battery life and increase the noise of the laptop (fans speed up as it gets hotter). Overall its likely you increase the chance of the laptop breaking as well.


How to convert scriptPubKey bytes to Bitcoin address? I am currently trying myself in parsing the blockchain using pyblockchain. My problem is that I am not able to encode the scriptPubKey correctly - although I don't know what I could possibly do wrong.

Below you can see how I traverse the blockchain:

from blockchain.reader import BlockchainFileReader

import hashlib
import base58

block_reader = BlockchainFileReader('/media/Data/btc/blocks/blk00325.dat')

count = 0

for block in block_reader:
    count +=1
    for t in block.transactions:
        for outp in t.outputs:
            addr = base58.b58encode(outp.script_pub_key)
            if addr.startswith('1'):
                print(addr)
    if count >= 5:
        break

If I, in my Jupyter notebook, take a look at outp, I'll find for

outp.script_pub_key
>> b'v\xa9\x14\x1e\xbev\x83\xceJd\xad\xc9\x17\xe9\xb1\x93\x7f\x12&Q\xcb\xab\xa1\x88\xac'

this:

base58.b58encode(outp.script_pub_key)
>> 'pkJBVCg6k54E7ZiP7cvxbCvtN9aY9zEcgK'

and this is not a valid bitcoin address.

Apparently, bitcoin addresses are supposed to be encoded i Base58Check - however, that does not work either:

base58.b58encode_check(outp.script_pub_key)
>> '6PSJQapdQn8VeG9SBuZdH8q2ysyP4ND6dmspzLZb'

So what am I doing wrong here?

You are not considering the op codes in the pub_key string.
For example, a script_pub_key could be OP_DUP OP_HASH160 [pub_key] ...
and you have to pull out the pub_key.
This sample code shows the addresses, you can check them against a block explorer for the same transaction id.  Note that the byte after OP_HASH160 gives the length of the pub_key in bytes after it, so it needs to be skipped as well to generate the address.

import sys
import base58
import hashlib
import binascii
from blockchain.reader import BlockchainFileReader
block_reader=BlockchainFileReader('/var/data/bitcoin-data/blocks/blk00325.dat')
satochi_convert=1e8
def sha256(x):
    h=hashlib.new('sha256')
    h.update(x)
    return h.digest()

def hashStr(buffer):
    return binascii.hexlify(buffer)

for block in block_reader:
    #block has .header, .transactions
    for iter,tx in enumerate(block.transactions):
        print('  Transaction (txn_hash):{} {}'.format(type(tx.txn_hash),tx.txn_hash))
        for x in tx.outputs:
            script_pub_key_str=hashStr(x.script_pub_key)
            if script_pub_key_str[0:4]==b'76a9':
                #This is a pubkeyhash
                bytes=x.script_pub_key[2]  #number of bytes in the pub_key
                assert bytes==20
                public_key = x.script_pub_key[3:3+bytes] #20 bytes
                z=b'\00'+public_key
                #checksum=sha256(sha256(z))[:4]
                #address1=base58.b58encode(z + checksum)
                address2=base58.b58encode_check(z)   # adds checksum for you
                print('  output value {:<20} address {}'.format(float(x.value)/satochi_convert,address2))
            elif script_pub_key_str[0:2]==b'a9':
                #this is a scripthash (pay-to-script address)
                bytes=x.script_pub_key[1]  #number of bytes in the pub_key
                assert bytes==20
                public_key = x.script_pub_key[2:2+bytes] #20 bytes
                z=b'\05'+public_key  #used for mainnet
                address2=base58.b58encode_check(z)
                print('  output value {:<20} address {}'.format(float(x.value)/satochi_convert,address2))
            else:
                print('  output value {:<20} other {}'.format(float(x.value)/satochi_convert,script_pub_key_str))
        print()

Sample output for first transaction in your block file is:

 Transaction (txn_hash): cc728403552d5e1fddf06e6a7e8552353f315be6c1a43a8e64e4d11b081d4ca3
  output value 25.17686501          address 1N6LrEDiHuFwSyJYj2GedZM2FGk7kkLjn
  output value 0.22864963           address 1Hr9uwzwXWpjQDNUWdZ1i9qnoSpnniJe4U
....

OP codes here: https://en.bitcoin.it/wiki/Script,
scriptpubkey info: https://en.bitcoin.it/wiki/Transaction
NOTE: this is just an example of how to calculate addresses, it is not very robust as it does not check other OP codes afterwards, other possible payment scripts, etc.


BitCoinJ for Cloud based application I am currently working on a cloud based project that will be accepting payments using bitcoins.
I intend to use BitCoinJ to handle the payment. Unfortunately the only help I am able to get is from the JavaWorld demo, which seems to be out of sync with the current code. Could you please point me to some better/updated helping links/material.

There are some examples in the bitcoinj library itself which are always up to date (as they are part of the build).

The command line tool 'WalletTool' that Mike wrote is pretty useful for the basics of wallet creation, sending, receiving etc.


What other purposes can I use my [obsolete] hashing hardware for? It's pretty easy to reuse CPUs or Video cards that were previously used for Bitcoin hashing, but what can I do with FPGA hardware when the difficulty becomes too high for it to be worthwhile to mine?

Are there competing networks I can mine for?  Are there other technologies (like email/hashcash) that can reuse the hardware with little modification?

Is there a similar way to recycle old ASIC's when the time comes?

FPGAs and GPUs are reprogrammable, so you can use them for anything. FPGAs require some specialised programming, while GPUs just use OpenCL.

ASICs have specialised chips highly optimised for mining and only mining. I don't think they could ever be reprogrammed or reused to do anything else than mining blocks according to Bitcoin rules.

As for what to do with that hardware, have you considered such noble causes as Folding@home, or perhaps less noble split-key vanity mining, for example through my Vanity Pool website?


Cryptocurrency Exchanges that accept VISA Debit Card Payment Please suggest some Cryptocurrency exchanges that accept VISA Debit Card payments.

@Rizstien, I use Coinbase, they take credit/debit cards but charge 3.99% as opposed to 1.49% if you link a bank account. There is a verification process though, don't know how long it takes for credit cards. It took 3 days for my bank account to be verified. Then another 7 business days before transferred funds are available. Credit cards may take a lot less time but cost more to buy coins.


Running a full node on a macbook? I'm thinking about running a bitcoind full node to help out the bitcoin network.

Would it be feasible to run a full node through one of the new macbooks?

(12", 250GB HD, 8GB RAM, 1.1 GHz Intel Core M processor)

thanks!

It's certainly possible. I used to run a full bitcoind node on a 5 year old MacBook Air. I stopped (and moved it to a larger machine) because the size of the blockchain database was becoming annoying - it's currently 52 GB and always gets bigger. If you can spare the space, there's no problem with actually doing it.


Are transactions with an insufficient value marked as "failure"? I have made a payment with an installed CardGate(curopayments.com) bitcoin gateway on a site, got a unique deposit adres, i sent a bit less than actual asked. The problem now is that the site owner says he didn't receive any payment because this occured.

Does anyone recognise this, and where is are my bitcoins?

This is a screenshot he sent of his CardGate admin panel

Are transactions with an insufficient value marked as “failure”?

No.

The blockchain, other nodes and miners have no idea how much the recipient is expecting to receive.

If your wallet and blockchain explorers show the transaction as being confirmed then the recipient has received your money. It is now under their exclusive control.

  the site owner says he didn't receive any payment

Either they are confused or they are trying to deceive you.


When did Satoshi Nakamoto release Bitcoin v.0.1 to the public? 08 Jan 09 or 09 Jan 09? Many websites say Satoshi Nakamoto released Bitcoin on 09 Jan 2009 (Source 1) (Source 2) (Source 3).

After looking through the Satoshi Archive, it seems to have been released on 08 Jan 2009 (Source).

Just wondering, when was Bitcoin released to the public? Which of these is correct?

It depends on how you define release.

Satoshi sent the email to the Cryptography mailing list on Jan 8 2009 UTC. However because the Cryptography mailing list is moderated, that email did not reach email subscribers until Jan 9 or 10 2009 (it's actually Jan 10 2009 at 1 AM UTC).

The discrepancy you see is that many people refer to The Mail Archive source. The Mail Archive is a subscriber to mailing lists and publishes the emails it receives. So it received the email on Jan 9 in its local time. The metzdowd.com source is "more accurate" because that's where the list is actually hosted, so it shows the time that the mailing list server received the email.

Presumably the link the Satoshi provides was reachable at or before he sent the email, so you could say that Bitcoin was actually released on Jan 8.


How do you answer the question "Why 10 mins?" for beginners? I'm often asked "Why is the average mining time about 10 mins?". How do you answer this question if you are asked by beginners?

Block time is a tradeoff between:

Network propagation time
Amount of work wasted due to chain splits (miners continuing to work on the last block before becoming aware a new one was found)


How do you know how much a product costs in Bitcoins? When paying with Bitcoins how does that affect the price of the service or item? For example If I buy something that costs 20 CAD using Bitcoins and the exchange rate is 1 CAD = 0.01 BTC does that simply mean I pay 0.20 BTC? I'm not very knowledgeable about currency exchange to begin with. If the value of the Canadian dollar goes up and 1 CAD = 0.02 BTC then I would've lost money if I had did the exchange at the lower rate, is that right?

Take Privateinternetaccess for example. They have an option to pay in Bitcoins but doesn't say how much?

Most websites that accept bitcoins for goods or services work with a service that automatically exchanges the bitcoins they receive for dollars. For that reason, they also use the current exchange rate to calculate the price in Bitcoin.

So basically, when you want to buy a 10 CAD item for bitcoins, the website will calculate how much bitcoins that is and ask you to pay that amount of bitcoins.

And yes, when you hold bitcoins, the price you pay in CAD can vary as the CAD/BTC rate changes.


Why Block351543 is older than Block351542? I am a little confused here. Why the Age of older Block[351542] is younger than Block[351543].
Here is the screenshot from blockchain.info

Because blocks are created on different computers. The clock may be slightly different on them. This is not a problem for bitcoin protocol


What is the easiest way to associate an utxo to a specific account? I'm building a web application that uses bitcoind's accounts to track user balances. My dev env is currently in regtest mode. I am working on calculating the network transaction fee prior to creating a raw transaction.

When I listunspent to bitcoind over JSON-RPC, I get a multidim array that includes txid, address, and scriptPubKey (amongst other things). How can I use this information to determine which account these utxo's are tied to? I thought I'd be able to use getaccount with the returned corresponding addresses, but I'm returned an empty string. Is that because the transaction originated from the wallet 'global' account? Is that something to do with regression testing mode?

I also tried listtransactions for the specific account to match txid, but didn't have txid's because they were moves. Even if I could do this for network transactions, how would I handle utxo's that were resulting from a move?

I can getbalance for different accounts and see the correct resulting balances from using the move command. I'm beginning to question a few things so I'm not sure where I have an problem or if I'm going about this the wrong way. Ultimately, my goal is to be able to calculate tx fee so the user can approve them before sending...keeping in mind single wallet with each user having their own account.

Thanks for the help! ...it's late and my head hurts lol

The long and short of it is that you can't associate UTXOs with accounts, you can only associate addresses. From the bitcoin wiki accounts page:

  When you receive bitcoins, they are always assigned to one of your accounts, and you can change which account is credited based on which bitcoin address receives the coins, just like you tell a bank teller which account to credit when you deposit cash in your bank. However, sending bitcoins is like withdrawing cash from the bank; the coins that are sent out and debited from an account are almost always not the same coins that were deposited into that account.

If you haven't already, you should see this post about why the accounts portion of the tab isn't really scalable.

  I thought I'd be able to use getaccount with the returned corresponding addresses, but I'm returned an empty string. Is that because the transaction originated from the wallet 'global' account?

Yes, that is exactly, why. The default account is named "".

So, you can associate UTXOs with accounts through associating addresses with accounts, but when spending, there's no guarantee about where you're spending from.

As a possible work around, you might look at using this rpc call:

listreceivedbyaddress ( minconf includeempty )


Serve Bitcoin Core Wallet Remotely It is possible to serve the Bitcoin Core GUI remotely via a web page running on a server running in Digital Ocean (or any other provider)? If so, where can I find instructions on how to do this?

It's not possible to use the GUI. (If you really want to, you can use TeamViewer, which is about controlling your computer remotely and not not that efficient.) You can use the RPC API to use the most of Bitcoin Core's functionality. If you're using it as a blockchain data API, the REST API might be a better choice.


Is there a javascript library for generating litecoin address from a string? Is there a bitcoinjs equivalent for litecoin? I want to be able to generate a litecoin address using a long string.

Try this https://github.com/litecoin-project/litecore-lib.
You can generate a Litecoin address with a long string by using above library.


Can a channel be closed while the funding tx is still stuck in the mempool? I have attempted to open a channel recently, but accidentally set the fee for the funding transaction too low. Now the funding tx has been stuck in the mempool for over a week. Is there some way to close the channel even though it was never actually opened?

I started out writing this answer while trying to do it myself, but then found out that we don't yet have tools to manually edit partially signed Bitcoin transactions (PSBTs) which is the very last step before we finalize the double-spend. So this answer is currently incomplete, but I'm planning on building out that tooling and write a plugin that automates all of this, so it get much easier

Given that you're asking for c-lightning let me walk you through the options you have:
Wait and rebroadcast
If the fee is not way too low, and the peer hasn't given up yet, you could have a chance of still establishing the channel, by confirming the original funding transaction. It might require you to rebroadcast the transaction from time to time when it drops out of the mempool. To do so take note of the funding transaction that was returned when calling fundchannel or retrieve it from the database by looking its ID up:
CHANID=$(lightning-cli listpeers [peer_id] | jq '.peers[].channel_id')
sqlite3 $HOME/.lightning/bitcoin/lightningd.sqlite3 \
        "SELECT hex(rawtx) FROM transactions WHERE hex(id) LIKE '$CHANID'"

This will get you the funding tx for that particular peer. You can use bitcoin-cli decoderawtransaction to decode the transactions and verify that the txid matches the funding_txid in the lightning-cli listpeers output.
You can then rebroadcast using the bitcoin-cli sendrawtransaction or lightning-cli sendrawtransaction methods.
I suggest waiting at least over the weekend, since fees drop considerably, increasing chances of the tx confirming anyway.
Double-spending the funding transaction
If you need the funds somewhere else, or decided the channel isn't worth waiting for you can also double-spend any of the inputs and the funding transaction will never be able to confirm.
 Notice that you wont be able to open a new channel with that specific peer until both sides have given up, as from c-lightning's point of view it may still happen and we need to be ready if it does
To do this look up the funding transaction like above, then use the following to list the inputs of the funding transaction:
bitcoin-cli decoderawtransaction [tx] | jq '.vin[] | [.txid, .vout]'

Next we synchronize the UTXO status with bitcoind, since we marked the outputs spent by the funding transaction as spent (note that you need to have c-lightning compiled with DEVELOPER=1 for this to be available):
lightning-cli dev-rescan-outputs

Now pick a subset of the inputs and create a new transaction, that collides with the funding transaction on purpose to double-spend it:
lightning-cli utxopsbt satoshi=all feerate=normal startweight=756 utxos=["ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB:0"]

This gives you a partially signed Bitcoin transaction (PSBT), which has one input ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB:0 (matching the result from the decoderawtransaction results above) and no output. Notice the startweight is 756sipa, which is approximately the size of a single-input-single-output transaction which we're trying to build.
This isn't a valid transaction yet, so we need to add an output that goes back into your wallet. To do this we first generate an address to send to your wallet:
lightning-cli newaddr

And now we need to amend the PSBT to include an output with all funds (minus the fee) going to that new address.
... but we don't have tools in place yet to manually edit a PSBT, or at least I'm no aware of any. I'll follow up once we have.


How do you mathematically add and subtract hash power? My question was how do you mathematically add and subtract hash power. I recently purchased four Antminer D3s.They all run at the average rate of 19-20 MH/s but when I go to my stats in the pool that I joined I see 32.2 GH/s. Please Help!!!

You sum (add) their individual ratings. For example, if I had two miners, one rated at 20MH/s and another rated at 15MH/s, my total rate would be 20MH/s + 15MH/s = 35MH/s.


Will Core ever adopt Segwit by default? There is no excuse for current companies that do not adopt Segwit. It looks very scammy.

However, does Core plan to adopt Segwit by default at some point? Is it a matter of money or anything else?

Just being curious. Thanks.

Full SegWit support in the Bitcoin Core wallet is planned for the next release.

It is a matter of testing and review: https://github.com/bitcoin/bitcoin/pull/11403


Exporting private key from Bitcoin Core to claim my BCH on Exodus My BTC is currently in a Bitcoin Core wallet and this is where I want to keep my BTC.

I'm trying to claim my BCH, while using Exodus as the wallet.

However, when I try to "move" my funds via Exodus > Developer > Assets > Bitcoin Cash > Move Funds (WIF)... by entering my private key, I get an error that states "Invalid network version".

What am I doing wrong??

Hi there have you tried these steps?

How do I claim Bitcoin Cash?

UPDATE:

As of OCTOBER 12, 2017, Bitcoin Cash has been enabled in Exodus 1.36.0 so you can now send Bitcoin Cash to Exodus. To download the latest version, please go here:

http://support.exodus.io/article/27-how-do-i-upgrade-exodus

Below are the instructions on how to claim Bitcoin Cash if you had Bitcoin on July 31st, 2017.

Important: This will not work unless you are updated to the latest version of Exodus.

To claim your Bitcoin Cash inside of Exodus click on the help section then scroll all the way to the bottom of the help section to find the section titled; "How Do I claim my Bitcoin Cash." When you open that help section you will see a green button to start the process on claiming your Bitcoin Cash.

Step 1: Click on the Help button on the left side of Exodus. (Scroll down for Step 2)

Step 2: Scroll all the way to the bottom of the help section and find the help article titled "How do I claim my Bitcoin Cash?" - Click on that to expand it. (Scroll down for Step 3)

Step 3: Read the text to tell you a little about the process then click the green button to begin to claim your Bitcoin Cash. (Scroll down for Step 4)

Step 4: Exodus tells you the process is starting and gives you some information and a warning to be sure you are sending your Bitcoin Cash to a trusted source. Click the Blue Continue button. (Scroll down for Step 5)

Step 5: Exodus now asks you for your Bitcoin Cash address to know where you want your Bitcoin Cash sent. If you're updated to Exodus 1.36.0, you can now acquire your own Bitcoin Cash address. Feel free to input your Exodus BCH address to send it there or send it to any other Bitcoin Cash wallet of your choice. (Scroll down for Step 6)

Step 6: Exodus will now check your wallet and count up all your available Bitcoin Cash to send out. Depending on how many transactions you have - this process takes about 10 minutes. Click the blue "Check My Wallet Now" button to begin. (Scroll down for Step 7)

Step 7: Exodus now tells you the total amount of Bitcoin Cash you have to send out and also gives you the network mining fee this transaction will cost to send out. Because Bitcoin Cash blocks today are a bit slower this transaction could take 1-2 hours to confirm. If everything looks good click the red "Send" button. (Scroll down for Step 8)

Step 8: Your Bitcoin Cash has been sent! You can click on the blue "View TX" button to monitor the status of your transaction. Remember Bitcoin Cash today can take 1-2 hours to confirm so be patient while you monitor your receiving address.

How do I claim Bitcoin Cash?

UPDATE:

As of OCTOBER 12, 2017, Bitcoin Cash has been enabled in Exodus 1.36.0 so you can now send Bitcoin Cash to Exodus. To download the latest version, please go here:

http://support.exodus.io/article/27-how-do-i-upgrade-exodus

Below are the instructions on how to claim Bitcoin Cash if you had Bitcoin on July 31st, 2017.

Important: This will not work unless you are updated to the latest version of Exodus.

To claim your Bitcoin Cash inside of Exodus click on the help section then scroll all the way to the bottom of the help section to find the section titled; "How Do I claim my Bitcoin Cash." When you open that help section you will see a green button to start the process on claiming your Bitcoin Cash.

Step 1: Click on the Help button on the left side of Exodus. (Scroll down for Step 2)

Step 2: Scroll all the way to the bottom of the help section and find the help article titled "How do I claim my Bitcoin Cash?" - Click on that to expand it. (Scroll down for Step 3)

Step 3: Read the text to tell you a little about the process then click the green button to begin to claim your Bitcoin Cash. (Scroll down for Step 4)

Step 4: Exodus tells you the process is starting and gives you some information and a warning to be sure you are sending your Bitcoin Cash to a trusted source. Click the Blue Continue button. (Scroll down for Step 5)

Step 5: Exodus now asks you for your Bitcoin Cash address to know where you want your Bitcoin Cash sent. If you're updated to Exodus 1.36.0, you can now acquire your own Bitcoin Cash address. Feel free to input your Exodus BCH address to send it there or send it to any other Bitcoin Cash wallet of your choice. (Scroll down for Step 6)

Step 6: Exodus will now check your wallet and count up all your available Bitcoin Cash to send out. Depending on how many transactions you have - this process takes about 10 minutes. Click the blue "Check My Wallet Now" button to begin. (Scroll down for Step 7)

Step 7: Exodus now tells you the total amount of Bitcoin Cash you have to send out and also gives you the network mining fee this transaction will cost to send out. Because Bitcoin Cash blocks today are a bit slower this transaction could take 1-2 hours to confirm. If everything looks good click the red "Send" button. (Scroll down for Step 8)

Step 8: Your Bitcoin Cash has been sent! You can click on the blue "View TX" button to monitor the status of your transaction. Remember Bitcoin Cash today can take 1-2 hours to confirm so be patient while you monitor your receiving address.


Links for websites that were used to show miners signaling support for segwit Anyone got links for websites that were used to show miners signaling support for segwit? or screenshots?
Also wanted to confirm if my assumptions are correct about the whole thing:

Initially BIP 9 was supposed to activate segwit but there was lot of controversy
BIP 91 was proposed but again controversy
BIP 148 was proposed and everyone agreed to activate BIP 91
Finally BIP 141 was used to activate segwit

On Pieter Wuille's website there are graphs about the Bitcoin network.
These feature graphs of the block version (used for version bit signaling) across time.


Can I generate an address without using bitcoin core? I am running bitcoin core in my mode. I am using getnewaddress to generate an address and then I am using unspent to get the unspent of an address which returns the unspent successfully. If I created an address without using getnewaddress (using some 3rd party or offline) and when I am using unspent on that address it is not giving the unspent instead it is returning an empty list. Could anyone tell me how to solve this?

Bitcoin Core does not store the information for all addresses as that would be computationally expensive and not very useful. For you to get this data, the address needs to be part of your wallet. So you must add the address to the wallet using importaddress and allow Bitcoin Core to rescan the blockchain. It will then find all of the transactions related to that address and look for new transactions related to that address. Note that rescanning can take a long time so if you want to import multiple addresses, use importmulti.


BitLaunder's mixer vs "major exchanges" mixer BitLaunder (seemingly created by syadasti) writes:

  Secure Launder renders your bitcoins completely untraceable, even to
  the most persistent forensic investigator. You deposit bitcoins into
  your BitLaunder wallet, where we scramble them with coins of other
  users. When you withdraw your coins, however, we send them from a
  completely different wallet, a wallet located in untraceable
  'onionland' where there is no history whatsoever of your coins.

However, it is trivial to send bitcoins from a completely different wallet. For example, we can do it ourselves using the default "mixing" services provided by some major exchanges like BitStamp which places bitcoins from all users into a common pool. We can even manually (or via a bot) add in some delay prior to withdrawing so that the transactions are harder to trace.

As such, is it true to say that technologically speaking, there are no difference between the mixing services provided by BitLaunder and by BitStamp, and they are basically the same thing except provided by different parties?

How does a mixing service located in "untraceable onionland" (I suppose it meant a wallet which only does transactions on the Tor network) give us more security and/or anonymity compared to a mixing service located in the normal Internet?

It probably doesn't give you more security, and in fact if the mixer service's coin volumes are low, which they likely are, and dependent on whatever their turn around time may be, and dependent on how many coins you are asking them to mix, it is very possible for you to get back some of the same coins you sent to them. Unless they were verifiably in a nation which is very unfriendly to whatever country you're in, such as North Korea if you're in the USA, then they likely don't offer any additional security against government agencies compared to a major exchange located in another country, like BTC-e in you're in the USA.

Even if they were to send you different coins, they are still most likely going to be attached to legally questionable transactions due to the very nature of this service. So instead of the block chain showing you received coins from someone who buys Cocaine on Silk Road 2, it'll now show that you received coins from someone who buys Heroin. Either way you still look like a drug dealer.

And to address bitlaunder.com specifically, their service is outright laughable. Go read their Privacy Policy

https://bitlaunder.com/privacy_policy

They say:

Sharing Information With Government Agencies / Court Orders

We will NOT comply with any court order for information pertaining to our clients,
nor will we comply with any government request (of any country) for information
about our clients.

But then say:

California Online Privacy Protection Act Compliance

Because we value your privacy we have taken the necessary precautions to be in compliance
with the California Online Privacy Protection Act. We therefore will not distribute
your personal information to outside parties without your consent.

As part of the California Online Privacy Protection Act, all users of our site may
make any changes to their information at anytime by logging into their control panel
and going to the 'Edit Profile' page.

Children's Online Privacy Protection Act Compliance

We are in compliance with the requirements of COPPA (Children's Online Privacy
Protection Act), we do not collect any information from anyone under 13 years of age.
Our website, products and services are all directed to people who are at least 13
years old or older.

So they wont comply with American and foreign court orders, yet they seem to be very concerned with complying with American and Californian privacy laws? Sure sounds odd for a money laundering service.

And although their DNS name is registered to a proxy, and their website is behind the CloudFlare CDN, we can run a reverse DNS query on the IP assigned to their MX entry (64.90.187.212) which tells us that their email server is at a colocation facility in New York because its DNS name is 64.90.187.212.static.nyinternet.net. The banner for that SMTP server identifies its primary domain as mail.bitspeculate.com. We can further prove that both services are ran by the same person because if you create a account at BitSpeculate, login, and go to https://bitspeculate.com/member_area/mtrans_my_accounts and view the HTML for that page you'll see this commented out:

Contact

And the twitter account for BitSpeculate says it is ran by Michael Moriarty (which very well may be a pseudonym) in Vancouver BC. The picture for this account is for Professor Moriarty from the recent Sherlock Holmes movie, and according to Wikipedia, Prof. Moriarty is "Sherlock Holmes's archenemy, Moriarty is a criminal mastermind whom Holmes describes as the "Napoleon of crime"." Do you really want to trust you money with someone who fancies themselves as a criminal mastermind? And if you read through the BitSpeculate Twitter account you can't just help but laugh at the irony of someone who runs a exchange and laundering service talking about how online wallets are unsafe.

BitSpeculate itself seems like it very well might be a fraud because after creating a account, I see that they will not tell you the volume of trades for their cryptocurrency markets which seems exceptionally odd for a cryptocoin exchange. And their price data doesn't stream live, but is instead manually inserted in to the HTML via PHP script.

If the sites creator was this sloppy covering their tracks, arrogant in choosing their pseudonym, incompetent in regards to web development, and if I can find out this much about them in a few minutes, I'm pretty sure a government with the ability to subpoena service providers and execute search warrants could find out whatever they wanted to know about this service and its customers with little trouble, regardless of whether or not the sites operators would cooperate or whether or not they are using Tor.

And finally, BitLaunder does not appear to be ran by syadasti. If you read the reddit post you linked, syadasti is running a different service - bitlaundry.com which does not use Tor. If you read the article linked in the reddit post, Mike Gogulski seeming outs himself as syadasti in the comment section by saying he runs bitlaundry.com. And according to Mike's GitHub account he is based in Bratislava, Slovakia. If you google his name some more you can see he was an American who renounced his citizenship, and now has to deal with the trouble of not having a passport and the consequences that brings such as he says "he was once detained by Slovak police outside a bar, beaten and had no one to turn to for consular help." So I'm guessing if a government wanted to force him to reveal who his customers are, it wouldn't be that hard for them to beat it out of him.


enable bitcoin SSL error I want to enable SSL on windows.So I download a shining light openssl binary,and then I create server.pem and server.cert using the following commands:

openssl genrsa -out server.pem 2048
 openssl req -new -x509 -nodes -sha1 -days 3650 -key server.pem > server.cert

and then I start bitcoin-qt with bat:

bitcoin-qt.exe -testnet -datadir=G:\BitcoinData-Testnet -conf=bitcoin.conf -server -rpcuser=usr -rpcpassword=pwd -rpcport=18332 -rpcallowip=* -rpcssl -rpcsslcertificatechainfile=server.cert -rpcsslprivatekeyfile=server.pem -txindex -lang=en_US

then I try to test SSL by executing commands:

openssl s_client -connect localhost:18332

the response is:

E:\apps\Bitcoin>openssl s_client -connect localhost:18332
Loading 'screen' into random state - done
CONNECTED(000001C4)
9032:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:.\ssl\s23_lib
.c:177:
---
no peer certificate available
---
No client certificate CA names sent
---
SSL handshake has read 0 bytes and written 319 bytes
---
New, (NONE), Cipher is (NONE)
Secure Renegotiation IS NOT supported
Compression: NONE
Expansion: NONE
---

E:\apps\Bitcoin>openssl genrsa -out server.pem 2048
Loading 'screen' into random state - done
Generating RSA private key, 2048 bit long modulus
....................+++
...........................................+++
unable to write 'random state'
e is 65537 (0x10001)

can somebody help me ? is server.pem produced correctly?

found out the issue,I'm running bitcoin in testnet while I put server.pem and server.cert in the data dir not under the "testnet3".As I moved the two files,things be OK.


Syncing Issues - Hashrate? Okay, I cloned a Dash source (learning)

Compiles fine on Linux/Win, I have peers and it was mining blocks fine during the initial launch. 200 Blocks mined, all peers sync'd up fine, sent Tx between one another. Everything works perfect.

I killed mining on it as there was no need for me to keep mining it (just learning) but I have found that since then, It will not sync, at all. Is constantly showing "catching up" What I have tried:

Rescan
Reindex
Tried a different machine
Let it sit for hours.

Nothing moves sync wise and it no longer will load any blocks after reindex (stays at zero). I figured it was related to no hashrate but I can't mine anything on it since the wallet isn't synced (i'm assuming). The error i get trying to mine is

json_rpc_call failed w/cpuminer

setgenerate will only show 0 hash

Of course it isn't synced if you haven't mined blocks in a while. The assumption with networks similar to Bitcoin (and thus Dash) is that mining is constant so if a node sees that its most recent block is old, it will assume that it is not synced.

The RPC calls will check to see if you are synced and then only serve data to mining software if it is. You can just disable this check in the source code so that you can mine again.


16: mandatory-script-verify-flag-failed (Non-canonical DER signature) (code -26) I try to send transaction via sendrawtransaction in console of bitcoind.

Sig is:

  30440220494800937E4ECB15319266127A0334E94D25DFD2F594E8F846A3E7B5F36C362B0220750237958D23D390E6137B251399C5A5CE335DEC850D99A090EF3CC43259E5E301

bitcoind answer is:

  16: mandatory-script-verify-flag-failed (Non-canonical DER signature) (code -26)

Who knows why?

TX raw:

  0100000001A000000008A4730440220494800937E4ECB15319266127A0334E94D25DFD2F594E8F846A3E7B5F36C362B0220750237958D23D390E6137B251399C5A5CE335DEC850D99A090EF3CC43259E5E3014104BFFFFFFFF01C1976A914D88AC0000000001000000

A = 32 bytes of TXhash of "from" transaction

B = 64 bytes of my public key

C = 8 bytes value of BTC that I try to send

D = 20 bytes of "to" address

This error means your signature failed some sanity checks designed to prevent accidental network forks due to non-standard but still valid signature encodings. This function in the script interpreter performs the actual check.

However, I took a look at your signature, and I can't find anything wrong with it (looking at it manually, not actually running the code). Is it possible the preceding byte is wrong, so the signature isn't pushed completely onto the stack?

EDIT:

I actually ran the signature checking algorithm on your signature.
The code I used is here.

There is, indeed, nothing wrong with the signature itself. How did you generate it, and what does the rest of the transaction look like?


What meanings do the "NodeId", "Version" and "Services" convey on Peers tab of Bitcoin-qt Debug window? As shown in the picture,

Is "NodeId" the ordered number (among all the existing bitcoin-core nodes) of the node that I am connected to?

How does "Version" differ from the "User Agent" version (on the picture, Version is displayed as 70015 and User Agent is displayed as "/Satoshi:0.18.0/)"?

And lastly, what does the "Service" mean (in this case displayed as "NETWORK & BLOOM & WITN...")?

Is "NodeId" the ordered number (among all the existing bitcoin-core nodes) of the node that I am connected to?

It's just the number of the connection you made. It's not a global identifier of the node you're connected to. Every new connection you make (incoming or outgoing) is assigned a sequentially increasing number.

  How does "Version" differ from the "User Agent" version (on the picture, Version is displayed as 70015 and User Agent is displayed as "/Satoshi:0.18.0/)"?

Version is the protocol version. User agent identifies the software implementing it.

  And lastly, what does the "Service" mean (in this case displayed as "NETWORK & BLOOM & WITN...")?

The Bitcoin P2P protocol has a number of optional features that node can offer to their peers:

NETWORK means availability of all blocks since genesis
NETWORK_LIMITED means availability of the last 288 blocks
BLOOM means BIP37 bloom filters
WITNESS means support for Segwit witnesses in blocks and transactions
COMPACT_FILTERS means support for the BIP158 basic filter type


Can I convert BTC to USD without a bank account? Just asking. Say, I want to switch BTC to USD inside Steam Wallet. Is it possible?

To my knowledge, Steam does not support BTC (at least yet). Moreover, Steam does not allow one to send another user money transfers, so you can't really exchange your funds with other people. You could, however, purchase a game gift for another person and sell that gift for Bitcoins, but that would probably be against Steam's policy.

If you generally want to exchange Bitcoins for any currency without having a bank account, you could always try finding another user that also wants to trade like that and exchange money with them, either in person or through services like Western Union. This way however, is less reliable than using a Bitcoin exchange.


Any side-effects of upgrading to HD wallet in relationship to hard forks I have a very old wallet that I created about 7.5 years ago. I realize that I need to upgrade to a BIP32 (HD) wallet. I am up to date with the latest Bitcoin Core and have kept it relatively up-to-date throughout the years. My question isn't how to backup or upgrade my wallet.

Would/could there be any side-effects of upgrading my wallet to an HD wallet BEFORE I claim my BCH/BSV/BTG coins? I would like to understand the exact specifics on what happens when I upgrade my wallet and any impacts it might have (or none) before I upgrade.

There will be no effect on those other chains since they are now independent of each other, the private key corresponding to your previous UTXO will still hold the same amount of coins at the time of their fork from bitcoin core.

Here is what happen when you run -upgradewallet from: https://bitcoin.org/en/release/v0.17.0#upgrading-non-hd-wallets-to-hd-wallets

  Upgrading non-HD wallets to HD wallets
  Since Bitcoin Core 0.13.0, creating new BIP 32 Hierarchical Deterministic wallets has been supported by Bitcoin Core but old non-HD wallets could not be upgraded to HD. Now non-HD wallets can be upgraded to HD using the -upgradewallet command line option. This upgrade will result in the all keys in the keypool being marked as used and a new keypool generated. A new backup must be made when this upgrade is performed.

  Additionally, -upgradewallet can be used to upgraded from a non-split
  HD chain (all keys generated with m/0'/0'/i') to a split HD chain
  (receiving keys generated with 'm/0'/0'/i' and change keys generated
  with m'/0'/1'/i'). When this upgrade occurs, all keys already in the
  keypool will remain in the keypool to be used until all keys from
  before the upgrade are exhausted. This is to avoid issues with backups
  and downgrades when some keys may come from the change key keypool.
  Users can begin using the new split HD chain keypools by using the
  newkeypool RPC to mark all keys in the keypool as used and begin using
  a new keypool generated from the split HD chain.

For a proper way to upgrade to an hd wallet check How do I migrate my Bitcoin Core wallet to an HD wallet?


Bitcoin optional fees create transaction ordering problems? I've tried to find a solid answer to this transaction ordering question and the practical and technical issues that do not seem solved.

My understanding is that after I create a transaction, I can choose to add a fee for miners to pick up my transaction. I submit it to the network for propagation. Miners look in the unspent transaction pool and choose which they want to include in a new block. I saw this Tweet which seems to confirm a transaction ordering problem - using the same transaction input for two transactions with the latter being a high fee and that one confirmed first. I don't understand why several responders seem to to believe this isn't a problem.

https://twitter.com/alexbosworth/status/1028031387201236992?lang=en

I am near 2 stores that accept Bitcoin. I spend an input at Costco with no or a little fee. It hangs in the mempool like above. An hour later I am at BestBuy and spend the same input but include a fee -- and that transaction gets picked up and processed first by a happy miner.

1) Even if Costco waited an hour, there is no guarantee that my earlier transaction will be confirmed in a block in 10 minutes or 210 minutes. It's still too long for BestBuy to wait 5 additional confirmations after the first.

2) There is no guarantee that even if that the first Costco transaction was picked up by a miner, that a second miner that picked up the BestBuy transaction a little later couldn't complete a block which would eventually be in the longer chain. In that case too, the first in transaction eventually gets bounced off the chain.

Fundamentally, this is why nobody should be accepting zero confirmations, until the payment has confirmations it’s not really a payment made. This is generally referred to as double spending, as clearly only a single payment can confirm in your scenario. If stores want to accept payments in an unsafe fashion, that’s their risk to bear and insure for.

Technology like Lightning can be used to make instantly confirming transactions safely if this sort of retail experience is desirable, though this comes with its own hurdles.


BlockNotify/WalletNotify - but without the console window I use the walletnotify and blocknotify config options on bitcoind to have the server call two executables on new transactions/blocks. This all works fine. The two executables (Windows executables) are both designed to run without a console window, and they do.

That is, they do when I run them. When bitcoind runs them, I get a brief flash of a console window. As I run these on my development machine while developing, it's driving me to distraction. Does anyone have any idea to prevent this happening?

I took me some, but I think I have an answer. I went trough the source code and found the runCommand() function that actually starts the command provided by notify options (it is called mostly from main.cpp and the code runs in a separate thread).

From util.cpp

void runCommand(std::string strCommand)
{
    int nErr = ::system(strCommand.c_str());
    if (nErr)
        LogPrintf("runCommand error: system(%s) returned %d\n", strCommand, nErr);
}

It uses the standard C library method system(), which is probably giving you the flashing window. Normally one would use CreateProcess() (or similar) to prevent the flash effect and have much more control over the spawned process (I don't know why the developers chose system() here, but I guess it was just easier). I believe the behavior of the system() call is system dependent.

Also, when you say bitcoind, you mean the CLI interface of bitcoin, right? Is there a bitcoind console window running? As for a solution, you could edit the source code to use CreateProcess() with the DETACHED_PROCESS flag, that would do the trick.


Algorithmic efficiency for transaction lookup in blockchain Since bitcoin uses binary Merkle trees (just learned that), I want to know what would be the algorithmic efficiency for transaction lookup in the blockchain.

I don't know exactly how the data structure underneath the blockchain is organized.

AFAIK, each block contain a single Merkle tree, which can be related to the previous block tree by the prevId field in its own block header.

Given all that, I was wondering if, given a TXID, I would be able to locate that transaction in the blockchain in logarithmic time (O(log2 n)) as just a simple tree traversing, or if there are some hidden details I'm not considering.

No, you can't. The block chain is a linked list of blocks, and each block contains an array of transactions. Block headers commit to a Merkle tree of the transactions in them, but they are sorted chronologically, not by txid, so you need a linear search. If you want to find a transaction in a block quickly, you'll need an external index data structure.

There is however also no need for that in normal operation of a Bitcoin node or wallet.

For verification, a set (which is internal to the operations of a node, and not part of the block chain) of unspent transaction outputs is maintained, indexed by txid (the so-called UTXO set). This set represents the 'state' of the ledger at a given point in the block chain, and blocks can be seen as 'patches' to the UTXO set: transaction inputs remove ("spend") entries from the UTXO set, and transaction outputs create new ones.

Wallets maintain their own set of transactions relevant to the user's balances. These are typically indexed, but much smaller than the set of all transactions in the blockchain, and often just kept in memory.


Error connecting to json rpc server For testing purposes, I need to connect from a web page in my shared hosting account (on the public internet) to my json rpc server which is running on my laptop . So bitcoind is running on my laptop, which is behind my router, and I have a shared web hosting account with easybitcoin.php running on it.

Let's say my router's public IP is 1.2.3.4, and the web server (where easybitcoin.php lives)'s IP address is 5.6.7.8, and my laptop LAN address is 192.168.1.99

The error I get is

  Failed to connect to 1.2.3.4 port 8332: Connection refused

bitcoin.conf

server=1
rpcallowip=5.6.7.8
rpcport=8332

Router Port Forwarding

Firewall

Down. I checked it at the router and on the laptop (where there is an exception for bitcoind).

DMZ

Laptop is in the router's DMZ.

VPN

off

Online Port Scanner Check (looks good)

Result: 1.2.3.4 is listening on port 8332

Going to http://192.168.1.99:8332/ from inside the LAN (looks good)

JSONRPC server handles only POST requests

Going to http://1.2.3.4:8332/ from inside the LAN

A connection attempt timed out.

Going to http://1.2.3.4:8332/ from the public internet (I made an rpcallowip=IP of the testing website)

403 Response (0 characters)

Going to http://1.2.3.4:8330/ from the public internet (bogus port)

Connection timed out.

Once I get this working I will go back and tighten everything back up. But I need to get it working first. I must be missing something.

I could never get this to work. So as a work-around, I port forwarded http and https, and made and http endpoint that in turn called the function in question and returned the result. A roll-your-own http wrapper around bitcoind, because I couldn't get the bitcoind http server to accept a connection coming in from the outside to my router. This is not ideal, since I must turn off VPN to get even this to work.

I can tell by the settings available in bitcoin.conf that this functionality was intended to be possible. Therefore, I see this as a documentation failure. Someone somewhere knows how to do this, and I'm sure it's trivial to them, but it's a well kept secret.

I request an example of specifically this be added to bitcoin.org, since this is functionality intended to be possible.