Which scripts are currently considered standard and therefore actually propagated?

I know of four standard scripts.  As Luca said, the source code for the reference client is the protocol definition, so you need to read the code to get the definitive answer.  As Peter noted, a standard script is one that is relayed by the reference client.  A non-standard script will not be rejected if it is in a block as long as it is a valid script.

The ones that I know are:

Pay-to-PubKey-Hash: This is the standard payment to a bitcoin address.  The address is in the output and the signature and pubkey are in the input.
Pay-to-Pubkey: This is a payment to a pubkey.  The pubkey is in the output and the signature is in the input.
Pay-to-ScriptHash: This is being used for some of the fancier payment transactions.  A script hash is in the output and the signature and a serialized script are in the input.  On the first pass, the script hash is verified against the serialized script.  If it checks, then the serialized script is expanded and a second pass is done using that script.
Pay-to-MultiSig: Multiple signatures are required to sign the script.  The output contains the pubkeys and the input contains the signatures.  All signatures must be verified by one of the pubkeys but there can be more pubkeys than signatures.  The current limit for M of N scripts is N=3.


Is auditing a BIP32 tree only possible if it is non-hardened?

That is correct, you can only do this with non-hardened derivation. Only non-hardened derivation can use the master public key to derive all of the public keys. With hardened derivation, you must have the master private key in order to derive anything.


How do I find where the BTC are sent to from a blockchain.com address page?

Blockchain.com is an explorer, and like most explorers, it will show any transactions that spend from that address as well. If there are no such transactions, then the received coins have not been spent yet.
Note that even if such transactions are visible, it is not guaranteed that you will be able to identify where the coins were sent. Addresses are pseudonymous, and it is not always possible to identify the owner of the addresses the coins are sent to.


How do I concatenate two hashes in Python?

You have to byte-swap the hex values BEFORE concatenating them. You also have to byte-swap the double hashed hex string!

      import hashlib
      header_hex = "435fc2d898ebcd7821c6d407d8d915f9ef4f106057df089ddf3be7abbeef51a7435fc2d898ebcd7821c6d407d8d915f9ef4f106057df089ddf3be7abbeef51a7"

      header_bin = header_hex.decode('hex')
      hash = hashlib.sha256(hashlib.sha256(header_bin).digest()).digest()
      hash.encode('hex_codec') 'b3b366122163d146f56ecdcd0f5029f387da1d9f62e0fbb4b9c22c3eaaa0ec15' >>>

      hash[::-1].encode('hex_codec') '15eca0aa3e2cc2b9b4fbe0629f1dda87f329500fcdcd6ef546d163211266b3b3'


My phones died and can't restore wallet on Copay

Have I just lost all my bitcoin?

Since you haven't practised recovery, that is possible. Likely even.

  there is NOWHERE to put the 16 characters code.

It's not obvious what that 16-character code might represent.

CoPay uses a 12-word recovery phrase (sometimes called a "recovery seed" or "wallet seed")
Bitcoin private-keys are 256-bit numbers usually shown as 64 hexadecimall characters

You normally need one of those or a wallet backup file .

What you can do

Contact CoPay / BitPay
Read the CoPay FAQ
Read about CoPay recovery
Ask new questions here about anything specific you need help with.


What are the relations between these number theorems and ECC?

Only on a high level (because I won't do your homework for you)

principal rest and modulus create groups in particular F_p which are fields arising from the the ring of integer modulo a prime. You can look at elliptic curves over such a field (which is a discrete set of points) and define a geometric point addition which (surprisingly?) is a group again. If you find cyclic subgroup with a generator of high (prime) order it will be useful for cryptography for two reasons:

The discrete log problem seems to be difficult
Related to 1.) factorizing the large generator into its primes is hard (which is related to the fact that computing the greatest common divisor) is also hard.

I hope you see the gist where this is going. I strongly recommend reading up the wikipedia articles of the topics you mention. But connecting the dots is obviously  up to you.


How can I tell when `rescanblockchain` is finished?

rescanblockchain will block until it is complete. This will happen for any RPC which rescans the blockchain.

However, this does not mean that the RPC interface is unusable. You can still interact with it from another thread. If a rescan is taking too long, you can use abortrescan from another thread/process (e.g. another terminal session) to cancel the ongoing rescan.

There are no RPCs for seeing the progress of a rescan. However, if you are using bitcoin-qt, a dialog window will appear with a progress bar showing the rescan progress.


No,
It is normal to be able to receive money into an empty wallet. Anyone who says otherwise is a thief trying to trick you and steal your money.
Wallets are not verified in any way by the Bitcoin network. Again, anyone who says otherwise is probably a confidence trickster trying to fool you into giving them your money.
Scammers like to use words that have some special meaning in the Bitcoin world and twist them to confuse their victims into doing what the scammer wants. In the Bitcoin world transactions are verified but not wallets. You can use Bitcoin without using any trusted third party such as a bank or exchange. If you do use a Bitcoin exchange they may ask questions as part of the Know-Your-Customer (KYC) laws, but this isn't verification of a wallet.
When you use Bitcoin to pay someone, your wallet creates a proposal for a transaction and sends this to a few other Bitcoin nodes (wallets etc). Those other nodes verify the transaction. The transaction has a transaction-fee included in it but the fee does not depend on the amount of money, only on the complexity of the transaction. The fee is usually very small (cents) but may need to be larger (a few dollars) when the Bitcoin network is very busy.

If you suspect someone might not be being completely honest with you, you can read some answers to questions here that will prepare you for some of the ways in which these kinds of thieves work:

fraud (Bitcoin)
scams (Personal Finance)


If you are restoring a backup from before you had done addwitnessaddress to your addresses, then it will not know to look for the segwit scripts that correspond to your wallet. You will need to do addwitnessaddress again for all of your addresses and then rescan the blockchain in order for your wallet to find those transactions.


How much does it cost to buy and sell bitcoins?

Mt. Gox takes a 0.6% fee.

Bitstamp a 0.5% fee.

You also have to consider the time it would take you to get your account approved, and your cash to reach the exchange from your bank, plus any bank fees (both sides).


Accounts are an internal bookkeeping mechanism of the Bitcoin client. They are not the same thing as addresses. When you move from one account to another, the coins remain in the same address, and if you need to spend them they will be spent from the same address. The only thing moving does is subtract a number from one account and adding to another - both of which are just things the client displays and nobody else on the network has any knowledge of. An account balance can also be negative.

Accounts are good if you run a shared eWallet and want to track users' balances (and "move" can be used to make an intra-bank transfer), or if you want to keep track of different purposes of savings (so you can direct all incoming coins to an account called "unallocated" and then move 100 BTC to the account "college fund"; if you make sure to designate all outgoing transfers as coming from "unallocated", you will not accidentally dip into the college funds, no matter in which addresses your bitcoins physically sit).


What is the method to determine the total market capitalization of the Bitcoin market?

"Bitcoin market cap(in AUD)" = "Number of bitcoins in circulation"   X   "Value of single bitcoin(in AUD)"

The same as a market cap of some company: "number of their shares" X "value of single share".

Market cap means what would be the money you get if you sell all the bitcoins at current price.

Number of bitcoins in circulation can be calculated by going through all blocks of the main blockchain and sum the bitcoin reward of each of them.


What is the simplest python program that would query the bitcoin core client for a raw tx?

If you are still downloading the blockchain and you haven't downloaded and verified that transaction yet, then of course you will get an error when you try to look it up, Bitcoin Core doesn't know about it yet!

Furthermore, if that transaction is not part of your wallet or in the UTXO set (i.e. one of the outputs is unspent), then getrawtransaction won't work. Bitcoin Core can only retrieve arbitrary transactions if you have enabled the transaction index with txindex=1.


The fact that you need to pay a transaction or not is determined by the priority of a transaction.

Currently the priority of a transaction is calculated with this formula.

priority = sum(input_value_in_base_units * input_age)/size_in_bytes

The minimum transaction priority for free transactions is actually 57,600,000.

Because you have all the coins in the same transaction output and I guess you will send them to one unique address the transaction size will be about 250 bytes. You have:

min_free_input_age = (min_priority_for_free_tx * size_in_bytes)/input_value_in_base_units
min_free_input_age = (57600000 * 250) / 38000000
min_free_input_age = ~378

So you have to wait 378 blocks (~3 days) before you can spend your coins without TX fee.
But note that once sent it will probably take 2 or 3 days more before the transaction will be added in a block.

Please correct me if there is a calculation error.


What are the requirements for a ScriptPubKey to be valid?

In theory they can have any arbitrary script. In practice, only a handful of scripts are considered standard and will be relayed on the network: pay to pubkey, pay to pubkey hash, null data (op_return), pay to script hash and raw multisig.


Error unlocking bitcoin core wallet with JSON RPC

You should write exactly

walletpassphrase "yourPassword" howmanysecondswillthewalletstayunlocked

For example

walletpassphrase "password33482" 6000

Then your wallet will stay unlocked for 6000 seconds.

(You can drop the quotes if your password doesn't have spaces, but it's always a great habit to use quotes.)


where is the code about sending command getblocks in bitcoin source code

You're correct: the Bitcoin Core master branch no longer sends the getblocks message because it uses headers-first synchronization to get all the headers (with the getheaders message), allowing it to hash the headers itself, verify their proof-of-work, and request the corresponding blocks in parallel from multiple peers with getdata messages.  I believe the upcoming version 0.10 branch is supposed to be forked off of the master branch later today.  (Will update answer with link when that happens.)

Here are some direct code links:

Bitcoin Core 0.9.3 sends the getblocks message with this line.  That function is defined here.
In the master branch, this is the patch that replaced the line above

Bitcoin Core version 0.10 will continue to process the getblocks message from remote peers, as you note.


My altcoin bitcoinj fork is failing when trying to compile an Android wallet

You've changed the MAX_MONEY parameter, so you need to change the tests that depend on it.

This appears to be the offending file.

P.S. Changing MAX_MONEY will not change the maximum number of coins. See: Why doesn't changing MAX_MONEY change the maximum number of coins?


Can the mining pool with the most mining power always win?

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

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


I was able to connect one of my node with other (both v0.21.0)

I copied the IP address from local address returned in getnetworkinfo
Used it in bitcoin.conf of other node in below format:
testnet=1
test.addnode=IP


What is a decent value for Time Lock Delta on a lightning network node?

The timelock value can be up to 14*144 = 2016 or the expected amounts of blocks to be mined with 14 days.

Generally the cltv delta is a trade of:

The higher you choose this value the longer your node can be offline without you rising to lose funds. However other nodes might select not to route payments through you as the routing process if hiring the chain can technically last as long as the cltv delta.

The reason why you will see various values in the gossip update_channel messages (which 1ml depicts) is probably implementations use different default values and have also changed the defaults with various versions. I think it was 144 for one of the implementations and it came down to 6 or 9. Eclair mobile wallet which mainly creates private channels that you don't see on 1ml users 2016 because mobile phones might have longer downtimes


Maybe you could check waybackmachine? I've searched a bit on there and can't seem to find a login page somewhere on the website in 2014/2015.

Altho it's crazy how often Ripple updated their complete layout.
Almost every year they have a new design.

https://web.archive.org/web/20150204002201/https://ripple.com/


How can we access all transactions, including spent transactions, through bitcoind?

The problem begins by the fact that bitcoid doesn't keep that kind of information for spent txs, which however serves the typical QT user.

All you have to do to obtain a record for spent txs is:

run ONCE ONLY bitcoind with arguments: -reindex=1 -txindex=1, allow it quite some time to complete, add -debug -printtoconsole if you want to see the re-indexing progress in real-time
add: txindex=1 to bitcoin.conf


Node: How to keep persistent incoming connection?

Solution: The node has been sending my script ping messages, but my script was not responding with pong messages.

  The ping message is sent primarily to confirm that the TCP/IP connection is still valid. An error in transmission is presumed to be a closed connection and the address is removed as a current peer. https://en.bitcoin.it/wiki/Protocol_documentation#ping

Therefore, my script "node" appeared to be unresponsive, so the local node would drop the connection.

Thanks to Pieter Wuille for pointing me in the right direction.


Bitcoin Transaction Protocol Question (maybe specific to Coursera Bitcoin Lecture)

It doesn't matter whose coins are funding (inputs) for the transaction the validation check still works.

  (sum of input values) - (sum of output values) >= 0

There's nothing that states sum of input values on a per user basis. As long as the total value of the inputs, no matter who or where they come from, exceeds or equals the total value of the outputs the transaction passes the check.

Update: It's not an exploit. Each transaction input is treated separately and the condition to spend each input must be met separately. If Alice supplies an input tx then she'll also have to supply a scriptSig for that single input to prove she's entitled to spend it. Likewise with Bob's transaction, he'll have to supply a completely separate scriptSig that proves he's entitled to spend his input transaction.

Alice can't spend Bob's transaction and vice-versa (unless it's a multisig, spend by anyone etc) no matter how they are combined as inputs.


Bitcoin contracts. Are there good examples in the blockchain?

Advanced contracts are hardly used currently, if at all - simply because the software to construct the necessary transactions has not been written yet. I doubt you will find examples on the blockchain.


How to get output linked to input in SPV node?

You can't get a previous transaction via the p2p network based on the txid.

If you use BIP37, fees for received transactions are difficult to calculate in a decentralised way.

Have a look at BIP158 which will probably be available on the network soon.
It has a feature to find the block of your previous txout as well as it doesn't have the privacy problem of BIP37.


Why would sending a raw transaction from a different node fail?

The problem is when you createrawtransaction it never gets transmitted/relayed to the network. If you look at the bitcoin wiki for the rawtransaction you can see:

createrawtransaction [{"txid":txid,"vout":n},...] {address:amount,...}
Create a transaction spending given inputs (array of objects containing transaction outputs to spend), sending to given address(es). Returns the hex-encoded transaction in a string. Note that the transaction's inputs are not signed, and it is not stored in the wallet or transmitted to the network.

same with signrawtransaction, it signs the create transacition that is stored in the leveldb or whatever db bitcoin uses but is not transmitted to the network.

Only when you issue the command sendrawtransaction does the signed transaction get transmitted to the peers.

Hope I answered your question!


block bitcoin signal

What signalling? Do you mean mining?

  Is it possible?

Maybe, for some pools. But it may not be possible for some pools. Here's a tweet from ViaBTC's CEO:

Source: https://twitter.com/yhaiyang/status/909309756220653570

  Is there any way to bypass it?

Sure, they can set up VPNs on their US or other countries' servers.
But no one will do that. No one wants to go to jail for that.

  Will Core release new update to prevent this?

Are you asking, that what is going happen to difficulty? Currently 70% of the hashrate comes from China, if they shut down at the same time, then the block will come every ~ 35 minutes, not 10, making the mempool bigger and transaction fees will go up.

Core can release an emergency update, that is scheduling a hard fork to lower the difficulty.


You'll attain about 0.1MH/s with an overclocked and overvolted Raspberry Pi. 963437 years on average to generate a block, or averaged to 0.00000007 BTC a day when using a pool. Not enough to cover the 5W power draw.


difference between pre-mining and mining

Pre-mining means that new coins have been mined before the coin has been made public. Which means the creator of the new currency had an unfair advantage and started with a large amount of coins before anyone else had the chance.
Pre-mining often deters other people from joining and any currency is useless without users.


what's the difference of the two trading engines?

The price in real-time trading exchanges is determined dynamically based on supply and demand. People sell and buy which influences/determines the price fluctuations.

The price in fixed rate trading exchanges is whatever the seller chooses to; e.g. selling 1btc for $450 each. That price is usually determined by consulting real-time exchanges and the seller will update the price accordingly.


How to get balance of tens of thousands of addresses?

I think your should consider that using an API could result in fakes, wrongly-validated data. Using an API means you fully trust the API service,... which is kind-of against bitcoin no-trust model.

I recommend you to run a full node (Bitcoin Core 0.13.2 during time of writing).

There is no address-index (there is a patch you can manually compile into Core).

Simplest way with standard Bitcoin-Core 0.13.2 is to import all your addresses as watch-only into a wallet.

import addresses

Use the RPC call importaddress <address> "" false to import a watch only address.

The 3rd argument false is required to not rescan the blockchain for each import (can take serval hours).

Once you have imported all addresses, stop bitcoind/qt and restart it with the startup argument -rescan.

The rescan may take a couple of minutes/hours (depending on your Disk/RAM/CPU). Once done, you can call getreceivedbyaddress <addr> for each address to get the balance.

This result in authentic, self-validated data.

Note: If you are using Bitcoin Core 0.14, consider importing multiple addresses with importmulti


Running pybitcointools & python-bitcoinlib concurrently

Not sure if you can do it as they seem to be the same package.
For python-bitcoinlib here:

Author: Vitalik Buterin
Home Page: http://github.com/vbuterin/pybitcointools
Package Index Owner: vbuterin
DOAP record: bitcoin-1.1.26.xml

For pybitcointools here:

Author: Vitalik Buterin
Home Page: http://github.com/vbuterin/pybitcointools
Package Index Owner: vbuterin
DOAP record: pybitcointools-1.1.15.xml

They point to the same package on github (just different versions) and running them at the same time is probably not a good idea. My guess is that Vitalik changed the python package name from pybitcointools to bitcoin when he realized the second was available.
That said, if you really need to use both packages, you can do something like this answer. Note you'll have to install manually, probably installing from source using github.


cgminer settings "--load-balance" vs "--balance"?

From: https://github.com/ckolivas/cgminer/blob/master/cgminer.c

/* In balanced mode, the amount of diff1 solutions per pool is monitored as a
 * rolling average per 10 minutes and if pools start getting more, it biases
 * away from them to distribute work evenly. The share count is reset to the
 * rolling average every 10 minutes to not send all work to one pool after it
 * has been disabled/out for an extended period. */

So --balance looks to the diff1 count and tries to get an even distribution.

--load-balance looks at the --quota values and distributes work in proportion to the GCD of them, counting down until remaining quotas are all 0 and the values are reset.


That doesn't make any sense to me. There is no receiver info in Bitcoin.

Was this requested additionally to providing a recipient address? Otherwise perhaps they meant that you should use the order number as the recipient address? Perhaps the seller is just using the same email template as for wire transfer payments. – In Bitcoin sellers usually use unique addresses for each sale, so they can identify the payment through the address that they receive the money on.


How is it possible that webservers with deterministic wallets can produce public keys without knowing the underlying private key?

What i understand of this bip is that it uses a deterministic wallet (or a wallet that only needs the seed key to regenerate key pairs). An example of a deterministic wallet is electrum and also brain waller. These two services i know electrum more than brain wallet. Basically, what electrum does is gives you a 128bit root key in the form of a series of words.From this root key any public key can be hashed out. Part of the ease of refreshing these "old/lost" public keys is because you can not generate more public keys than have already been determined (deterministic) by the length of your seed.
How it works is described by Gmaxwell on bitcoin talk

https://bitcointalk.org/index.php?topic=19137.0
Introduction on what has been discussed on IRC

  I've discussed this enough on IRC that I thought I ought to put it someplace more lasting.

  Bitcoin really ought to offer and default to using deterministic wallets.   The additional security of the current pre-generated ones is fairly small considering how most people use bitcoin and the liability of harm due to insufficient backups and increased pressure to keep a single wallet online is enormous.

  What is a deterministic wallet?  It's a wallet which you can backup once and it stays backed up forever because all future addresses are determined in advance. It can also be stripped down to a very small size which could be easily backed up on paper (e.g. with a QR code). This is in contrast to the current non-determinstic wallets where the keys are random but are precomputed ahead so that you're safe only if you backup at least every 100 get addresses or sends, and which grow large and harder to backup on paper over time.

  I've found the backup behavior of the current wallets fairly difficulty to get even moderately technical people to understand. The current system provides enough safety to encourage complacency but not enough to make complacency acceptable.  The positive side of a non-determistic wallet is that it becomes "unstolen" over time but people are frequently reusing addresses and attackers will not act slowly regardless.

So the tl;dr, its hard to back up a current wallet.dat file  because there are way too many private root keys made (as infinite as can be). So the author proposed that a deterministic wallet can only make a certain number of keys because there is one set private key or seed. This deterministic wallet is possible because keys are all hashed the same way (they all use the same root, or base. Or same parent)

  There are two types of deterministic wallet I'd like to discuss. I'll call them type-1 and type-2.

  Type-1 is the most obvious kind:

  The wallet stores a large random seed  S (which can be encrypted if the user uses wallet encryption)

  Privatekey(type,n) is then simply set to H(n|S|type)  where H is an acceptable secure hash function and type can be set to different values for change addresses vs displayed addresses (so this distinction is preserved even if new wallet metadata is lost).

  The system would generate some (maybe 1000 of each type) addresses ahead of the furthest it has observed on the network but only bother to store the addresses. The keys can be regenerated as needed.

Tl;dr there are two known way discussed by gmaxwell to make sure you can keep a finite, and easily detected address.
Type 1 is where your long seed ( example: dhrhdjidgMdudyemrbyrkandurkur). it is the only base used to hash out keys. since (afaik)bitcoin naturally was built to only use each set of seed keys a few times for change wallets only, those extra associated and generated keys/seeds are only kept locally within the wallet.dat file that is on that local bitcoin instance. Dynamically the original client will assign an incoming address or if its a change address and soon start over again with a new seed.

Type 1 uses a long set of numbers/letters Which are all generated from that seed (dhrhdjidgMdudyemrbyrkandurkur). This seed will always be hashed with the same function (lets for ease say sha). This hash function can only generate a finite amount of keys (i believe this is because your seed key is not infinity characters long, the potential number addresses are limited to the key length of the seed ).
So for as long as both dynamic wallet clients are coded to  hash/check the key the same way, they will always find the addresses through process elimination. Which is not too hard. it will hash to find if any coins are available at those addresses. If the address was never used, that address is ignored and left to use later.
 (its like entering a vault with a key code and stored right on the floor is every last bitcoin you own. Those bitcoins are assorted in to plain old boxes. Since it is your vault, its tiny, and private you have only these number of boxes on the floor, they were premade boxes.
Where as you neighbors keeps creating a new vault for a new set of boxes. It sounds a little silly for them to create so many vaults with different entrance codes, and so many boxes that are never used. But thats how bitcoin works. It makes a vault and in that vault are boxes empty and ready to be filled with coins or anything left over.
It makes it harder though for a thief to break in because he needs to open every last and sort through these boxes.
 But anyway you take The seed (your valts keycode) and decrypt it(enter the vault password). That key It always tells you what boxes of bitcoin are in the vault (so say that  your vault password is JOESVAULT) well you know that there are only so many boxes that can fit inside that vault, and you know the name of each box (address) in there too. So, you can look in those boxes without having to guess which vault it is in. Since you only have one vault, you can eventually guess the names of the boxes in there. And thats because each box name(address) is derived from the vault key(seed)

  Type-2 is a bit less obvious and understanding it requires you to know about a property of ECC keys, roughly:

  A_public_key = A_private_key*point

  Which means you can do:

  B_public_key = A_public_key+B_secret*point
  and have a new key which has a private key:
  B_private_key = A_private_key+B_secret

  So a type2 wallet stores:
  Master_private_key
  A large Random_seed S.

  and keys are given by

  Privatekey(type,n) = Master_private_key + H(n|S|type)

  which works just like a type-1, the advantage of the type-2 is that you can separately secure the Master_private_key, but still generate new addresses with
  Publickey(type,n) = Master_public_key + H(n|S|type)*point

  This means that a e-commerce site could have the front end webserver with access to the public key and S, and someone who hacked the server could violate the confidentiality of the addresses in use (because he could enumerate all past and future addresses based on an infrequently changed public key) but couldn't actually steal any of they money sent to the addresses because he would have no access to the private keys.

  This could also be used to allow getaddress to work in the client without having to provide a key (access to the TXN data in the wallet means that access to the wallet, even with private key encryption, screws your confidentiality)  which would avoid the problem of backups being endangered due to address depletion from hitting getaddress a lot between entering in the key.

Type two:
So this is like running a bank,you have one vault that is enormous. In side of this bank vault are lock boxes. Since the banker knows the  bitcoins needs to go in to the vault(in his big master key wallet which is finite as well), he now knows there are only so many lock boxes inside. But, because you as the receiving hot wallet holder only have the key to the individual lock box("public" key) you wouldn't be able to get it out (that sucks you're stuck there to rot and get arrested).
 The vault keycode (the master key) is needed to get out of the vault with money and only the head banker knows what that code it is. However because you know that the lock box goes in to that bank, you use that lock box(once again the lock box is the server receiving the coins). your banker assigns you that lockbox and you use that lock box for all your addresses and funds. and put all your coins in to little  pockets(each address you own is a pocket inside this lock box) every thing is safe sound and secure.
These bank lock boxes are kinda magical though, as i said you can walk in to the vault at any time, you can walk through this vaults walls to put the lock box in the vault. But if someone else steals your lock box key (woopse, i forgot the key in my purse and now my purse was stolen!) they can get your lock box(your receiving server private key) and can sort around in to your lock box, but they don't have the key code to exit the vault with the lock box. So even though a "private" key exists on the remote hot wallet (lock box key you left in your purse) the banker wont give your attacker entry in to the vault because he does not recognize the attacker as the person who the lock box belongs to. So, unless the attacker gets the bankers vault password, they cant get your keycode... BUT remember the bankers keycode works on your lock box. As well as anyone else's. so if the bankers keycode (master key/master seed) is discovered its game over.

So basically you are putting your lock box in a valult. The vault and the lock box each only have finite space. But they both have different keys. As long as your bankers master key is not stolen. no one can really get your money (almost like a two step auth). But rhe banker always knows the keys to his lock boxes even if you forget.

Its kinda inceptionish/matrixy "box in a box", two finger print min, two keys to launch a nuke.... That kinda thing. But not...

Anyway, that is how i understand it. Please let me know if I'm right, wrong, not understandable or what not. I would rather edit an answer than make another

Thanks for your support and kindness. Thanks in advance for the respect of not flaming me


Question about identical txids/merkle tree in Developer guide

It refers to a (practically impossible) edge case due to how unbalanced merkle trees work.

Let's say you manage to find two transactions with the same transaction ID, T1 and T2.

Now, let's build the merkle tree for a very simple block:

                 H(A, B)
                /       \
       A = H(CB,X)       B = H(T1,T2)
        /        \        /         \
       CB        X       T1         T2

Now, if you were to build the same merkle tree without T2, you have an unbalanced tree with only 3 leaves. To fix this, the last leaf is duplicated, as such:

                 H(A, B)
                /       \
       A = H(CB,X)       B = H(T1,T1)
        /        \        /         \
       CB        X       T1         T1

However, since T1 and T2 share a transaction hash, your merkle root actually ends up being identical to the tree with two separate transactions.

Since the merkle root is the same, the proof of work for a block containing T1 and T2 would also be valid for a block containing only T1.

Thus, if the first block is considered invalid by an honest node, when it sees a second block arrive with the same block header, it may dismiss it as invalid automatically based on the cached status on the original block's header, even though the second block does not contain T2, and is in effect a different, potentially valid, block.


What is the most advanced technology for anonymous transactions?

CoinShuffle has improved upon CoinJoin, but active mixing it not advanced compared to the solutions below.

ZeroCash and CryptoNote have advanced significantly since you asked this question. CryptoNote has been advanced by Monero research lab and has plans to add Confidential Transactions (RingCT). ZeroCash has made advancements in decreasing the size of transactions and the design of the "trusted setup" process described below.

https://lab.getmonero.org/pubs/MRL-0005.pdf

https://www.reddit.com/r/Monero/comments/41vg68/monero_vs_zcash_eli5_fundamental_differences/

https://z.cash/blog/snark-parameters.html

https://blog.okturtles.com/2016/03/the-zcash-catch/

Monero is also teaming up with I2P developers right now on Kovri, an I2P C++ router that will help protect metadata including IP addresses:
https://github.com/monero-project/kovri


same R value is used for two different addresses? finding z1 and z2 value and privatekey

Calculating the private key from a signature (r and s) requires that you know the message (to calculate the "z" value) and the "k" value (which is used by the signer to derive the r value via a trapdoor function).

Calculating the "k" value (needed above) requires two signatures (you need two s values) which sign two different messages (you need two z values) using the same private key and the same r (therefore the same k) value.

In your question, you reference two transactions signed by different private keys (which you know by noticing their public keys differ), and therefore you do not have enough information to correctly calculate the k value.

In the other similar question you recently asked, the two transactions were signed by the same private key (and they have the same r & k), so in that case it is possible to calculate the private key. (The service you linked to appears to calculate it correctly, however it doesn't display the uncompressed address.)


Authoritative list of Bitcoin resources?

There are four really authoritative places for Bitcoin-related information that I can think of.

The Bitcoin.org homepage, which is managed by the core Bitcoin developers. All names listed on that site and references made can be considered authoritative.
BitcoinTalk.org, this was the homepage for the Bitcoin community from the start. Most of the first ideas were created here and still this is the best place to get information from other authoritative people strongly related to Bitcoin.
The Bitcoin Wiki, were you can find all technical specifications of the protocol as well as more basic information about how to buy, sell or use bitcoins. The wiki is maintained by the developers as well as insiders that helped shaping the protocol.
Bitcoin on GitHub, were development of the main client happens and all changes to the protocol are implemented for the first time. You can also find a link to this place on the Bitcoin homepage.


How can I import my BitGo wallet backup into Electrum?

Disclosure: I'm a software engineer at BitGo.

Most paper wallets store a single private key and this is what you can easily import with most wallets.

However, it seems that you're holding the recovery sheet for a BitGo wallet. BitGo wallets are based on a 2-of-3 multisignature setup: BitGo holds only one key while the user holds their private key and the backup key is either held by the user or a key recovery service. This way, BitGo never is in control of the users' money, but can provide wallet services and effectuate the policies set by the users.

I would be surprised if Electrum had support to import a multisignature setup off the cuff. ;)

If you've lost access to your BitGo account, you can use the account recovery on our website. If you don't remember your email address either, you can use our Wallet Recovery Tool to sweep the wallet content to a destination address of your choice. To move the funds to your Electrum wallet, you could put one of your receive addresses from Electrum as the destination in the recovery tool.


What if some attacker forks blockchain from height 1 with a constant difficulty 1?

The accepted blockchain is the one with the most cumulative difficulty (i.e. the one which requires the most work to produce), not the longest. Nodes will not even accept a chain which has less than some minimum work required, set in the code, to stop such an attack from happening on newly synchronizing nodes who are not aware of the main chain.


How does one reference an unspent transaction output?

Each transaction output is uniquely identified by an outpoint. Outpoints consist of

txid: The unique transaction ID of the transaction that created the output. The txid is the 32-byte sha256d hash of the transaction.
index: The output index (vout) that marks the position of the output in that transaction. The output index starts counting at zero and is a 4-byte unsigned integer.

As an arbitrarily picked example, the outpoint

e06a3193c6ac49b8dd862baf9bd3561ffe86d65b6e8a9e73ebe1dc91e3ca2978:1

refers to the second output of the transaction e06a3193c6ac49b8dd862baf9bd3561ffe86d65b6e8a9e73ebe1dc91e3ca2978 worth 0.001 BTC which was sent to address 1La27vpuDDr9NR1aZ6GpxoJyNYmHT62nRb.


What is the current (Feb 2012) "bus factor" of the standard client?

As of today, perhaps 20

Generally what makes a "core developer" as opposed to a "contributing developer" is an ongoing interest in the codebase that typically equates to near full-time employment. Should all core developers fall under the wheels of this continent-spanning bus of doom then Bitcoin would suffer a significant blow.

For a while.

Then various contributing developers (of which there are legion) would likely step up to act as replacements. The discussions on the forums, IRC channels, mailing lists and version control systems will be read and acted upon. Bugs will be fixed and life will go on.

Edit: So where does this number "20" come from? Well it's based largely on my experiences from reading the development mailing list, IRC logs and various Google+ circles. There is no real exact number, though, activity varies over time and various people are "core" to a particular issue as it passes through.


Where can I turn the unique hash result of SHA256 to bitcoin?

Bitcoin does not reward you for finding just anything that hashes with enough zeroes at the front, it rewards you for finding blocks whose hash is less than the current target (which gives the appearance of requiring a number of leading zeroes).
A block is a data structure that contains Bitcoin transactions as well as a header with some additional information, such as the previous block's hash, a timestamp, nonce, version number, and the hash of all of the transactions in that block. This block header is what must have a hash less than the target. If you submit to the network something that is not a validly formatted block header, then, regardless of the hash, it will be rejected. Note that you don't just submit a hash, you submit the data that is hashed, along with the hash, so that nodes can independently verify the hash.
Lastly, miners are not rewarded by "blockchain watchers" nor are their identities known or approved. Miners are rewarded because they include a transaction in their blocks that pays themselves. This transaction must meet the rules for payouts, but the payment is up to the miners to claim by them making the transaction and including it in the block that they found. This transaction could pay to whomever the miner wants to, and it can pay to multiple people as well. It can also pay to nobody and instead burn the coins. The payment does not come from somebody else who verifies the miners' identities.


How to get both confirmed and unconfirmed transaction details of foreign(non-wallet) addresses from bitcoin-node server?

If I understand correctly you can use this command getrawtransaction to get a transaction that is in your node's mempool i.e. an unconfirmed transaction.

However, if you are looking for a transaction that has been confirmed, you'll need to know the blockhash of the block in which that transaction resides.

Example:

> bitcoin-cli getrawtransaction "mytxid" false "myblockhash"

Or if you have enabled -txindex option on your client then you can use getrawtransaction and you don't need to supply the blockhash. Check out this question for details on this option.

Refer to this site for a more detailed explanation of the getrawtransaction command.


Simple. Export your private key from electrum and import it in breadwallet.


Shower thought: would continually broadcasting 1mb blocks help with scaling?

That's essentially what Bitcoin NG does.

There are some differences between your suggestion and theirs though.

The first block is a "key" block. It contains no transactions, but does contain a key to sign the next blocks, and a description of how to split the block reward.
The blocks afterwards are "microblocks." These include transactions.
The next key block commits to a specific set of microblocks. This is to prevent the miner from signing a new set of microblocks that include different transactions.


Best way to store fund on the lightning network

The best strategy really depends on the user. You distinguish tradeoffs in all these solutions:

Open a new channel each time

This one does not make sense.

Open 10 channel for 0.01 BTC

More exposure to DOS (and onchain fees), but less exposure to censorship.
Probably the solution which makes the most of sense (or 5 channels for 2mBTC) since MPP.

Open 1 channel for 0.1 BTC

Less exposure to DOS (and onchain fees), but more exposure to censorship (you better chose well your single peer!).

Some custodial services

No exposure to DOS (and any other technical cost), but complete exposure to censorship.


Blocks seem to store only txIDs, where does the transaction data come from for IBD?

Blocks do not contain transcation ids at all, they contain the full transactions themselves. If you are using the getblock rpc and seeing txids, that's just because showing the details of all of the transactions is extremely verbose, so only the txids are output. You can see the full transaction details of a block by setting the second argument to 2.


Do all Banks and Credit Unions in the U.S. accept Bitcoin?

Certainly all banks and credit unions do not accept bitcoin, and I'm not aware of any that do.

Banks and credit unions can be thought of as nodes in their own network that is not actually so dissimilar to Bitcoin.  The function of this network is to create, store, and transfer money.  Most fiat currency is not created by the central bank, but is lent into existence by the process of fractional reserve banking.  In other words, a bank is inherently part of the currency it operates with.  It plays a role in the money creation process.

With this view, your question is similar to asking "can the Litecoin network transfer bitcoin?", or "can an Ethereum miner create a Bitcoin block?".  These are separate networks, operating with different sets of rules.  The same is true of Bitcoin and the traditional financial network.

That said, many traditional financial institutions operate small-scale foreign currency exchanges for the convenience of their customers.  You can often go up to a bank teller in the US and exchange a small amount of euros (leftover from a trip abroad) for dollars, usually only if you are a customer or memeber.  I do not know of any traditional bank or credit union that has added bitcoin to the list of currencies it exchanges, but I doubt there are many...if any at all.


How to report the tax if I trade BTC to LTC?

The IRS treats digital currencies as capital assets and are therefore subject to capital gains taxes. Any disposition of these digital currencies, including trading and spending, is a tax event and capital gains must be calculated in USD.

References:
https://en.bitcoin.it/wiki/Tax_compliance


So every private key actually has TWO associated addresses? (ie uncompressed and compressed)

Nope. It's not. If you really think it's a flaw, explain some way you think it can do harm.


How to decode raw transaction which has 00 in '#TxIn' slot?

This is a SegWit transaction, serialized using the new format defined in BIP144.

The format is only permitted when at least one of the transaction inputs has a witness, and works as follows:

4-byte integer nVersion
1-byte dummy (must be 0)
1-byte flags (must be nonzero)
vector(transaction inputs)
vector(transaction outputs)
if (flags & 1): vector(input witnesses) (excluding the length, which is implied by the number of transaction inputs)
4-byte integer nLockTime

The dummy byte is required to be 0, guaranteeing that the transaction cannot be misinterpreted by old software (as by consensus rules, a transaction with 0 inputs is invalid).


Just to discourage you further:

You'll have a very difficult time finding a mining client that will run GPUs at this point. You'll most likely have to compile it yourself.
Even with the best possible graphics card, it'll take you around 10,000 YEARS to find a POW-hash given the current difficulty.
You'll be making about 0.36 cents per day at the current bitcoin price with this amazing rig. Your card gets about 1/100th of that, so it'd be 0.004 cents a day, or a whole year to earn about 1.5 cents.

The wear on tear on your machine is insanely expensive compared to that.

If you're interested in making bitcoins with your machine, I would suggest you create an API service of some kind using 21.co's API.


Order books, matching exact price or closest price?

I haven't really looked at BTCE, yet, but for example on Bitcoin.de also, orders and offers have to match exactly. However, Bitcoin.de is not a real exchange, but more of an auctioning platform/escrow service: Money flows directly through wire transfer from buyer to seller, bitcoins are held by the platform and released as soon as the money transfer was confirmed by the seller.

On Exchanges though, the platform holds both money deposits and bitcoin deposits of the users. The situation there is slightly different: Let me illustrate with a real-life example:

Okay, imagine you want to buy a beard trimmer, because your old one broke. Before you leave the house you decide that you can afford to pay up to 40 € for one. When you get to the electronics store you find the beard trimmer you want for 35 €.

I'll go out on a limb here, but I imagine that you would not go to other stores trying to find it for 40 € because you decided that you wanted to pay that at most.

On the other hand, let's say when you get to the store, the beard trimmer's price is 45 €. There is three options then: Either wait until the price drops to 40 €, look at other stores, or pay more.

Exchanges work the same way:

When your order is higher than the current lowest offer, lucky you, you saved money compared to what you were ready to pay. Yet, when your order is lower than the current lowest offer. You'll have to wait for it to be fulfilled or take your business somewhere else.


Does node order have meaning in a JSON describing the Lightning network graph?

The nodes are listed in lexicographical order after compressed DER encoding. It is not possible to tell from the public information about a channel who requested to open it.

The ordering is required so that signature verification of a channel_announcement message always passes. If intermediate nodes were able to rearrange the order of information within the message, it would fail verification even though the information is correct.

Additionally, the numerical ordering is used for channel_update messages, as a single bit is used to denote whether the update applies to node1 or node2.


US Taxable Events for using Bitcoin for purchases

HR 3708, which was introduced in the House of Representatives in September 2017, would do exactly that, with a threshold of $600 (to be adjusted for inflation).  It has five cosponsors.

It was referred to the Committee on Ways and Means, and there is no record of further action, so apparently the Committee decided not to move forward with it.


What RBF policy will be default on SegWit v1 nodes?

As far as I'm aware, there are currently no formal proposals to introduce Full RBF. Therefore, I'm expecting that the default behavior of upcoming nodes will remain to forward and create transactions according to the rules specified in BIP125, Opt-in RBF.


Is there anyway I can recover my passphrase?

It's rather implausible unless you remember a good deal of the password already, or you are certain that it followed a particular pattern. Even on a good processor you might only be able to try 10 variations a second, which is uselessly slow for anything in the password cracking world.

It needs to be strong, the encryption is designed keep your coins safe.

How much is at stake? Recovering them might not even be worth the time expenditure.


What are the qualities of a country that might make it more or less likely to freely allow Bitcoins or crypto-currencies?

I believe the Swedish government would be less likely to crack down on Bitcoins. I believe they have a political party called the "Pirate Party", which as far as I know, got elected as a reaction to the crackdown on Pirate Bay. I would love for someone to comment, in order to confirm this.


I'm in the uk, I wish to purchase bitcoins, but the process seems to be very convoluted. There has to be an easy way?

Provided there is someone near you who advertises on LocalBitcoins, it's probably the most effortless solution available at the moment.


Not regulated by a government does not mean that there are no tax regulations concerning cryptos. There are countries where the law requires that you pay taxes for capital gains even when you only trade one crypto into another crypto (without fiat involved) supposed the time difference between buying and selling the crypto is less than one year.


What can an attacker with 51% of hash power do?

Actually, it's very easy to do damage to the network once you have 51%; just build your own chain faster than the network, and broadcast it whenever you like. If you send some of your coins to a new address in your own chain, all the transactions issued in the live network by spending those same coins will be reversed at the moment the longer chain is broadcast.

Right from the bitcoin wiki (probably proof-read by many pairs of eyes) :

  An attacker that controls more than 50% of the network's computing
  power can, for the time that he is in control, exclude and modify the
  ordering of transactions. This allows him to:

  Reverse transactions that he sends while he's in control
  Prevent some or all transactions from gaining any confirmations
  Prevent some or all other generators from getting any generations

  The attacker can't:

  Reverse other people's transactions
  Prevent transactions from being sent at all (they'll show as 0/unconfirmed)
  Change the number of coins generated per block
  Create coins out of thin air
  Send coins that never belonged to him

  It's much more difficult to change historical blocks, and it becomes
  exponentially more difficult the further back you go. As above,
  changing historical blocks only allows you to exclude and change the
  ordering of transactions. It's impossible to change blocks created
  before the last checkpoint.

  Since this attack doesn't permit all that much power over the network,
  it is expected that no one will attempt it. A profit-seeking person
  will always gain more by just following the rules, and even someone
  trying to destroy the system will probably find other attacks more
  attractive. However, if this attack is successfully executed, it will
  be difficult or impossible to "untangle" the mess created — any
  changes the attacker makes might become permanent.


How will the Bitcoin network look after BFL ASIC hardware shipments?

The number of bitcoins issued each day is targeted to at 7,200 BTC per day.  Beginning with block 210,000 that number will drop to 3,600 BTC per day.

The distribution as to which miners will be getting the newly issued coins will change once ASICs are out, but the actual quantities issued will not.  (Well, there could be a few thousand extra coins for a few days but then it will readjust back to the target).

Therefore, there will be very little impact on the "Bitcoin economy" due to the introduction of massively greater hashing capacity that will come from ASIC designs entering Bitcoin mining production.

As far as the block reward subsidy drop from 50 BTC per block to 25, that is already known -- the date might vary a week or so earlier than the current target (November 30th, 2012), but generally it is known when and to what degree (50 to 25) it will happen so it is likely already priced in for the most part.

Thus again, the "Bitcoin economy" probably won't be impacted by speculators or miners rushing to buy.


BTC - Mining Vulnerability and Future Consesus

In order for changes to the Bitcoin protocol to be made, 95% consensus must be achieved, otherwise a hard fork would need to occur? Is this the primary reason why changes to the core protocol are so difficult to make?

No. Changes are made regularly and you can subscribe to https://bitcoinops.org/en/newsletters/ for updates. Hard forks are not preferred to avoid chain split and other issues but can be used if it's really necessary. Some soft forks are contentious so consensus is a problem which can be solved each time with different solutions. BIP 9 was used for segwit so miners, voting and drama was involved: https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki
Taproot activation and consensus related discussion: https://www.reddit.com/r/Bitcoin/comments/hqzp14/technical_the_path_to_taproot_activation/

I've seen charts online breaking down the mining pool ownership percentage of BTC

I dont see anything wrong with this mining pool distriibution: https://i.ibb.co/pwxjvtc/image.png

However, is it possible that a 51% attack could already be occurring and we have no idea? How do we know the mining operations aren't in collusion already and have not already been double spending, etc? If fraudulent activity occurs would we actually ever know?

As Raghav mentioned there are lot of users keeping an eye on network activity. You should run your own full node and wait for more confirmations to finalize transactions if you think there is a possibility of miners trying to reorder history. Please refer to Greg Maxwell's thoughts on 51% attacks: https://www.reddit.com/r/Bitcoin/comments/ddddfl/question_on_the_vulnerability_of_bitcoin/f2g9e7b/
And also read about game theory involved in 51% attacks or any attacks on Bitcoin network:
Few things and one case mentioned by Jimmy Song - https://medium.com/@jimmysong/reorg-scenarios-binance-hack-edition-849fc7e7df07
Stratum V2: https://braiins.com/news/stratum-v2-bitcoin-decentralization
Jameson Lopp's thoughts about mining and decentralization: https://blog.lopp.net/are-chinese-miners-threat-bitcoin/


Yes. You can recover your private keys from blockchain.info and send BCC coins from them.


How do exchanges provide wallets unique wallets to users but also keep transaction fees low?

Users don't have addresses at exchanges. When you deposit to the exchange you're depositing to the exchanges wallet, with a unique address just enabling them to account for who to credit the internal balance to. Withdraws only require one on chain transaction, just debiting the amount from the database and then sending that value to the address requested.


Your client is currently unaware of the transaction on the bitcoin network because it is not synced with the bitcoin network.  Wait for the green progress bar at the bottom of the client to complete.  Once your client is aware of the transaction it will show your appropriate balance.


How to get the general population to pay more in transaction fees?

I don't think that it is definitely a good idea to increase the transaction fee.  One of bitcoins biggest selling points is the ability for micro-payments and very low transaction fees.  While I do agree with others that micro-transactions will eventually move off the blockchain.  For now even with the block-reward halving, transactions fees still won't benefit miners financially much for a very long time.  As again as I said the ability to make bitcoin transactions much cheaper than traditional means is one of bitcoins main selling points and will be for a long time.  Until such a date that the majority of bitcoin transactions are made off the blockchain.  Instead in house by larger bitcoin payment and services provider outlets.


In Peercoin style Proof of Stake, can one person 'stake' for another's address?

Look at lines 401 and 402 of the code you linked to. The block must be signed with the key that can spend the UTXOs.


Who is for SegWit and who is against? And what is the consensus?

SegWit is a large protocol update developed by Bitcoin Core to address some protocol defects, increase the capacity, and lay the groundwork for further protocol improvements in the future. As such, it has broad support among the Bitcoin Core contributors. It also has broad support among node operators with 85%+ being segwit ready, and decent support among Bitcoin businesses. The softfork was ready for activation since November but had been lacking signalling by miners.
This impasse was broken by a combination of the New York Agreement (NYA) that spawned the segwit2x project and the pressure exerted by BIP148 (the UASF).

There is a vocal minority that proposes scale on-chain primarily. Some of them are opposed to segwit altogether, some want it in a different form as for example a hardfork, some of them just prefer bigger blocks but want segwit later as well. The NYA seems to have been found especially to satisfy their wish for a hardfork to a bigger blocksize, where some parts of the community aren't too keen on the 2x part of that. A small group of them has now decided to preempt the decision by creating Bitcoin Cash today which removed segwit and changed the blocksize to 8MB.


What are the risks of exchanging Bitcoins via Near Field Communication?

The risks could be, someone else with a good NFC communicator could intercept your request and make you send some BTC to them, having another persons phone next to yours with the app can do the same, and possibly NFC jammers can really cause a lot of problems with the transfer.


What you are asking is: can I create valid blocks (with only a coinbase transaction to and address of my choice) with a previous block hash that I chose at random that will be made valid if another block occurs with that hash.

Sure you can. Note that there are 2^256 hashes. The chance of finding one at random that will equal the hash of a to-be-discovered block are very very small. You would most probably just be wasting computing power/electricity/time.

Also: Note that you could spend the same amount of computing power at guessing the private keys of other users. Finding hits there would have the possibility of getting more than the block reward.


the Blockchain says that the transaction is "Spent" What does this mean?

It means that the outputs of the transaction have been used as inputs in a further transaction.

Which, in simpler terms, means that the recipient has subsequently spent the received money.

If you were the recipient, have a conventional (non-custodial) wallet and didn't knowingly spend the money it probably means you have lost control of your wallet as a result of hacking or social engineering or some other hostile act by a third party. For example where an online "friend" helped set up your wallet or where you clicked an "update" notice in an old Electrum wallet.


Why is it harder to generate addresses starting with 1s?

An address has 1 + 20 + 4 bytes, which has a total of 200 bits. Each of the Base58 characters contain log_2 58 bits of information, which is approximately 5.858. If one created an address that has the public key hash 0000...00, the result would be a 5-6 character address, due to the checksum. To prevent this, Satoshi decided to add "1"s for each 0x00 byte in front of the address. Those "1"s each contain 8 bits of information instead of 5.85... As they carry more information, it's harder to find an address starting with those 1s.


How can I search for transaction text on the blockchain?

There is funny site http://bitcoinstrings.com/ I am not sure that it is what are you looking for but just in case...


If i have 42 tera hashes of mining power, how long will it take me to mine a block solo, and if i join a mining pool, how much bitcoin will I get?

At the time of writing, less power costs, and assuming no change in difficulty:

it would take on average 50 years, 21 weeks to generate a block.
it would produce on average 0.000678 BTC per day, or about $6.70.


Underclock GPU Memory below "Recommended" Limits on Linux

aticonfig respects the settings set in your video card's firmware by your card's manufacturer (frequently, although incorrectly, called a BIOS). However, AMDOverdriveCtrl can clock memory down much farther, depending on the card.

Radeon 5xxx, 67xx, and 68xx series cards should be clocked down to 1/3rd of the core speed (ie, 750mhz should have a memory speed of 250), 69xx cannot clock down far enough to be worth it, and GCN (79xx, 78xx, 77xx) seem to have a limit of 150 mhz less than core (however, although it is not worth underclocking on 69xx, it is worth underclocking on GCN due to automatic memory voltage control done by the hardware/driver; on my 7950 @ 1125mhz, going from 1375 down to 975 dropped my GPU temps 3-4 degrees celsius).

5xxx and 6xxx series cards also have a problem where they will instantly lock up if memory speed is set between around 400mhz to around 600mhz (depending on core speed), so your mileage may vary as always.


What has a lower long term cost per hash: LTC, BTC or other alt coin?

One of scrypt design goals was to make CPU and GPU performance balanced, which meant that it was far more dependent on memory speed.

The GPU had a solid work around and as far as I know CPUs don't have any advantage.

But that did cause it basically impossible to do scrypt mining with an ASIC unless it has a ton of memory and memory channels added in, which is a huge design problem.  Unlikely unless GPU mining for scrypt is very profitable.

This also makes Scrypt far more energy intensive for the same amount of useful hashing, but the network adapts as it requires far less hashes to solve problems (Difficulty number)

Which is greener? By far ASIC mining, it's power usage is tiny compared to performance, 4500MH for 4.5w vs 275MH for 100w.

But again, the network balances.


Low fee Electrum wallet transaction disappeared, now when I increase the fee it seems to be rejected as a double spend

I faced a similar issue and found this reddit post quite helpful. I'm not a bitcoin expert but I will write an answer describing what I think is happening, since there are no other answers yet.

When you sent the first low-fee tx, it got propagated fine to the network but remained unconfirmed. When you opened the Electrum wallet a few hours later, this unconfirmed tx disappeared because your electrum wallet connected to a node which removed your tx from the mempool for being below its minimum relay fee.

So you created a second transaction, but while most nodes (including block explorers, miners) saw your transaction, they immediately ejected it out of the mempool for being an attempted double spend.

Only your first tx has any chance of going through. But if it has very low fees it might not be mined and be removed from all mempools after some time (3+ days?). So, you have to wait for the first transaction to be removed from all mempools and then create a new transaction with higher fees.

Any confirmation or correction for the above from an expert would be appreciated..

Here is what electrum documentation proposes for cases of unconfirmed transactions:
If you have made a transaction that is unconfirmed, you can:

Wait for a long time. Eventually, your transaction will either be
confirmed or cancelled. This might take several days.
Increase the    transaction fee. This is only possible for
‘replaceable’    transactions. To create this type of transaction,
you must have    enabled ‘Replace by Fee’ in your preferences, before
sending the    transaction.
Create a ‘Child Pays For Parent’ transaction. A CPFP is    a new
transaction, that pays a high fee in order to compensate for    the
small fee of its parent transaction. It can be done by the
recipient of the funds, or by the sender, if the transaction has a
change output. (Here is a step by step guide for this option: link)


The limitations on Ripple scalability are substantially the same as the limits of Bitcoin scalability. There are various minor differences, but they don't significantly change the picture.

Ripple already has some scalability features that Bitcoin doesn't have yet, but Bitcoin can easily add them when it needs them. For example:

Ripple nodes don't need to keep history to process transactions.
Ripple nodes can form "clusters" under common administration that divide the cryptographic work.
Ripple nodes can escalate the transaction fees they demand to forward transactions in response to load bursts.

One difference is that Ripple's confirmation time can increase with load. In a sense, Bitcoin's confirmation time can increase with load too as you may need to wait longer to get a transaction in a block. But Ripple's consensus process can take longer if more nodes are participating in it or if a higher transaction level creates more disagreements that must be resolved in the consensus process.

Right now, consensus consistently takes about 2 seconds (which is the minimum). In simulations, the consensus process increases with the log of the number of trusted validators. 100 validators brings it to about 3 seconds. 1,000 validators increases it to about 4 seconds. 10,000 increases it to about 5 seconds.

Consensus time also increases, though by much less, with the transaction rate. Note that consensus time is just one factor in the time it takes to confirm a transaction, though as the network grows it will likely be the dominant factor.


Is Ripple's UNL list maintained by the network?

Currently, Ripple Labs runs five validators and most Ripple servers have only these five validators on their UNL. A transition is in the works to distributed community management of UNLs, and that transition is expected to be completed during the first half of 2014.

In the final scheme, publishers will be able to publish lists of validators (by public key). They will ensure validators accurately report their identity, jurisdiction, type of organization, and so on. Publishers will monitor the validators they publish to ensure they are operating reliably. Since validators must sign every proposal and validation, most types of misconduct will be easily provable.

The Ripple server software will come with a default list of publishers, though you can add or remove them as you see fit. You can also manually add validators or remove validators. You will be able to tune the policy based on the parameters the publishers vouch for. For example, if you don't want any validators operated by governments, you can opt to do that. If you don't want any validators in Australia, you can opt to do that.

Your server will periodically poll the publishers and statistically combine their lists to come up with a set of validators to use.


Why do some addresses seem to send bitcoin to themselves?

This type of transaction is very popular amongst exchanges with hotwallet scheme. They use hotwallet (in this case the 1A7... address looks like it) to send withdrawals to clients, the change is going back to the hotwallet.
Most bitcoin wallets don't allow for this behavior, creating a fresh change address every transaction.


Both options are possible. I don't know how most scamcoins do it but I believe it's more common to actually mine coins before the chain is released to the public.


How to convert an Electrum 12 word seed to a private key?

Haven't seen a tool, that can do so.
Electrum has a BIP39 based system, with some custom extension. Look for BIP39 and Electrum, this appeared already in bitcoin stackexchange. From (somewhere) there I also got the compatibility list:

  https://onedrive.live.com/view.aspx?resid=584F122BA17116EE!313&app=Excel

Internally in Electrum wallet, you can export via menu "Wallet" -> "PrivKeys" -> "Export".


Does it means that both of users wallets will have information about this transaction?

Both miners will see their own coinbase outputs in their wallet software, yes. However, the two coinbase transactions will be separate.

  If yes what will happen when both users will quickly go to bitcoin's ATM and take fiat currency from this reward?

They cannot do this. Coinbase outputs are immature, and unspendable, for 100 blocks. After 100 blocks, a fork should ideally be resolved already. If it is not resolved, then only the miner on the same side of the fork as the ATM operator will be able to access his coins, as the ATM will not be aware of the coins on the other side of the fork.


address that has never been online, will transactions in blockchain still balance?

There is no "being online" concept of an address in bitcoin.

An analogy would be to think of bitcoin addresses as if they were an email addresses. You can send to that address whenever you want and only the person with the secret key will have access to the contents of it. It doesn't matter if they are 'online' or not.

So to answer your question, when you first generate an address only you will know about it (unless of course you share it somehow).
As soon as you or someone else sends bitcoins to that address it will be present in the blockchain as part of a transaction


The initial mining revenue was those who created the system and early adopters experimenting.

You have to remember at this time they were worth very little. many of those coins may have been deleted, sold or spent at a much lower value.

The risk to reward ratio was much larger, many thought they would not be worth anything. Your calling this money because millions of people have now given trust to the system. Back when it started currency from a game like World of Warcraft would have been considered more valuable.

The only reason people with "good computers" got coins is not because they had those computers, it is because less people were actively trying to accumulate bitcoin, making it easier for any computer to do so.


Block Confirmation Speed - Bitcoin vs Litecoin vs Potcoin

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.


What is the minimum hash rate power should I have to get rewarded in btc.com?

There is no definable minimum, because the expected reward for having x amount of hashpower is constantly changing. As other miners add or remove hashpower from the network, the effective 'minimum' would be expected to change. The answer to your question will also depend on the fees and policies of btc.com, so it does not fit the scope of questions for this site very well.

See also: How much Bitcoin will I mine right now with hardware X?


How to make transaction with many inputs and one output in BitcoinJ?

SendRequest sendRequest = SendRequest.emptyWallet(receiver);
Transaction tx = walletAppKit().wallet().sendCoinsOffline(sendRequest);
System.out.println(Hex.toHexString(tx.bitcoinSerialize()));

In your original code, you loop through each UTXO in your wallet and add it as a signed input, essentially emptying the wallet to the output specified.
The code above does the same but using a different method.
You should also be calling completeTx() before commitTx(), but sendCoinsOffline() takes care of that for you.
The raw transaction hex is then printed out in my code, which you can then send to a node to broadcast. If you want bitcoinj's WalletAppKit to do that for you as well, look into Wallet.sendCoins().
The transaction generated with your code would be invalid either way, as you aren't subtracting enough (or anything, in your case) for transaction fees.


Where to find rpcauth.py for configuring rpcauth in bitcoin.conf on Ubuntu

The python file is not provided if you installed bitcoind through PPA.

You can download it yourself

wget https://raw.githubusercontent.com/bitcoin/bitcoin/master/share/rpcauth/rpcauth.py

And run the program as follows

python3 rpcauth.py myusername mysecretpassword


the BLK files are not an API. You shouldn't directly read those files.
What you should do is requesting the headers/block via the JSON RPC interface (or the REST interface).

You can get the genesis block hash via:

bitcoin-cli getblockhash 0

Then you can get a block (without transactions):

bitcoin-cli getblock <hash>

Then get the next block by looking at the nextblockhash item in the block JSON response, etc.

Also, consider using the REST interface. There you can get binary responses which are much faster (no JSON encoding/decoding overhead).


No accepted shares on cgminer (sync issue ?)

CGMiner does not need to sync with the blockchain, the pool does. The pool keeps a copy of the blockchain and only sends you the block that is currently being mined. If you don't see any share on BTCGuild's website, you should check that your miner's username and password are correct (they can be different from your main username and password). If you see shares, but they are constantly rejected, then you have a connection problem between you and the pool server. If this is the case, try changing to another pool.


I really don't suggest to use block.io since they will limit your number of your bitcoin addresses.

Any way they don't support custom fee.

As on block.io site

  Estimate network fee will be paid on withdrawal of given amounts


Problem in my bitcoin wallet, not sure why this glitch is happening

The exchange rate between bitcoin and USD fluctuates (and, on average, has been going up a lot). In 2011, the dollar value of a single bitcoin was far less than it is today. I have no idea what the value of a bitcoin was when you bought in 2011, but suppose 1 BTC was worth $0.01. For $6.42 (ignoring fees) you could have bought 642 BTC.

Fast forward to today, where 1 BTC is worth about $2400, then your 642 BTC would be worth $1540800.

When Bitcoin started, it was worthless. Anecdotally, the first bitcoin transaction for a real world item was for two pizzas for 10,000 BTC. Apparently that was worth $41 at the time, so 1 BTC was worth $0.0041. Back then, nobody had any idea how much 1 BTC should be worth.

It seems rather unlikely that a bug has caused you to unknowingly acquire bitcoins without your involvement. Instead, it seems plausible that you bought in very early when the price was quite low, and now have an asset that is worth quite a bit more than what you paid for it.


Its the return rate. So instead of just setting a return rate at lets say 0.019%, you're return rate is the market rate. It updates once an hour. It makes it easier for you so you don't have to log in all the time to adjust you're rate.

Imagine. You set a rate to the current market rate of 0.049%. Then you get a few loans but the market rate drops to 0.019%. You no longer get loans so you have to adjust your rate. FRR adjusts your rate automatically.


Is there a flag to allow creating a transaction with multiple outputs to the same address?

No, and it is unlikely one will ever be added. There is no reason to make multiple outputs to the same address as it is inefficient and wastes money.


Does the Longest Chain Always Win the Mining Award?

what happens if a specific node is aware of a certain set of transactions but doesn't broadcast them to other nodes (the network) and includes them in it's own hash.

Nothing bad happens, but the rest of the network will check to make sure the transactions are indeed valid once they receive the new block. If everything is valid then they accept that block as the new chaintip, and miners will start mining on top of it. In this way, miners can add their own transactions to blocks they find without broadcasting the transactions to the network first.

  Wouldn't this automatically guarantee it will win the mining award?

No, the mining reward is claimable by any miner that finds a valid block. A block can be full of any transactions the miner would like (or none at all), but the exact transactions included will not alter the probability of a miner finding a valid block. If a miner fills a block with their own transactions that haven't been broadcast to the network, they will be at no advantage over a miner that is including only transactions that have been publicly broadcast.


Why is not possibile to convert a signed transaction into psbt?

Given just a signed transaction, it is difficult to extract all of the data in the scriptSig or scriptWitness into PSBT's input fields. This requires having the UTXO and then interpreting and executing the script which is not necessarily available to bitcoind instance doing the conversion.

Additionally, signed network serialized transactions are not necessary fully signed, they could be partially signed in the way that the raw transaction RPCs do it. This makes it even more difficult to extract that information.

Lastly, a PSBT is far more mutable than a network serialized transaction. It can change afterwards which can invalidate signatures.

So instead, we decided to disallow signatures to avoid the possibility of putting incorrect and/or invalid data in a PSBT during the conversion.


Why are blocks and reverse patches not stored in individual files?

No file systems handle large numbers of files well, putting 600,000+ files in a directory would cause absurd performance problems. Opening and closing that many files during sync would have a performance penalty, versus appending to an already open file and writing its position to an index. Even attempting to delete a folder that large would be a struggle.
A reason the block files are as small as they are is due to limitations in windows file systems that have restrictive legacy compatibility.


What security features are built in to the standard Bitcoin software?

Essentially, almost none. But all of the problems aren't really particularly serious or the proposed solutions don't really help anyway.

The latest version of the client doesn't use IRC by default, though it's still supported to help older clients find newer clients. Instead, DNS is used. But these really aren't points of failure because a list of known working legitimate nodes is hard coded into the client. And as soon as you can find one node, it can send you the current list of working nodes anyway.

Wallets aren't encrypted by default, but if they were, we'd be flooded with "I forgot my wallet password" complaints and people would lose their Bitcoins anyway. Also, there are complex technical reasons why password-protecting the wallet won't actually work against the typical threat model (mass distributed malware with specific Bitcoin knowledge).

The client supports a 'backup wallet' command. But the wallet is in BerkeleyDB format. I wish the client had a native wallet format specifically for backups. There is work on fully deterministic wallets, so you can 'backup' your wallet just by knowing a passphrase even with no backup files at all. This is a legitimate issue and one that's being worked on.

The server does default to plain text, but it also defaults to localhost communication only and you must configure a password to run it in server mode. (There's no issue in GUI mode.)

These issues are all being worked on. The client is pretty raw at the moment, definitely.


Will all crypto-currencies exist on the same lightning network?

The Lightning Network can be used across currencies, but each individual payment channel must only correspond to one currency. Furthermore, each currency must use the same inputs and outputs system that Bitcoin uses and a similar scripting system for the HTLCs to work. Other than that, I think the Lightning Network should work across multiple currencies.

  What about exchange rates?

Exchange rates don't matter to anything technically, so they have no effect on LN.


Why is pycoin getting the incorrect output address?

The library is assuming you are using main network Bitcoin, so it prints addresses that start with 1. You need to tell the library you are using that you're in testnet mode.

This seems to be the relevant file: https://github.com/richardkiss/pycoin/blob/master/pycoin/networks.py


do you need to independently create a genesis block for a new altcoin?

In old versions of the Bitcoin Core codebase, the genesis block was verified as a normal block. All normal rules had to apply to it, including proof of work and difficulty. This meant that if you would modify the contents of the genesis block arbitrarily, it almost certainly would not validate anymore.

Since the genesis block is actually part of the definition of the chain, there is no real need to verify it. In more recent versions, the genesis block is just valid by fiat. This means that when using such a codebase, no complicated script that "mines" the genesis block is needed anymore to define a new chain.


Why don't we have a help for Bitcoin Core CLI options in the same way as we do for CLI commands?

This simply is a shortcoming that should be fixed.
David Harding added on IRC:

help <command> is for RPCs; -h is for a quick summary of CLI
parameters.  Extended CLI parameter help should probably be in a
manual page.


Why is it so that if some bitcoin is spent by any user, the rest of his account's amount should also be spent and paid him back?

Because on the lowest level of bitcoin protocol there is no accounts. There are scripts inside transaction. The most common script says: show me public key, I will compute Hash160 of it, compare with given Hash160, and if they are equal, I will check signature.

Let imagine, transaction contains single output with 1 bitcoin. Script contains Hash160 (which we treat as account). There is no way to spent part of bitcoin. We have to spent entire output, which is equal to 1 BTC in our case.
Transactions, like blocks, form some kind of chain.


You can't, even with accounts. Bitcoin is not transferred between addresses when using the move command. It does not magically transfer Bitcoin from one address to another when you use move. The only way to do that is to make a Bitcoin transaction. All that move did was it changed which account an address was associated with. Nothing was actually moved, just a wallet internal database entry was changed.


What will happen if a block is lost on a peer?

It depends on the implementation. For Bitcoin Core, the node maintains a database which has the locations of all blocks on disk. If a block is deleted, then it will notice that the location of a block either does not exist or contains garbage or invalid data. If it does notice that a block is missing (or something is corrupted), it will attempt to rebuild the database using the blocks stored on disk and then download the missing blocks from its peers.

However, blocks can actually be deleted after they have been verified and the local database has updated so that the node knows the block it has just deleted was a valid block. This is called pruning, and with pruning, old, historical blocks can be deleted as they aren't used for anything in normal node operation (except helping new nodes sync).


The structure of the address itself is basically the same as they way they're done in Bitcoin. Not only is the network byte different but the alphabet is different.

However, the client generates accounts very differently from the way it's typically done in Bitcoin. The client begins by generating a random 128-bit seed. This seed is shown to the user and they are asked to write it down to ensure their funds are never lost.

Any number of public/private key pair and accounts can be generated from this seed. And accounts are generated from those public keys.

Of course, Bitcoin clients could generate accounts this same way and I believe that at least some do.


How do I convert a private key in hex to a Segwit private key expected by Electrum?

Import it by specifying address type as prefix:
SCRIPT TYPE:COMPRESSED WIF
In this example it will be p2wpkh:L48nE2detzZwEzdbw5dYTuNJy9wDqLVY92DwS7Br8NwgD6S8NiyT

You will see the address: bc1qzlcz9ckzggu8vzs2rvrsa2j9dh6w3wg4atezy6 added in wallet


Why would you need to "catch up" in the 51% attack?

You're exactly right; there's no need to catch up if you don't start off behind.

As soon as I get 51% of the network's hashing power, I start building my fork in private, then buy something on the 'real' fork and allow the purchase to get as many confirmations as it needs.  It will be a lot, because I'll be buying something really expensive.  I take care not to include my transaction in the private fork.

Then, once the goods are shipped I publish my secret fork and get my coins back.

The Finney attack is only good for double spending when the recipient accepts unconfirmed transactions.


Does the `HTLC fail` routed back to sender using same path if intermediate node does not have enough capacity?

The failure message must go along the same route it came, because any intermediate step does not know where the payment was originally sent from. Every hop only knows the previous and next hops in the sequence, and so the only option it has is to return the information to the previous hop on the route.


Can I use Blockchain records to verify a purchase

The transaction itself would be publicly visible, but you'd have to first prove that the address you sent the coins to is owned by the company, and that you were the one sending them, and also what the payment was for. If you had some proof that the transaction was for the item you bought, then yes, it would be easily verifiable that the transaction was legit. But bitcoin addresses are just random looking numbers and letters, so the company could claim that they didn't own the address you sent the payment to (and so they never received the money) or that the payment was for something else you purchased off them, not the item in question.


can I use same wallet/private keys twice

Yes, both Blockchain and Trezor use BIP 39 standard seeds to generate the keys. Keep in mind that if you eventually stop using blockchain, it will still have access to all private keys used on the Trezor still, so it must remain secured, you can't just forget about it.


How does the bitcoind get current blocks when we start that?

Yes, bitcoin downloads all its blocks off other bitcoin nodes that it connects to, hence the term peer-to-peer (P2P) network. During the initial block download, when a node starts for the first time, it must download all blocks since the beginning of bitcoin (the genesis block), so it must download these from full nodes which store them all, unlike pruned nodes which only store some of the blockchain, not the whole thing.


When your node has an inbound connection via the Tor network, the addr field of the getpeerinfo command shows the local port to which your local socket for the connection is bound. It does not show you any information about the host which requested the connection, nor does it show you information about any Tor relay to which your node happens to be connected. As you rightly point out, the addrlocal field is your onion address (and port).

When the same node has an inbound connection via the ipv4 network (which is possible even for a Tor node provided it is properly configured) then the addr field does show you the ip address (and port) of the requesting host, and there is no addrlocal field.

So what appears to be "inbound connections to yourself" are simply inbound connections (from external hosts, not yourself) via the Tor network as opposed to the ipv4 network.


In my opinion it is scam. Some explanations in link

  https://binarysignalsadvise.com/bitcoin-millionaire-pro-review-scam/


Does it hurt the network to reuse addresses?

Reusing an address is a security issue if you have a weak random number generator, as was an issue with the Android Bitcoin Wallet. I should note this was android's fault for using a bad generator and was fixed quickly by the app developer, though some people lost coins because they had signed multiple messages (i.e. transactions) with the same address and the number generator used the same random number for more than one transaction, for more info you can see this: http://gigaom.com/2013/08/12/why-bitcoin-users-using-android-wallet-apps-need-to-upgrade/

If you'd like to know more about why using the same random number in two messages is bad, you can read about ECDSA (ecliptic curve digital signature algorithm) here: https://en.bitcoin.it/wiki/Protocol_specification#Signatures

Also if you are concerned with the people you transfer bitcoins with knowing how much money you have and when you're sending money, and possibly to whom, you should consider keeping your addresses and transactions separate. This involves choosing which inputs you use to send transactions, using a system like armory allows you to do this.


How do I verify the GPG sig for Litecoin Core?

Here is what I did to get this to work

Copy the public key (found here) to a file. I called it litecoin.public.key.

Then run the following commands:

gpg --import litecoin.public.key
gpg --verify litecoin-0.14.2-osx.dmg.asc litecoin-0.14.2-osx.dmg

This is the output that I got

gpg: Signature made Mon Jul 31 17:44:45 2017 EDT
gpg:                using RSA key FE3348877809386C
gpg: Good signature from "Adrian Gallagher <thrasher@addictionsoftware.com>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 59CA F0E9 6F23 F537 4794  5FD4 FE33 4887 7809 386C


What's an example of an ExtraNonce2 value that would be considered invalid?

There is no such a scenario. The ExtraNonce2 is part of the data that is hashed. So if a miner finds a valid nonce, he must also have the corresponding ExtraNonce2 that is part of the data that is hashed in order to produce a valid block hash.


Fixing "Block not found on disk" rpc error

Blocks are not stored in individual files, but flat bundles of a fixed size, so replacing one that is missing isn’t really possible. If a block can not be found on disk it has either keen deleted manually or by an errant process, or the disk is seriously corrupted. A re-index will fix this, but it’s an indicator of other possible issues related to hardware that this has happened.


Use a historical price chart like https://www.coindesk.com/price/


Will blockchain.info change my BTC adress each time after i SEND my BTC?

It is recommended that a new bitcoin address is used for every transaction, this is best for your privacy. So each time you receive a transaction, you should use a new address. Each time you send a transaction, your wallet should generate a brand new change address for you.

I think you are confusing the terms ‘address’ and ‘wallet’. An address is the string of random-looking characters that you can send bitcoin to, it will usually look something like this: 19STQThjmUqf2veMCWNb7JhErguiCBdy3r.

A wallet is a collection of addresses, controlled by some software that allows to to send/receive transactions.

I’m general, each time you publish a transaction you will need to include a transaction fee if you want it confirmed in the blockchain. I recommend doing some research into how transaction fees work and are calculated so you can learn how to transact most efficiently.


Does selfish mining actually give an advantage in the absence of transaction fees, difficulty changes, and economic effects?

You're missing the main point: when a selfish miner finds a new block, he keeps it private, does not broadcast it to the network, and starts mining on top of that privately.

The rest of the network is still mining on a block that was actually already found, but not broadcast.

When the rest of the network finally finds this block, the selfish miner broadcasts his version, in an attempt to replace it.

By invalidating blocks this way a selfish miner is effectively wasting other people's cycles, and has a head start for winning the next block, because he started mining on it before the others.

Edit

Keep in mind that this practice is only successful if you're a large pool with around 25% of hashing power. Major pools of this size are closely watched and scrutinized by the entire community. Finding consecutive blocks in a row, for many times, is a strong indicator that the pool is practicing selfish mining. The community can therefore decide whether to leave the pools who are practicing this behavior.


You are unlikely to collect rewards consistently (or at all) solo mining with that hashrate. You should join a pool to smooth out your expected return, unless you are okay with the posibility of earning nothing for long periods of time (or are a very lucky person).


Can I print my public key using a custom logo?

You generally don't publish your public keys, you give clients an address (which is usually computed from a public key, but not exactly the same).

You can definitely put an address in a QRCode. Putting a logo in the QRCode doesn't change anything about that.

Generally you'd put a "bitcoin:" URI in the QRCode. More information can be found in BIP21.

Note that best practices involve not reusing addresses for more than one payment (and certainly not for more than one customer, or you wouldn't be able to tell what the payment was for), which may make it harder to use a custom web-based service for generating the QRCodes.


Scenario: disaster splits the Internet into dozens unconnected fragments

Most merchants accepting Bitcoin transactions require six confirmations, so if there is no connectivity then, of course, there would not be any confirmations.

So while continuous connectivity isn't required to use bitcoin in commerce, at least sporadic connectivity is.

For merchants who accept on 0/unconfirmed (e.g., retail), the rely on protection from the network to know of a race attack.  Without connectivity, that protection is gone and the merchant is vulnerable.  If the customer can be trusted, then a transaction on 0/unconfirmed can be accepted even without continuous connectivity.

For when extended outages occur, there wouldn't be multiple blockchains as there's no chance some isolated node (or region of connected nodes) would have the hashing capacity to make it to even one or two confirmations nonetheless six confirmations.  So there's no isolated forking issues to be concerned about.

Futher discussion on the suitability of bitcoin on an "disconnected island" occurs here:

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


LND is experimenting with the new Neutrino BIP157-style SPV at the moment. Check out their repo for news.

Both Bitcoin Lightning Wallet and Eclair on Android use a trusted server for syncing with the network.

BIP-37-style SPV is not a good choice for anyone (because of privacy issues), but particularly not for Lightning wallets, because it is very easy for an adversary to help a channel partner in cheating by withholding critical transactions that your wallet would have to respond to.


How does an encrypted wallet persist used keys from "getnewaddress" and the keypool after a restart?

You can't call it an infinite number of times. In fact, with default settings, the 101st call will fail.

While the private keys that control the bitcoins are encrypted, the addresses corresponding to those keys are not.