I've notices several wallets that are just the same thing with a
  different name, but so far the only thing i get to know is that they
  give an address

They do much more than just giving you an address. They also download and store the Blockchain which contains all transactions ever made. Those data are needed to check, if one of your addresses received a payment. Those data are also needed to send data to a different address.

  they all have an overview with the balance on the account at 0 coins, that's fine then a tag of sending and asking coins, I can also get to understand what that does even when is empty and the only thing i guess i have to find other addresses is person to person, now the crazy stuff that makes me wonder do i have to be a programmer to use these things?

You're right, you will get addresses from other persons or from the internet. You do not need to be a programmer. With a wallet it's like sending an e-mail, but instead of sending text, you send bitcoin. For sending bitcoin, you need to receive some first. That can be done by buying them in online trades or at an ATMs.

  what is that thing (Out of Sync) next to the wallet in red letters? how do I fix that? How can I "Sync" what exactly? since when i install primecoin wallet for example, it starts downloading a bunch of crazy stuffs updating a bunch of weeks and after is finally done, it just tells me that the wallet is out of sync, and there's nothing i can do about it and i google

As I said before, the crazy stuff which is downloaded is the blockchain. For Bitcoin it can take really long, because currently its size is about 20 GB. There are different types of wallet. The full node, for example Bitcoin-Core, which I guess is the one you downloaded, is mostly for the professional user. It contains the complete blockchain, and needs very long to sync.  An other type is the SPV (Simplified Payment Verification) for example Electrum. This one dont need to download the complete blockchain, it will only download the headers, which save a lot of traffic and storage. Those are also available for smartphones and are often used by the average users. A third type is the web-wallet, like blockchain.info for those you wont need to download any data, you can access them through you browser.

  and people just mention but never explain a scary debug window with a
  console that i have no idea what it does or what should i do with
  that, and they only post code stuffs that if i copy paste won't work,
  at least not in all wallets and in those that accepted that code, does
  absolutely nothing that i can know of....

This is only for developers and those post a mostly related to the bitcoin-core wallet and its JSON-RPC interface. You don't need those for normal usage.

  is there a newbie guide on how to get to use a wallet? primecoin, dogecoin, rainbowcoin, aimcoin... they all look just the same, and people talk about mining some few coins just by keeping them open :S

All those wallets have the same appearance and mostly the same functionality. There are some guides around. Coindesk offers a very good beginner guide which contains many of your questions and explaining all the important stuff.


One Method

1.0) Using Coinbase, (coinbase dot com) is currently my preferred way. Create an account there and do your homework. They have made the process rather straight forward once you are verified.

1.1) The fastest way to get verified is to link your US based bank account to their service. I would suggest buying a small fraction of one BTC to get verified more quickly, rather than having  Coinbase send a couple transactions to your US bank account for you to verify.

1.2) Answer the Coinbase security verification questionnaire quickly. They are following the Know Your Client (KYC) rules. If you take long to answer the questions your verification will fail and you will need to wait 24 hours to try again. In this context KYC refers to due diligence activities that financial institutions and other regulated companies must perform to ascertain relevant information from their clients for the purpose of doing business with them in the USA.

2) Convert your USD at MtGox to BTC and send it to your account at Coinbase.

3) After you have been verified you can convert your BTC to USD and transfer the USD into your US bank account rather quickly.

Note that the price you are selling the BTC at Coinbase is less then what you paid for them at MtGox which can be $ignificant if you have many BTC to sell for USD. There are other ways but this is one that has been working well for me. . .


Compiler optimizations for self-compiled Bitcoin Core

By default, yes and no.
No, most of the code is compiled for generic target hardware. If you want something optimized for your actual hardware, you can add -march=native to your compilation flags (e.g. you'd run ./configure CFLAGS="-march=native" CXXFLAGS="-march=native"). This will result in a binary that may not work on other hardware than your own. This likely gives you some performance gains, but is unlikely to have a huge impact, because...
Yes, some code has several variants that are always compiled in, and the optimal one is decided at runtime based on available hardware features. This includes:

SHA256 versions for SSE4, SSE4.1, AVX2, and SHA-NI exist.
CRC32 versions (inside LevelDB) for ARM64 and SSE4.2 exist.
The internal random number generator will use RDRAND/RDSEED if provided by the hardware (in addition to other randomness sources).

Certainly more optimizations are possible for specific hardware or features, but generally this isn't as easy as just turning a compiler flag - it also needs different code to actually make use of it. For example, compiling generic SHA256 code with -march=native will give a modest speedup, but using code that is designed to make use of the 256-bit wide registers AVX2 can be several times faster in some cases than that, by computing multiple hashes in parallel.


Is the proposed "Miner Promise" method of accepting 0-confirmation transactions safe?

I don't think it helps much. The biggest real threat is the Finney attack, and the Finney attack is just as big a threat even with such a promise.


How can we know our "from" address in advance?

There is no from address in Bitcoin.
https://en.bitcoin.it/wiki/From_address

Each transaction reference an unspent output (UTXO) that was sent to you in a previous transaction.

About the address, you need to generate a new one for each payment:
https://en.bitcoin.it/wiki/Address


How/when are transactions removed from the not-confirmed pool?

In Bitcoin Core, the memory pool is a consistent set of transactions that can legally follow the best known block. As already mentioned, there is no guarantee of consistency between different nodes' mempools.

In practice that means:

when a new block is accepted (received from the network or locally mined), all transactions in it are removed from the mempool, while their dependencies are kept.
when a new block is accepted, all transactions that conflict with transactions in that block, plus all their dependencies, are removed from the mempool.
when a block is reorganized (disconnected), its transactions are attempted to add back to the mempool in reverse order (since they may interdependent), unless they conflict with transactions already there.


Bitcoin Orphan blocks - short question about the "time lag" factor and proof-of-work "size"

What is this "time lag" ?

When a miner finds a block, they will broadcast it to the network. As with all real-world networks, there is a latency (“lag time”) for this information to be received by the other nodes in the network. Specifically, there will be some amount of latency between the miner that found the block, and other miners on the network. Even if the latency is small (milliseconds), there is still some chance that another miner will find a block within that “lag time”.

  What is the "size of the proof of work" exactly?

Nodes will follow what is colloquially referred to as the “longest chain”, but in reality they are following the “chain with the most work” (the difference is subtle, but important). Each valid block is equally valid, so for there to be “more proof of work” on one chain is to say that chain is “longer”, and thus the valid chain.

If two miners find valid blocks at the same block height, it will not be clear which block will become a part of the eventual longest chain, until a miner finds a new block that builds upon one of those two blocks. At that point, the longer chain will become clear, and the network’s nodes will follow it.

  Above mentioned protocol rules: When exactly are the nodes (or the network) checking for them

The consensus rules are defined by the source code itself, there is no formal specification.

When a node on the network hears about any new transaction or block, it will run a series of checks to determine that transaction/block’s validity. If it is invalid, it is discarded.

When a miner assembles a block template, they will choose only transactions they have determined to be valid, and carefully craft the block to be valid also. So this is done before they start hashing, otherwise they would be wasting hashpower by creating an invalid block.


How websites like silkroad and pandora process transactions?

The underlying mechanism is to generate an address specifically for one payment. The address space for Bitcoin is mind-boggingly large (almost any 256 bits number is an address) so that's not an issue. That address is monitored for a payment and once the payment is received, automatically transferred to the merchant's final address (or payment).

As to software, it's a bit all over the map. You can either use something that will make the whole process transparent (like BitPay or Coinbase) or use lower-level APIs interacting with the BlockChain like BlockCypher.


Is it safe to send to my own address from my wallet?

I think you need to understand a lot more about public and private key cryptography first. It sounds like you have no idea what the address actually is or how it's used in Bitcoin.

Yes, the standard client does generate addresses in advance, and these are used by the client when you request the "creation" of a new address. But if you (or rather your client) does not know the private key associated with the address, you will lose your bitcoins forever.

Therefore you need to know both the address that you are sending to and the private key, to be safe.

Can I recommend that you learn about your wallet and how it works by using your bitcoin client in testnet mode first.


That's how Bitcoin works. Accounts don't really have balances, they have unspent outputs. You have to spend entire outputs, but you can return amounts to yourself to create a new "change" output that you can spend later.


Why are miners allowed to change a tx id?

BIP 62 proposed to make transaction malleability impossible.

No it didn't. It would have outlawed a limited number of known and addressable forms of malleability.

In particular, it did not prevent multisig transaction participants from just creating a new signature, malleating the transaction without invalidation. This type of malleability is trivial to perform, and breaks nearly every smart contract construction imaginable.

BIP62 was retracted because while it addressed some forms of malleability, it didn't and couldn't fix an equally bad one.

Instead, Bitcoin adopted BIP141 (Segregated Witness), which does not remove malleability, but makes it harmless. The transaction signatures just don't contribute to the txids anymore. Thus, while it is still possible to malleate transactions, doing so does not invalidate dependent transactions (as they refer to previous transactions using the txid). Other than BIP62, this solution applies to multisignatures as well, and also against all forms of non-discovered malleability.


The Bitcoin Network is a P2P network made up of independently operating nodes from all over the world. Miners will connect to this network in order to maintain a view of the network's state, which is crucial to their participation as a miner.

By connecting to the network, a node (and/or miner) will receive and relay information from its peers, about new transactions and blocks. Nodes communicate using TCP, and the standard port is 8333. For a deeper dive into the specifics of the gossip protocol, see this question.


Is holding funds in a Bitcoin paper wallet safe?

Yes. A paper wallet is basically nothing more than your private key on a piece of paper.

For usability it is often represented as a QR code though. You can make copies of it, and store several of them in different places, or even store half of the key in one location and another half in another. Bitcoins are never in your wallet, paper or otherwise; they are just entries on the blockchain. Your wallet contains only the private key to allow you to spend your entry on the blockchain.


Development questions regarding debugging and control flow

You want to look at miner.cpp, and perhaps at rpc/mining.cpp for the generate function that's exposed to RPC.

blockencodings.cpp is pretty much only used for the compact blocks P2P format specified by BIP152, and has nothing to do with normal block generation.


Yes.  Let's calculate the minimum size of a block:

The block header must be exactly 80 bytes.  This is the only part of the block that miners actually mine; the rest of the block is data that the header securely references.
The transaction count.  This isn't part of the block header and it isn't part of the block data, but it's part of the peer-to-peer protocol block message so it gets counted towards the block size.  For blocks with 253 or fewer transactions, this is 1 byte.
The coinbase transaction, the only required transaction in a block.  The coinbase transaction has the following fields with these minimum values:

4 bytes -- version field
1 byte  -- number of inputs (always 1 for coinbase transactions)
32 bytes -- outpoint txid; always 32 0x00 bytes for coinbase transactions
4 bytes -- outpoint index; always 4 0xff bytes for coinbase transactions
1 byte -- number of bytes in coinbase field (input script); always 1 byte for coinbase transactions because there's a 100-byte limit
4 bytes -- block height as a data push; required by BIP34
4 bytes -- sequence number
1 byte -- number of outputs, we're not going to have any (making the block reward and transaction fees paid in this block permanently unspendable; no real miner would do this)
4 bytes -- locktime
Total: 55 bytes

Total minimum block size: 80 + 1 + 55 = 136 bytes

Practically, the smallest reasonable blocks are in the 180-byte range.


GUIminer can be run on linux, although the process (described in the official thread) is somewhat complicated.  To summarise that post, you will need to:

Get the source code from GitHub:

git clone https://github.com/Kiv/poclbm
Install OpenCL drivers and PyOpenCL.
Install wxPython:

sudo apt-get install python-wxtools
Run guiminer.py:

python guiminer.py

Note that (at least to use the poclbm backend) no compiling is necessary since GUIminer is written in python.  But I can still understand if you find that process a little daunting, since I don't know your level of technological familiarity with these sorts of tasks.


Time allowed to a node to react to verify a transaction and number of verifications?

You seem to misunderstand how transaction validation and finality works.
Nodes validate transactions as they receive them in the mempool or in new blocks - these validations check for standardness (for mempool txs), and consensus compliance  (ensuring there are no double spends, valid utxos, etc).
However, a transaction is not final simply because a number of nodes have confirmed it. A transaction is final ONLY if a miner includes it in a block AND that block is accepted as valid by the network. This finality happens regardless of whether there is 1 node on the network, or 30000.
Note that even after being mined into a block, conventional wisdom says to wait for new blocks to be mined on top of that block, to provide a reasonable guarantee against minor forks rolling back a transaction you consider final. Most exchanges and service providers wait for 2-6 confirmations before considering a transaction truly final.


When running a mining pool how many (super)nodes should I connect to?

The only downside to more connections is increased bandwidth usage and slightly more CPU usage. Here, it's estimated that 2000 transactions per second is 7.8 megabits/second (average residential connect speed) and Bitcoin operates at the most at 7 TPS currently so you're in the clear.

Why you should connect to more nodes.

The more nodes you are connected to the more up to date you will be on network status and vice-versa. If the network comes up with a new block, you will be one of the first few notified.

If your mining pool comes up with a block, you will want to push your block out to the network as fast and spread as possible. You want as many nodes to know about your new and valid block as possible. Of course a new block incurs a domino effect with nodes, one node that knows of your block will tell other nodes about it. You can reach all nodes faster if you notify many nodes.

Why do I need nodes to know about my block?

Mining is a competition, you are competing against a massive amount of other players who all are probably hashing faster than you. It's very likely that they will also find a block in the time you do, this happens often. But only 1 block can be accept, and block acceptance is based on network majority. If you mine a valid block at the exact same time as another miner, and you can get a good majority of nodes your block, you will get the reward. The other block turns into an orphaned block and the miner who mined it loses all profit.

It's suggested you connect to as many large node as possible, you don't have to necessarily connect to smaller nodes as large nodes will rebroadcast your block to many small nodes. You may see some increased bandwidth usage but it's negligible considering what kind of connections servers tend to have.

Concerning transactions fees

Connecting to more nodes will net you more transactions to put into blocks, but it really won't be much. The 10 minute block time Bitcoin has means your node will have ample time to put together enough transactions for profit.

8 peer connections is not a lot and may mean you aren't receiving any inbound traffic.


"New rules activated" warning after upgrading to 0.20.0

Miners have been using the version field of the blocks' headers as an "extra nonce" (*).

However, this version field has been used to signal readiness from miners to deploy a soft fork (update to new backward-compatible rules).

The version field being used to synchronize the update to new consensus rules is the reason you see the warning.

The version field value not being enforced by the consensus, and the development of new techniques that increase miners' revenue is the reason they can "disgress" the protocol.

(*) In this specific case, it's known as version rolling and is likely part of using overt asicboost.

EDIT - Some reference of discussions about how to deal with this in bitcoin-core :

BIP320 implementation
Discussions on an issue
GUI warning removal


Listening for changes to my own wallet in the blockchain

You could also use our own Websockets API. More specifically, you need to check the addresses event in order to subscribe to one or multiple address and receive balance updates for them.

An example request command would be:

{
    "event": "addresses:update",
    "filters": {
        "addresses": ["1Biteasym3p5E4soZq8So6NjkjYugEnz2X"]
    }
}

And when the balance is updated you will receive the following response:

{
    "event": "addresses:update",
    "data": {
        "balance": 1746000,
        "total_sent": 0,
        "total_received": 1746000,
        "address": "1Biteasym3p5E4soZq8So6NjkjYugEnz2X"
    }
}


How to restore the original mnemonics from shares?

You can select what subset of the shares are enough to reconstruct the original secret. That's why it's called m of n. So set m to 2 and n to 5 and you have what you need.
If you haven't done this before splitting the secret then 2 shares will not be enough.


How does a client decide which is the longest block chain if there is a fork?

Gary's answer is not entirely correct. When comparing two chains, their total "scores" are compared.
Each block counts as (2^256 / block_target); this is the expected/average number of attempts that were necessary to create it.

Obviously, within one series of 2016 blocks, the difficulties are all equal, so for most small reorganizations, the score will tell you the same thing as just counting the number of blocks. However, as an attacker may well try to rewrite blocks that cross the multiple-of-2016-boundary, you need to take this into account. The actual rule always favors the chains which required the most "work".


Is it actually possible to secure your coins while also allowing access to "near and dear" when you die?

This is what safe deposit boxes are for.  Write your passphrase on a piece of paper and put it in a safe deposit box at a bank that will allow only you (with proper identification) to access the safe deposit box, until you die, whereupon access will be available to whoever you've designated through proper legal documents.
If you are worried that some bank employee will break into the safe deposit boxes, then put half your passphrase in a box at one bank and the other half in a box at a different bank.
I'm sure you can imagine ways this can still go wrong, but unless I'm missing something, they are all extremely unlikely.


For m of n multisig, only the last m pub keys are checked for validity, given that at least the last m pub keys are valid public keys and match to signatures in the correct order. Other pub keys are not checked and can be used to push arbitrary data.


Why is the Bitcoin Gold Hardfork happening?

It's just a group of people trying create more money and gain control of their own blockchain using a hard fork.

My guess on why they aren't starting their own blockchain and just forking Bitcoin's is that Bitcoin already has huge name recognition and they probably already own a bunch of Bitcoins to begin with.  If they fork the Bitcoin chain with the name "Bitcoin Gold" they can basically ride the coattails of Bitcoin and possibly create an altcoin with significant value (making money out of nothing).  This is nothing short of fraud, and anybody who ends up buying "Bitcoin Gold" coins is essentially just giving them free money.


How can I generate SegWit addresses from a mnemonic using python?

If you just need a command line, you can try pip3 install btc-address-dump.
Here is an example:
$ btc_address_dump "olympic wine chicken argue unaware bundle tunnel grid spider slot spell need"
mnemonic = olympic wine chicken argue unaware bundle tunnel grid spider slot spell need
private key (hex) = c7ac679b56f50bfd54dd924fe45a8dca7a1c2dced254b03dac22afc03adb9127
private key (WIF) = 5KLDyKtrScLYsKMJzVCt8Mf6Nn9DEV7V3fg8njfSZnqe7ZEMqzK
private key (WIF compressed) = L3urFcPsE2yHf5zeQjVSfUB8j8FEzX5cnmhjNsJfqjKgowPP4tmg
public key (uncompressed) = 044cd0aaeca3b636078583408e75edd77307b5190ca7a48bb9fbc1f2576c17dff1087190d91e26af594e3f8ecd3f4d3596c03c45d3b235da916903c930c6593cc4
public key (compressed) = 024cd0aaeca3b636078583408e75edd77307b5190ca7a48bb9fbc1f2576c17dff1
legacy address (p2pkh uncompressed) = 1Q5RqZctfcNkTPad2tuJSREByd2gB8xs63
legacy address (p2pkh compressed) = 12W36tm2jnreFiYdrzfE6cvRaKRbicEpnA
p2sh-segwit address (p2sh p2wpkh) = 3AzXxVUqdzvzEqVmdtmeVqRwc98uqwyh76
bech32 address (p2wpkh) = bc1qzp6lz6zy9p7k68r0a7lzfpkdxvj3yapynzuatt


How can forks coexist even though only one of the is the longest chain?

For one, Litecoin is not a fork of Bitcoin. It relies on the same base code, but it is a separate network, and they do not share the genesis block.

Bitcoin Cash is a true fork of Bitcoin, in the sense that they can be traced back to the same genesis block.

Both chains continue to exist as they follow different consensus rules. Blocks on the bitcoin Cash chain are considered invalid by the nodes on the Bitcoin chain, and vice-versa. Since they have conflicting consensus rules, they are each the longest valid chains for their own set of the consensus rules.

Edit:

To include some additional information based on the comments, we can look at why cross communication doesn't happen (in most cases).

For litecoin, the genesis block, network magic bytes (a set of 4 fixed numbers that identify protocol messages for a network), proof of work algorithm, and a number of other things have been different from day one. This would prevent ltc nodes from communicating with btc ones since they would disagree on just about everything.

Things are a little more blurry with Bitcoin Cash. On August 1st, 2017 (almost exactly one year ago!), Bitcoin Cash altered the consensus rules of Bitcoin at that time. They did so by increasing the maximum allowed block size to 8MB, the difficulty adjustment algorithm, and the tx signing method (to prevent replay attacks).

These changes went into affect at block #478558. For all blocks mined after that, Bitcoin and Bitcoin Cash were following different rules. Even if a Bitcoin Cash node was to broadcast a new block to the Bitcoin chain, it would be rejected as:

It may have exceeded 1 MB
The transactions were signed in an incompatible way to Bitcoin's signatures
The difficulty would be vastly lower than the Bitcoin network's difficulty (it was lowered quickly using the new EDA algorithm in Bitcoin Cash). This means that even if the BTC chain received 10 BCH blocks for each BTC block, the total work done would still be higher on the BTC chain since it has a higher difficulty.

Based on the above, Bitcoin nodes would reject the Bitcoin Cash blocks. Moreover, as MCCCS mentioned in the comments, Bitcoin Cash also eventually changed their network bytes, which would prevent a broadcast from accidentally being accepted to begin with, stopping the new block before it even reached consensus validation checks.

Now, lastly, if someone were to manually take the BCH, LTC, Doge, or any other BTC-like chain's data and attempt to broadcast it over Bitcoin's network, they would all still fail various consensus checks.


What are the downsides of integrating accumulators like utreexo to bitcoind?

Utreexo makes it possible to use Bitcoin securely without downloading the full blockchain. Since some prominent Bitcoin Core devs think there are not enough full nodes, I speculate that some may not like the prospect of less full nodes (less decentralization), and further more, more code complexity.

Also, Utreexo is still in development.

Also, since it requires no forks, so there is no pressure to integrate it into Bitcoin Core. With so many alternative wallets, a developer really has little incentive to work with the Core community when he could get it merged into a another wallet (his own :P) with certainty.

Take BIP 157/158 as an example. We all know code review is great, but I speculate that many developers would be discouraged from the amount of effort it takes to get something merged. If you have another wallet, as roasbeef does (btcd), I can't blame him for not wanting to bother with bikeshedding a Core PR for months, leaving it up to Jim Posen to see this through.

I speculate that Utreexo only exists because Tadge realized that the only way to get something like this is by doing it in a way that requires no changes to Core. There have been many UTXO-commitment-related proposals, for example Bram Cohen's proposal, which is arguably way simpler, but was too radical a change. Now the man is starting his own coin.

Learn to just appreciate the fact that Core is getting more and more stable!


You can buy all kinds of things from https://www.bitcoinstore.com/

You could also buy gift cards using bitcoin at http://www.gyft.com/

Finally if you want to sell your bitcoin for your local currency, you'd need to open an account at a Bitcoin exchange such as https://www.bitstamp.net/ - however this is the solution I like less because they require you to send them some personal information like your ID or bank account information to overcome fraud.


Will 2mb blocksize mean double as many transactions?

A block begins with a header of 80 bytes, and everything else is used for transactions.  So if you increase the maximum block size from 1000000 to 2000000 bytes, the space available for transactions grows from 999920 to 1999920 bytes, which is just slightly more than double.

Basically, yes; assuming that the average size of a transaction remains the same, the 2MB block size will allow for almost exactly twice as many transactions per block as 1MB.


Mining a transaction with a 0 BTC output

Do you want to create p2pkh output and send zero satoshies on it? Such output is non-standard (dust) and will not be relayed and mined (but it is possible)

Or may be you want to create nulldummy (OP_RETURN) output? This is possible

BTW, sometimes miners confirm non-standard transactions, for example https://blockchain.info/tx/b4ea693a9d2d7e32b66777964fce13da302bed024bd9fd4651919da650fb1c40 (it is p2pk output)


There's nothing a market order can do that a limit order can't do. To place a market order, just place a limit order for the amount you want to buy at the worst price you are willing to pay.


no, a transaction has no time stamp. Details can be found here: https://bitcoin.org/en/developer-guide#transactions


How does a recipient know they can satisfy the transaction script to spend their bitcoins?

I don't think your threat model makes sense. If you "send me Bitcoins I can't claim", you've done the equivalent of nothing at all, except you've wasted some of your own Bitcoins in the process.

Currently, clients will only recognize Bitcoins as being sent to them if they can confirm they can claim them. Non-standard transactions (those with scripts other than the two well-understood forms) are ignored.


What is the official website for Bitcoin?

There is no official website for Bitcoin. Every website mentioned in the question is either managed by an individual or a company with their bias, opinion, products, services etc.


How to model randomness in validators selection in PoS?

I understand it is a random selection based on fraction of stake a validator has, similar to PoW.

Not correct. In PoW, any miner can mine the next block. In PoS, a specific validator is chosen by the protocol that has the right to form/propose the next block.

  The chance each miner has for each block depends on its hash power fraction, but random in terms of assigning miners to blocks.

The first part is correct that the chance a miner has depends on the hash power fraction. However, no miner is 'assigned.' Any miner can form the next block in the blockchain provided the block is valid and its header hash meets the target requirements.

  How block arrival and assignment differs in PoS?

There is no one protocol set in stone that determines how the next block validator is chosen. (1) Peercoin (the first coin to implement PoS consensus along with PoW) used coin age (no. of coins x no of days the coins are in the wallet) to determine the next validator. (2) Then there is a hash selector (Ouroboros Praos protocol) wherein you take the current date and time, sign it with your private key and then check if it is less than the difficulty target. If yes, you are selected as the next validator. (3) There was one method where the randomness of the next block will depend on the signature of the current block (this method is now defunct due to potential vulnerabilities.)


Yes, you calculated digest 2c7ecdcb2381e657228284398f2f66b2d7d9cf6aa1bd8e39a7300d0b3c8cfa5a correctly.

Here is my piece of dirty code:

static void xxtest ( )
{
  const QByteArray t ( MyByteArray ( )
      .putInt32 ( TX_VERSION ) // 01000000
      .putInt8 ( 1 )           // 01 : one input
      .putArray ( QByteArray::fromHex ( "5f386c8a3842c9a9dcfa9b78be785a40a7bda08b64646be3654301eaccfc8d5e" ) )
      .putInt32 ( 1 )          // 01000000 : index
      .putPrefixed ( MyByteArray ( )
         .putInt8 ( OP_DUP )
         .putInt8 ( OP_HASH160 )
         .putPrefixed ( QByteArray::fromHex ( "21c43ce400901312a603e4207aadfd742be8e7da" ) )
         .putInt8 ( OP_EQUALVERIFY )
         .putInt8 ( OP_CHECKSIG ) )
       .putInt32 ( TX_SEQUENCE )
       .putInt8 ( 0 )          // no outputs
       .putInt32 ( TX_LOCK )
       .putInt32 ( SIGHASH_NONE ) );
  _trace ( QString ( t.toHex ( ).constData ( ) ) );
  const MyKey32 digest ( t.constData ( ), t.size ( ) );
  _trace ( QString ( "digest = %1" ).arg ( digest.toStringRev ( ) ) );
  const QByteArray pubkey ( QByteArray::fromHex ( "04f1939ae6b01e849bf05d0ed51fd5b92b79a0e313e3f389c726f11fa3e144d9227b07e8a87c0ee36372e967e090d11b777707aa73efacabffffa285c00b3622d6" ) );
  const QByteArray signature ( QByteArray::fromHex ( "30440220bb4fbc495aa23babb2c2be4e3fb4a5dffefe20c8eff5940f135649c3ea96444a022004afcda966c807bb97622d3eefea828f623af306ef2b756782ee6f8a22a959a2" ) );
  _trace ( QString ( "verify=%1 (expected value=1)" ).arg ( digest.verify ( pubkey, signature ) ) );
  // now test the same with wrong digest
  const MyKey32 temp ( "temp", 4 );
  _trace ( QString ( "verify=%1 (expected value=0)" ).arg ( temp.verify ( pubkey, signature ) ) );
}
//--------------------------------------------------------------
bool MyKey32::verify ( const QByteArray& pub, const QByteArray& sig ) const
{
  return 0 < ECDSA_verify ( 0, constPtr ( ), 32, (const quint8*)sig.constData ( ), sig.size ( ), EC_KEY_pub_key ( pub ) );
}

the output is:

"01000000015f386c8a3842c9a9dcfa9b78be785a40a7bda08b64646be3654301eaccfc8d5e010000001976a91421c43ce400901312a603e4207aadfd742be8e7da88acffffffff000000000002000000"
"digest = 2c7ecdcb2381e657228284398f2f66b2d7d9cf6aa1bd8e39a7300d0b3c8cfa5a"
"verify=1 (expected value=1)"
"verify=0 (expected value=0)"

Update:
Here is small program for checking signatures with dependency only for OpenSSL lib:

#include <QByteArray>
#include <QDebug>

#include <openssl/ec.h>
#include <openssl/evp.h>
#include <openssl/ecdsa.h>
#include <openssl/sha.h>

static EC_KEY* EC_KEY_pub_key ( const QByteArray& pub )
{
  static EC_KEY* eckey = EC_KEY_new_by_curve_name ( NID_secp256k1 );
  const quint8* ppub = (const quint8*)pub.constData ( );
  o2i_ECPublicKey ( &eckey, &ppub, pub.size ( ) );
  return eckey;
}
//--------------------------------------------------------------
int main(int argc, char *argv[])
{
  const QByteArray data ( QByteArray::fromHex ( argv [1] ) );
  const QByteArray sign ( QByteArray::fromHex ( argv [2] ) );
  const QByteArray pubk ( QByteArray::fromHex ( argv [3] ) );

  quint8 tmp [32];
  ::SHA256 ( (const quint8*)data.constData ( ), data.size ( ), tmp );
  quint8 digest [32];
  ::SHA256 ( tmp, 32, digest );
  qDebug ( ) << "data=" << QString ( data.toHex ( ) );
  qDebug ( ) << "sign=" << QString ( sign.toHex ( ) );
  qDebug ( ) << "pubk=" << QString ( pubk.toHex ( ) );

  qDebug ( ) << "digest=" << QString ( QByteArray ( (const char*)digest, 32 ).toHex ( ) );

  const bool v ( ::ECDSA_verify ( 0, digest, 32, (const quint8*)sign.constData ( ), sign.size ( ), EC_KEY_pub_key ( pubk ) ) );
  qDebug ( ) << "result=" << v;

  return 0;
}


What is the implication of Induced Demand for Bitcoin scaling?

Although the phenomenon of Induced Demand is critical to effort to scale Bitcoin, it has not often been cited in public discussion. I refer to the following article, from Wired magazine, that discusses the issue in layman's terms:

https://www.wired.com/2014/06/wuwt-traffic-induced-demand/

If we make an analogy between an urban public road network and the public Bitcoin network, then the analogues are:

road capacity is block capacity
individual commuters represent transaction outputs (UTXOs)
each vehicle represents an actual bitcoin transaction

So, a regular P2PKH transaction is like a vehicle transporting two people - who represent two outputs: the actual send amount and the change amount.
Every vehicle must pay a toll (mining fee) to travel from A to B through the road network. Unlike a usual flat-fee road toll, this road network allows users to bid for access to the road. So, as congestion increases, users will pay higher and higher fees in order to drive on the road network.

In the case where there is more or less permanent congestion, fees will be permanently high. The self-evident solution is to simply add one or two lanes to the road network in order to increase capacity and relieve the congestion. However, as the linked article discusses, road planners have found, over the years, that increased road capacity (increased supply) almost always leads to increased demand, and the congestion soon returns.

Induced Demand and its impact on large public networks warns us that simply increasing block space will not necessarily have the expected outcome of lowering tx congestion and high fees.

Typical roadway solutions include reducing the number of private vehicles on the road by incentivising people to travel via buses or a transit system. A bus can hold 50 people and uses less road space than their 50 (or, say, 25) individual vehicles combined. A monorail, built above the highway, can transport 200 people in one trip, and commuters might disembark at stations along the road network from where they take bus routes to their destination.

The monorail and bus routes represent the Lightning Network. The road capacity remains unchanged but it is used more efficiently - reducing congestion and reducing fees.

Note that the congestion and fee relief is neither constant nor permanent, but the solution is smarter and more manageable than simply increasing block space. It is always possible to add additional monorails (protocol layers) and buses, whereas simple block size increases run into the problems implied by Induced Demand, and soon require another block size increase. Bitcoin security (decentralization) is systematically degraded by larger and larger blocks, so this is a critical drawback of applying on-chain scaling only.


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

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


When is the halvening? What are the dates of past halvenings?

Here are the approximate dates for the halvenings of the BTC block reward, as evidenced by the timestamp on those blocks. Note that the timestamp is not a perfect measure of when the block was found, but it is reasonably accurate, with an assumed margin of error of a couple hours (for more info on this see this question). The time stamp is a component of the block's header, and it is reported in unix time.

Genesis block - 50 BTC - Unix time 1231006505 (Sat, 03 Jan 2009 18:15:05 GMT)
Block 210,000 -  25 BTC - Unix time 1354116278 (Wed, 28 Nov 2012 15:24:38 GMT)
Block 420,000 - 12.5 BTC - Unix time 1468082773 (Sat, 09 Jul 2016 16:46:13 GMT)
Block 630,000 - 6.25 BTC - Expected ~May 2020
Block 840,000 - 3.125 BTC - Expected ~May 2024
Block 1,050,000 - 1.5625 BTC - Expected ~May 2028

You may notice that the past halvenings have occurred sooner than the expected ~4 year time frame. This is because the network's hashrate has been steadily increasing on average, but the difficulty adjustment only happens every two weeks. This latency means that by the end of the two week difficulty adjustment window, there will be more hashrate pointed at the network, so blocks will be found a little quicker than the 10 minute goal. This effect compounds over time, so each past halvening has occurred a few months ahead of the implied schedule.

Likewise, if the network hashrate were seen to steadily decrease over the next years, we would expect future halvenings to occur at a rate of > 4 years, as blocks would be founds slightly slower than the 10 minute goal.

The estimates given for future halvenings were calculated assuming a ~constant hashrate. A more accurate estimate could perhaps include a range of +/- a few months, based on historical observations of the network's hashrate.


To what extent does asymmetric cryptography secure bitcoin transactions?

Is there a specific attack or bug which asymmetric cryptography prevents during bitcoin transactions?

asymmetric cryptography is not really something that was added on top of Bitcoin in order to prevent some specific attack or fix some specific bug.

asymmetric cryptography is one of two fundamental foundation stones, one of the two primary building blocks on which the Bitcoin concept is based. Without asymmetric cryptography and one-way hash-functions the whole idea of Bitcoin would not have got started at all.

asymmetric cryptography underlies almost everything that is important in Bitcoin. Without asymmetric cryptography there could be no Bitcoin.

If I had to identify one thing that asymmetric cryptography provides it is that it prevents 7 billion other people being able to remove money from your wallet whenever they want and you being powerless to stop them. Its the difference between putting your cash in a safe only you know the combination for and leaving your cash on a park bench in the center of a crowded city while you go elsewhere for a year.

You might enjoy watching the two videos at https://anders.com/blockchain/ (watch both and in the right order) They are very easy to follow and reasonably brief. The first sets the scene, the second builds on that to answer your question (but you have to watch the first before the second)


How do I validate the correctness of a bitcoin multisig address?

Multisig addresses are defined as follows:

base58(0x05 + [20-byte scripthash] + [4-byte checksum])

For testnet, it's 0xC4 instead of 0x05, indeed.


64: non-mandatory-script-verify-flag while broadcasting P2WPKH Bech32 with specific inputs

First of all, these are not P2SH-P2WPKH, these are normal P2WPKH outputs. They are not related to P2SH at all.

The problem here is probably that the amount is incorrect. If you are providing the previous output data yourself, then the amounts is incorrect. You have it as 0.000560 but the actual amount is 0.00055999. Since Segwit commits to the amount in the signature, having the wrong amount means that the signature signrawtransaction creates will be invalid which thus results in this error.


The definition of dust is client-specific and not a network rule.
Bitcoin Core considers a transaction output to be dust, when its value is lower than the cost of spending it at the dustRelayFee rate. The default value for dustRelayFee is 3,000 satoshi per kilobyte, which results in the same dust values as the dust definition used before Bitcoin Core 0.15.0. The previous dust definition tied the dust limit to the minRelayTxFee rate and the spending cost of an output exceeding 1/3 of its value.
At the default dustRelayFee of 3,000 satoshi per kilobyte, the size of a P2PKH input being 148 bytes, and the size of a P2PKH output being 34 bytes, P2PKH outputs of 546 satoshis or smaller are being considered dust by Bitcoin Core. For P2WPKH (native segwit) outputs, 293 satoshis or smaller are being considered dust as outputs are about 31 vbytes and inputs are about 67 vbytes.
The dustRelayFee can be set with the hidden command line option -dustrelayfee.
Additionally, Bitcoin Core 0.15.0 added a discard_rate. The discard_rate matches the longest target fee rate estimate (currently the 1,000 block fee rate estimate), but is bounded to be between at least dustRelayFee and at most 10,000 satoshi/kB. Any change output that would be dust at the discard_rate, i.e. would cost more to spend than its value at the discard_rate, will automatically be dropped to the fee instead of being created as a change output.
Other uses of "dust"
Note that the term dust is also colloquially used to refer to any UTXOs of vanishingly low value, or for UTXOs that are uneconomic to create or spend at a given feerate.


Can someone explain to me how does PPLNS mining pool profit split in lay terms?

As you mine, you earn shares. The more hashes you do, the more shares you earn. PPLNS means that every time the pool mines a block, shares of the reward are distributed to the miners that mined the most recent shares. Often, N is chosen as twice the difficulty. So if, on average, a block will be found every one billion shares, the block reward is divided to those who submitted the last two billion shares when the block was found.


What benefit or incentive is there for someone to run their own ripple client or ripple server?

There is no mining in Ripple. The incentive to run a client is to use the Ripple network. There are several incentives to running a server. The main one, as Lohoris suggested, is to support the network. This is the same reason Bitcoin nodes relay transactions.

From the wiki:

Anyone whose business relies on the network:
    Gateways
    Merchants
    Arbitragers
    Day traders
Anyone who wants to support currency choice:
    Digital rights groups
    Libertarian groups
    Individuals
Anyone who wants to support the underbanked:
    Organizations
    Individuals
Anyone who wants to provide a public service:
    Universities
    Anyone who provides hosting services for open source projects

As a high-volume merchant or arbitrager, running a node is the most efficient and reliable way to participate in the network. If nodes feel you aren't pulling your weight, they can either disconnect you or impose a proof of work requirement on you to remain connected to them. This is because legitimate high-volume queries are indistinguishable from abuse. As a fully-participating node, you can see transactions before they're voted into consensus sets.


Where's my Bitcoin Cash? We followed Coinbase's advice and moved our BTC into a Jaxx wallet- No Bitcoin Cash anywhere to be found

Bitcoin Cash is an altcoin. You must have a wallet that supports Bitcoin Cash in order to see your Bitcoin Cash.


Why do "financial experts" hate Bitcoin?

Financial experts do not hate Bitcoin. Some might hate Bitcoin -for several reasons including a conflict of interest as you suggested, but not all of them.

There are countless financial experts in the world including founders and investors in Bitcoin based businesses. Just do some more in depth research and you'll find them.

I looked at that page you provided the link to. My suggestions is don't take the Expert label for granted. Take a look at who these people actually are. Be vary of anyone who expresses a very strict opinion about something they don't necessarily understand.

I saw evidence of both non-expertise and outright ignorance on that page.


How can Bitcoin transactions be traced if you can change your address?

In Bitcoin you don't change your address. You create new receiving addresses.

This is normally done so that a new address is created for each new transaction with the intention to increase privacy.

However in each transaction there are inputs and outputs and if a transaction has one input and two outputs, if you can infer which output is change, you know that there is some connection between the input address and the output address. You may be able to then trace that connection further back through a series of transactions. This is approximately like tracing possession of a coin passing through a series of people or businesses in a series of transactions.

This becomes more difficult if transactions have much more than one input and much more than two outputs.

Transactions may have certain characteristics such as address-types, size, timing and so on that may make it possible to make inferences. Transactions with differing characteristics could be inferred as being different parties, those with similar characteristics might be potentially associated with a single party of interest.

For example, if you see a large transaction with hundreds of inputs and one high-value output occur every Friday at 19:00 UTC, you might suspect it was a large exchange moving funds into cold storage as part of it's regular operational procedures. The timing might suggest a specific timezone.

We know that organisations such as the FBI perform blockchain analysis to trace illegal activity. The details of their methods are not published, so far as I know.

See

https://bitcoin.stackexchange.com/search?q=blockchain+analysis which leads to
How can there exist businesses that "specialize in blockchain analysis looking for patterns of usage that reveal how money is being used"?
How can I find a digital forensics expert to help trace stolen bitcoins?
etc


Does this mean the company has received the payment for the investment?

Yes

Once a transaction has more than about 6 confirmations it is regarded as complete and the money is fully under the control of the recipient

  Can l claim the unspent output ?

No and Yes.

If the recipient hadn't yet spent the money you sent them, it is still their money not yours. You no longer have any control over it.

The change returned to you is under your control, you can spend it whenever you want. Your wallet should show this change amount included in your wallet "balance"


Most Bitcoin ATM vendors require you to identify yourself and track your buys and sells. This is done due to Know Your Customers and Anti Money Laundering regulation. You need to present the source of of your money in some point when you exceed some threshold of volume. If any Bitcoin ATM vendor chooses not do this it would be helping  committing money laundering crimes.

If you find a ATM vendor stupid enough not to do any kind of KYC do not expect them to stay in the business in long run. Alternative, if the operator of ATM stays anynonymous, they are looking for a scam exit and will run with your money.


How do you resend a transaction without running a full node?

You can use any software which is capable of broadcasting a transaction. This could be another wallet software such as Electrum or a command line tool like bitcoin-submittx.


Getting address balance that not exists in my wallet

You can use the command bitcoin-cli importaddress to watch addresses that your wallet does not control. This command will generally require a rescan of the chain, which can take some time depending on your computational resources.

Note that if you happen to know which blocks contain transactions related to the address in question, you can turn off the rescan when importing the address, and then separately run a rescanblockchain command to only search the necessary blocks. This can greatly reduce the rescan time.

Here is a dump of bitcoin-cli help importaddress, running bitcoin-core v0.17.0.1.

importaddress "address" ( "label" rescan p2sh )

Adds an address or script (in hex) that can be watched as if it were in your wallet but cannot be used to spend. Requires a new wallet backup.

Arguments:
1. "address"          (string, required) The Bitcoin address (or hex-encoded script)
2. "label"            (string, optional, default="") An optional label
3. rescan               (boolean, optional, default=true) Rescan the wallet for transactions
4. p2sh                 (boolean, optional, default=false) Add the P2SH version of the script as well

Note: This call can take over an hour to complete if rescan is true, during that time, other rpc calls
may report that the imported address exists but related transactions are still missing, leading to temporarily incorrect/bogus balances and unspent outputs until rescan completes.
If you have the full public key, you should call importpubkey instead of this.

Note: If you import a non-standard raw script in hex form, outputs sending to it will be treated
as change, and not show up in many RPCs.

Examples:

Import an address with rescan
> bitcoin-cli importaddress "myaddress"

Import using a label without rescan
> bitcoin-cli importaddress "myaddress" "testing" false

As a JSON-RPC call
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importaddress", "params": ["myaddress", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/


what are my tax implications for cryptocurrency?

In the United States, Bitcoins are treated like a commodity asset, not like cash. So when you buy something with Bitcoins or exchange Bitcoins for dollars, you have a taxable capital gain on the difference between your basis in the Bitcoins and the value you got for the Bitcoins.


Bought BTC from Blockchain but Received Less Than Expected

Right, just called up and it looks like Barclays (The owners of PingIt) where completely overwhelemed at the point and so where slow to process it. The person I talked to was very helpful and is going to send me the extra amount now. I contacted him at this number: (+44) 7525 431876.

In hindsight, I think they where just incredibly busy with orders and so where slow putting it through.


Bitcoin Binary Options - What are they and is it a Scam?

Bitcoin Binary Options are financial instruments that allow you to predict if the price of Bitcoin will rise or fall in a specific amount of time. They are called binary options because there can only be 2 outcomes - either you get your payout, or lose your money.

Each option has a predetermined expiration date and an agreed payout. For example, if you decide to buy a "call" Binary Option on Bitcoin this means you think the price will rise.
If at the stated expiration date the price was higher than what you've bought it at, you get your payout.

Binary options seem to resemble gambling in a way that you don't have to have any prior knowledge in order to succeed or fail in them. It's just "betting" which way the price will go which is almost impossible to do consistently in short time frames.

There have been many complaints about Binary options being scams and it's important to see that the company you're considering is regulated in your country. Also, if you dig a bit deeper into the math of Binary options you'll find out that just like a casino the house has better odds at profiting in the long run.

For more information you can read this article.


I noticed that sending a transaction actually means sending your entire wallet amount to the person and you get change back?

Requiring an output to be fully consumed by a single transaction simplifies things -- an output is either spent or unspent, period. The idea is to avoid a proliferation of partially unspent outputs that would be very difficult to track. If a transaction could partially consume an output, then you'd have a whole new category of partially unspent outputs, each potentially partially consumed in some number of places.

It is possible to send the "change" to the original receiving address. If you do that, the paper wallet will still contain the key to access the new change outputs. If you use a new address for the change, then the paper wallet will be unable to spend the change. (Unless it's a complex type of deterministic wallet, which I very much doubt.)

With the current system, each output is either consumed by a transaction which has it as an input or it is unconsumed and is a valid output to be consumed by a future transaction. With partial spends allowed, each output could be partially-consumed by any number of other transactions, making the system much more complex.

Current System:

You get a check for $100. You now have a $100 unspent output.
You send $10 to a friend by consuming the $100 and sending $90 to yourself. The $100 check is now fully consumed. You have one output for $90 and nobody cares about the check anymore.
You send $20 to a friend by consuming the $90 and sending $70 to yourself. You now still have only one output, both previous outputs are fully consumed.

Notice how the state stays simple at all times? Every output is either fully-consumed or untouched.

System with partial consumption:

You get a check for $100. You have a $100 unspent output.
You send $10 to a friend. To understand that you have $90 left, we need to look at both the $100 check you got and the $10 you sent to a friend.
You send $20 to a friend. To understand that you have $70 left, we need to look at the $100 check you got, the $10 you sent in step 2, and the $20 you sent now.

Notice how the system's state is getting much more complicated? To understand what is left of the $100, we have to look at two other transactions that partially consumed it.

It's just much simpler to fully consume and replace with a new, smaller unspent output than have to track partial consumption across two places.

Worse, imagine if you got two checks for $10 and wanted to send $15 to a friend. Now we'd have to look in three places to know what was left -- both checks and the $15 you sent to a friend to figure out you have $5 left. It's much, much simpler to just destroy the original checks and issue you a $5 payment to yourself. Now, we know the checks are dead because a transaction touches them. We know the $5 payment to yourself is good because nothing touches it. Everything is either spent or unspent. Simple.


Your code is close to what you need:

<?php

$guid="xxxxxxxxx";
$main_password="xxxxxxxxx";

$json_url = "https://blockchain.info/merchant/$guid/balance?password=$main_password";

$json_data = file_get_contents($json_url);

$json_feed = json_decode($json_data);

$balance = $json_feed->balance;

echo $balance;
?>

The response looks like this (Wallet Balance in Satoshi):

{ "balance": 1000}

So you need to fetch the balance object not the message one.
Then add an echo to print out the balance.


Bitcoin API(s) - how to pair (or obtain) BOTH sender and receiver addresses with a transaction ID (hash)

The Bitcoin system doesn't have a "sender's address".  You can walk the transaction history to find out what destination the coins you were paid was last sent to but that is not a "sender's address".

Imagine if you had a magic wand you could wave over any package you received in the mail that would tell you where it was last mailed before you. You wave the wand over a package and find it was last mailed to a large distribution warehouse in china.  Is this the sender's address?  No. You bought the package from a shop in New York that purchased it for drop shipment from a distributor in Texas that fulfilled it out of a third party operated warehouse in Seattle, who recently pulled it out of a container from transoceanic shipment from the warehouse in china that your wand returned.

The previous to address might be useful information, just like the wand example-- but it is not the sender-- or at least not necessarily so--, it is not a return or refund address.  And this failure to map to the sender is not a fringe situation, just like the wand returning someone other than the party who sold you something would not be fringe: people frequently pay bitcoin's out of third parties wallets.


How does one mine a fraction of a bitcoin?

You either mine a full block...

-> Then you're free to take the full 12.5 BTC reward or less, at your choice.

Or..

-> You can mine with a pool. Everyone in that pool calculate hashes of trivial amounts, but their sum will be enough to mine blocks. Then, the pool will reward your work. (Search for PPS or PPLNS)


(note: I'll be using a different bit numbering from the comment which goes from 0..B instead of 1..2^B, as I find that easier to read myself)

The binary representation of 0x9 separated in functional groups is

bit# ...6543 21 0
        ---------
        0001 00 1

Bit 0 is set because this is a coinbase
Bit 2 and 1 are 0, because vout[0] and vout[1] are spent
Bit 3+ contain just the binary number 1. As bit 1 and 2 are not set, these bits encode N-1. N=(9>>3)+1=2. N here is the number of bytes in the subsequent bit vector.

These two bytes that follow are 04 and 40, encoding the number 0x440, the number with bits 2 (1<<4=0x04) and 14 (1<<14=0x4000) set. As described in the example this means vout[2+2] and vout[14+2] are unspent.

How do you end up at 0x11?


Sent Bitcore (BTX) to my Bitcoin Core wallet (a bitcoin wallet) - anyway to recover the BTX?

Private keys are independent of actually receiving any coins. You can get the private keys from your wallet by using the dumpprivkey or dumpwallet commands.

Alternatively, because Bitcore's wallet is based on Bitcoin Core, you can just copy and paste your Bitcoin Core wallet.dat file into the Bitcore wallet's datadir, replacing it's wallet.dat file (assuming that you are using bitcore's fork of Bitcoin Core).


What happens if the Exodus company and servers shut down?

exodus allows you to backup your private keys (look here). so if exodus will stop their service and you do not want to use exodus anymore (or maybe you can not) you can import your private keys in an other wallet and will not loose any funds.


How can I view all the NXT nodes that I can access publiclly?

See http://www.peerexplorer.com/api for a list of active peers including their public API status


Can a bitcoin transaction be tracked?

Mostly yes, all bitcoin transactions are recorded in the blockchain. There are techniques to try to cover up the trail -see Bitcoin mixers.

  I can be tracked down for using my credit card?

Obviously the credit-card company (& some of their employees) know you bought something from a Bitcoin exchange, likely Bitcoin. They know exactly who you are.

Obviously the Bitcoin exchange (& some of their employees) you used also know your identity and that you purchased Bitcoin with a credit card.

  Will someone know my location or my bitcoin address if I buy it using a credit card.

The credit card company will not know your Bitcoin address.

The Exchange (& some of their employees) know your Bitcoin-address.

They don't know your physical location unless you buy the Bitcoin in-person.

Many exchanges are required by Know Your Customer (KYC) laws to know who you are sufficiently for law-enforcement to track you down. Some of the employees of such exchanges will have access to this information.


How to recover my Copay wallet using the 12 word seed phrase

Are you using the Import option when you try to recover the wallet?

This issue looks similar to what you're experiencing: https://github.com/bitpay/copay/issues/7399


Can Copay iOS wallet sync with the Copay oSX wallet?

Yes, that's possible. Assuming you first created the wallet on your iOS and want to access it on macOS:

1) Open CoPay on iOS

2) Go to "Settings"

3) Under "Bitcoin Wallets" there's "Personal Wallet", click it

4) Choose "Backup" under "Security"

5) Write down the 12 words seed

On your macOS:

1) If you have just installed CoPay, it'll ask you for seed. You can type it, and then you're done.

If you already have CoPay installed:

1) Press "+" next to "Bitcoin Wallets"

2) Choose "Import Wallet"

3) Type your recovery seed


Is the Cloudflare proposed ODOH protocol a thing that could improve Bitcoin node privacy?

Bitcoin running with onlynet=onion is severely insecure, nobody should ever be running the software in this mode. There is no sybil protection, it is completely feasible to operate an unlimited number of HS peers and prevent a node from ever connecting to one which will give them a true vision of network consensus. There is no cost to performing this attack whatsoever.

one has to either leave DNS queries enabled (which could potentially reveal a user is running Bitcoin)

DNS queries can be proxied as well.

Does (hypothetically) using the ODOH protocol for the initial node discovery make any sense from the privacy perspective?

I doubt it makes any meaningful difference, especially as seeding is typically only something which happens for initial startup of a node and likely never again. You're almost never going to be able to hide that you're running a Bitcoin node from your ISP, even by using a proxy the traffic patterns are very obviously Bitcoin.


Many wallets that are designed to facilitate an easy user-experience will simply display one receiving address at a time. Once that address receives funds, a new address will be displayed. This helps adhere to the best-practice of only using an address once, which is very important for privacy.

With that in mind, if you're just copying the receive address as a means of looking up your funds on a block explorer, then it is expected that you'll be shown an address with zero balance. To view your addresses with a balance, you'll need to look up the receiving addresses of your past transactions (and, the change addresses of those transactions, if you've sent any BTC out).

Note: when you look up addresses on a block explorer, you are giving information to that service: for whatever reason, you are interested in that address. This can be a privacy concern, as the block explorer service can keep logs of devices/ips that query the service for specific addresses.


What happens when i change the encryption password of Bitcoin-Core wallet

Bitcoin Core wallet encryption works by encrypting the private keys stored in the wallet file. The private keys are encrypted with a master key which is entirely random. This master key is then encrypted with AES-256-CBC with a key derived from the passphrase that you enter using SHA-512 and OpenSSL's EVP_BytesToKey and a dynamic number of rounds determined by the speed of the machine which does the initial encryption.

Now, the first wallet file contains private keys that were encrypted using your original passphrase. So, if you had backed up that file before changing the passphrase, then your old passphrase will work in unlocking that wallet. Thus you can spend the funds held in your original wallet.dat file with the old password.

However, the look-ahead keypool is refreshed so that any new addresses you request after the password change are not in the old wallet with the old private keys. This means that if you don't spend your bitcoins after you change your password, anyone with a copy of the original wallet with the old password can still steal your Bitcoin if they have the old password.


Are really all transactions (the whole blockchain) stored on every client?

Everyone running a bitcoin Core node must download the entire ledger of transactions listed on the blockchain... But the vast majority of Bitcoin wallets are simply a place that stores a user's private key and allows users to interact with the network. When someone sends a transaction from their wallet, it gets broadcast to the network and eventually to Bitcoin miners.

Once a miner finds the next block (that includes your transaction), the solution gets broadcast to the network and those that are running the full Bitcoin Core software incorporate that block into the blockchain.

So although not everyone needs to download the full bitcoin blockchain, there are still a very large number of people who do, and by doing so, secure the network.


I'm assuming it's because it's never caught up with where my transaction is on the blockchain. Is this correct?

Yes.

  I can see when I take the address and look it up online the transaction of receiving the funds I just can't confirm a balance.

That's normal, if your client is still synchronizing.

  When everything does sync can I only transfer my balance out using the same app?

No, it's possible to use a different Bitcoin wallet. You need to 'export' the keys in your wallet to another program. See How can I export the private key for an address from the satoshi client?

  Also I had to replace my hard drive on my mac recently so I took both the Bitcoin app and the Library/Application Support/Bitcoin folder and put them on my new hard drive, are there any other files I would need to get access to my balance?

Is there a file inside there named 'wallet.dat'? If yes, then you have what you need to spend your Bitcoins. If no, then no.


How Bitcoin dose find and verify UTXO ? is this efficient?

How Bitcoin dose find and verify UTXO?

By Bitcoin, I think you must mean "Bitcoin core" - the Bitcoin wallet software derived from the original reference implementation by Satoshi Nakamoto. The word Bitcoin also encompasses the specific set of concepts outlined in the Bitcoin whitepaper, the network protocol definitions, the Bitcoin improvement proposals (BIPS), the worldwide network of Bitcoin nodes and Bitcoin users, etc.

How Bitcoin core manages UTXOs is probably best answered by inspecting the source code. I can however make some guesses, which even if wrong will show that the issue which concerns you is a non-issue.

Bitcoin core maintains several sets of data files. One of these is the wallet.dat file. Another set is the blockchain data itself, represented in a series of files. There may be other sets of data.

  I know that blockchain is never modified any previous block

Yes, but that does not mean that some Bitcoin software has to have a persistent storage format that exactly follows the over-the-network blockchain block layout. The software could store the data in a normalised SQL database and only reconstruct the blocks when it needs to re-verify the hashes, signatures etc - which would normally only be needed to be verified once when the block is first received. Such a data storage arrangement would allow lots of additional fields and associated tables to store extra information such as a flag showing whether a TXO had been subsequently spent (hence no longer a UTXO). Alternatively the Blockchain data could be stored in files exactly as received and ancilliary files used to store additional indexes of block-numbers and transaction-IDs associated with addresses of interest or a table of UTXOs that are added to and deleted from as blocks arrive and are verified and processed.

  it must check all the blocks to see whether TXO(reference to UTXO) is existed or not.

No, it only needs to check each block once. After that it can consult an efficient index into a separate small efficient table of current UTXOs which it maintains independently of the actual blockchain data.

  I have a good idea. that is we should mark something in the UTXO

Effectively this is already done. Except that most likely the mark is not made in a copy of the blockchain block structure but in separate data structures that Bitcoin core maintains for this purpose.

There is no need to alter the agreed Blockchain data structure that is used to transmit blocks between nodes.

It is not necessary for any node's software (wallet or not) to store Blockchain blocks at all, especially not SPV wallets. They are all free to choose any internal storage implementation and formats that their designers feel addresses their goals.

Nodes may need to be able to transmit to other nodes, requested blocks that they have previously received. But this could be achieved by reconstructing blocks from other, completely different and more comprehensive, storage formats.

  I would like to discuss about my point.

Please note that this is a Q&A website not a discussion forum. Try our chat room or some other website (e.g. reddit, facebook, twitter, etc)


The only difference between IPv4 and IPv6 from a privacy perspective is that IPv6 will allow an external observer to distinguish between two Bitcoin nodes operating on the same network. However, if they're different versions of Bitcoin, that's already possible.

There's a second angle, which is not really Bitcoin-specific. Most SOHO routers will not allow inbound IPv4 unless a device has specifically signaled using UPnP that the router should forward a port. However, they're typically set up to allow all inbound IPv6 traffic, which would allow your Bitcoin peers to port scan you in a way that wouldn't be possible with IPv4. You can test what they would discover using this tool, or nmap.


UTXO Model and Trans Fee / Kb Clarification

does my wallet remember that these 2 btc came from separate UTXO's? Or does it "get melted" as someone alluded to in my first link. More precisely, if I send these 2 btc to Gerald, will it show 1 input or 2?

(1) Your have a single 2 BTC UTXO, created by Alice's transaction. That transaction spent two UTXOs, but melded them into a single one. Your wallet doesn't care about its history - it has one UTXO, and when spending it, it needs a transaction with one input.
It is possible for wallet or other software to figure out the history of the coins, and figure out that it came from a transaction that spent two. But it has no impact on future transactions with it.

Does this mean she now has 3 inputs and 2 outputs contributing to the size of the transaction (and thus contributing to the size of the fee)

That's right. You'd create a transaction with 3 inputs (each 1 BTC) and 2 outputs (one of 2 BTC, one of 0.5 BTC). The difference is 0.5 BTC going to fees.

Do they typically do this in a most efficient way?

Often, no, actually. Because "most efficient" isn't the only criterion to optimize for. For example, you want to minimize the cost of transactions now, but you also don't want to bring your wallet in a state that increases the cost of transactions later. For example, some strategies for coin selection (as this problem is called) would result in continuously grinding down your coins into ever-smaller change in typical workloads, making it more and more expensive to send out future coins.
Some wallets will take current fee conditions into account to make these decisions.
Overall there is a significant amount of work analyzing various coin selection schemes. Some are featured in Mark Erhardt's master thesis.


how to get bitcoind to launch on startup/reboot? ubuntu 16.04

After putting the systemd file in /etc/systemd/system, make sure that your systemd file is set up to work with your installation (binary path, datadir path, etc. are correct). Then run sudo systemctl enable bitcoind.

Alternatively you can do edit your crontab with crontab -e and add the line

@reboot bitcoind


What is the price of an ask order bought if a bid order is placed at a higher price?

If you bid a higher price than a buy order, you will purchase that buy order at the ASK price, you won't pay more than they were asking for. Your order will fulfill all sell orders up to the amount and price you set your bid. This is known as a limit order.

If you requested to buy more coins than the $49 sell order, you would fulfill that order at $49 and then buy the rest at $50.

See also: How will Mt.Gox select matching orders if asking for a price that is higher than available prices


Transactions use at least one input and one output. The exception being the Coinbase transaction which creates new money and doesn't have an input.

While multiple public keys hash to the same address, there are still 2^160 distinct addresses possible. Therefore the chance that two people generate a private key that resolves to the same address is negligible.

You cannot stop anyone from sending you bitcoins. Receiving bitcoins is entirely passive. The only way to refuse a transaction is by returning it to the sender.


The average price is calculated by taking into account the current market conditions (i.e. other buyers/sellers) against the amount you wish to buy/sell. Given that the market is always changing, your actual average price may vary. When you finally place a market order, the system will execute against the best available prices at the time.

If you would like to have more control over the pricing and order execution, use limit orders. These may not execute immediately (depending on how you price them and their size) but you will be able to control those factors.


Bitcoins are stored in a decentralized ledger called the blockchain.  When your computer is shutdown the blockchain stores the balance in your associated public key also known as an address.  If you are using the reference client (Bitcoin-qt) you will be able to spend your Bitcoins once the computer is turned back on and the blockchain has downloaded all of the transactions that have occurred since it was turned off.   So while your PC is off yes you can still receive Bitcoins because the rest of the network has seen the transaction that is incoming to your address and they will continue to store that information indefinitely.


Is there a roadmap to lift the current limit of 220M transactions per year?

There is a distinction to be made between transactions (ie, transactions recorded on-chain) and payments (ie, a transferring of value between parties). Bitcoin can scale both by increasing the number of transactions per time, but also by increasing the number of payments per transaction.
The lightning network is a very interesting way of increasing the number of payments per transaction, the limit for number of payments is almost unbounded (there are channel liquidity considerations).
In any case, as a user what you should really care about is that you have some guarantee of ownership of your funds. You want control: to be able to spend those funds at your discretion, without any absolute dependance on or trust in a third party. Whether you get these guarantees through ownership of on-chain BTC, lightning-network BTC, or some other higher-layer solution is somewhat irrelevant  (though there are additional security considerations in using higher layer networks like lightning. This is unavoidable: you incur all of the considerations of the base layer, plus the considerations of the higher layer). There is no reason that users cannot be on-boarded straight to lightning network, without any need to ever move their funds off lightning. The infrastructure may not be there quite yet, but development is ongoing at a fast pace, I think it will be very interesting to watch how lightning grows over the next decade.
Additionally, I think it is important to understand that even if bitcoin cannot scale to allow every person on earth to make on-chain transactions each day (or month, or year), that does not mean it is a failure or not useful. It just limits the usefulness of on-chain transactions to be higher-value settlements, and the limit of scaling then starts to depend on how many payments per transaction we can build infrastructure to allow.


What happens to non-standard transactions in the case of a blockchain reorg?

Each of the blockchain forks assumes itself to be the only valid blockchain. They do not change their behavior due to a competing chain. They will require checks and confirm transactions completely independently from each other. It is likely that the same transactions are confirmed in both competing chains, just in different order and perhaps also at different heights. If a chain reorganization happens, and some transactions were not confirmed in the new best chain yet, they are still in the pool of unconfirmed transactions for that chain.

So, if you actually switch from [m4] to [new], and a transaction was not confirmed in the [new] chain that had been confirmed in the chain containing [m4], yes of course it would be in pool of unconfirmed transactions for that chain.

isStandard() is performed by every node when it learns about a transaction. Each miner decides whether to confirm transactions that don't pass isStandard() by themselves. It is irrelevant whether a competitor would include it or not for this process. If the forkchain is extended by a miner that doesn't confirm non-standard transactions, it will only be confirmed later when someone else chooses to do so.


This is extremely risky and not a good idea.

If you just increment one character, there are only about 50 ways to do that.  It would be extremely easy for an attacker to just try all 50 possibilities, and they would find your key and steal your coins.

Even if you change one character to a new random character, that's only 50 * 58 = 2900 possibilities.  Still very easy.  Particularly since the key has a built-in checksum, so that an attacker can tell with high probability whether their guess is correct with a simple computation.

The security of your private key rests in the fact that it is a random one of an extremely large number of candidates.  By revealing most of the key, you reduce that number of candidates to a very small number, and lose all your security.

Don't reveal any part of your private key, or save it where attackers could get it.  Also, don't try to "encrypt" it with any scheme you come up with by yourself (e.g. a substitution code) - those are also extremely easy to break for any reasonably clever attacker.


how do I create and encrypt a dogecoin wallet?


Would it be possible to provide a downloadable blockchain that is updated and verified by a mass of people?

There already are downloadable versions of the blockchain. There's no problem in principle in having them GPG-signed by several trusted people. However:

It somewhat weakens security. With the software itself you can trust the signatures and you can inspect the code. With blockchain data inspecting it is infeasible.
Future versions will use a different DB format which allows for much faster verification, so there will not be much advantage for a system where verification is obviated but downloading the data is still needed.
In the long-term, end users will not use a full client, but rather (at best) an SPV client which does not need to download or verify the entire blockchain.


How can you check the amount in your blockchain or bitcoin address online?

You can look up an address on a block explorer such as http://blockchain.info.  Just paste the address into the search box, and you will see a list of all transactions going in and out of that address, and its current balance.


The definition of a sidechain is more universally agreed than the definition of Layer 2. Some people might argue that sidechains are a subset of Layer 2 scaling solutions. Lightning Network is definitely a Layer 2 scaling solution.
Personally I would say the difference between a sidechain and Layer 2 is that Layer 2 scaling solutions such as Lightning are trust minimized protocols. They are designed such that trust in your channel counterparty (or anybody else on the network) is minimized.
Whereas sidechains (e.g. Blockstream's Liquid) do not seek to minimize trust, they instead make the design decision to lock funds up into a multisignature (in Liquid's case, a 11-of-15) onchain where the parties in that multisignature are trusted or relied upon to get the funds out of that sidechain. Sidechains make this choice because it provides greater efficiency (less reliance on timelocks), greater flexibility (you don't need to set most of the rules at inception), reduced fees (you don't need to pay routing fees like you do on the Lightning Network) and reduced capital constraints (you aren't constrained by the capacity of Lightning channels).


bitcoind getmininginfo says hashespersec is 0

The hashespersec field reports the speed of the built-in miner. It does not (and can't accurately) report the hashing power connected to it via the getwork or getblocktemplate interfaces.


Could Bitcoin dust spam be effectively combatted by actually including it in the block-chain?

why not do include such dust, so that spammers are harmed economically
  and stop doing it?

I'm still not sure that would be enough to prevent this kind of spam activity. Even if these transactions were committed to the blockchain, 100,000,000 such broadcasts could be made from 1 BTC, that's a lot of reach for $700.


In case of physical wallet theft, quickest way to offload funds in wallet backup?

You do not need to send coin to another wallet, but you surely need them to be sent to another address (since the compromised wallet has compromised addres). What I would is go to http://blockchain.info and open a new wallet. Copy paste the first address you see, it'll be your new secure address since you just genereted it. Then import your old compromised wallet.dat to blockchain.info and then send all your coins to the address you copied (in the bitcoin client it would show as sending to self). Then you are safe if the transaction confirm since you are the only one able to use this address. You can then send those bitcoin to a new wallet.


What is the Big-O complexity to retrieve the balance for a user?

It depends on what data structure you have put the UTXO set into. Different implementations do this in different ways, there is no one way to have the UTXO set.

For instance, one implementation may not maintain a UTXO set but rather iterates through the entire blockchain. This would be O(n) where n is the number of TXOs in the blockchain.

Other implementations may have the UTXO set in a list, so finding a balance would still be O(n) where n is the number of UTXOs because it has to iterate through the list.

An implementation could also make a map keyed on the scriptPubKey. The value would be a list of corresponding outputs (i.e. the amount and location). Then finding the balance of an address would be O(1+k) where k is the number of UTXOs for that address. This is significantly less than O(n) since looking up which UTXOs is O(1), but you still have to iterate through all of them.

So the time complexity of this really depends on the implementation, there is no one way to do it that all software use. In most implementations though, it is probably going to be O(n).


How would one monitor an address for a transaction and 1 confirmation in PHP?

Cron Jobs and 3rd Party API:

You could try with cron jobs, but I wouldn't run it every second, that's rather exhaustive. Maybe every 5 or 10 minutes, and then have it check the current total received vs the previous amount using a database.

$addy = "1somebitcoinaddress";
$bcinfo = json_decode(file_get_contents("https://blockchain.info/address/".$addy."?format=json"), true);
$balance = $bcinfo["total_received"];
$query = $db->prepare("SELECT previous_balance FROM address WHERE address = :addy");
$query->bindParam(':addy', $addy);
$query->execute();
$result = $query->fetch(PDO::FETCH_ASSOC);
$prevBal = $result["previous_balance"];
   if($balance > $prevBal){
   //balance changed, do something
   }

That way seems rather less than elegant though, and it's not instant.

3rd Party Webhook:

A better way would be with a webhook. Blocktrail offers a free webhook service, and you can even do it all in their UI after creating an account. Just sign up as a developer, then once logged in click on the webhooks tab and then create a new webhook that monitors your bitcoin address. It will ask for a callback url, that's where you provide a link to your PHP script to run.  When you provide the callback url I would add a secret to help prevent unauthorized calls like: yourdomain.com/callback.php?secret=12345

Your callback PHP script can look something like this:

$secret = "12345";
$verify = $_GET["secret"];
if($secret != $verify){
die();
}

$data = json_decode(file_get_contents("php://input"), true);

//get estimated value of transaction
$amount = $data["data"]["estimated_value"];
$confirm = $data["data"]["confirmations"];

if($confirm >= 1){
//do something, like send an email notification
$email = "your@email.com";
$sub = "New Transaction";
$body = "Amount: ".$amount;
mail($email, $sub, $body);
}

Bitcoind and Wallet Notify:

Lastly, there's run bitcoind and use walletnotify.

Make sure the address you are monitoring is imported into your bitcoind wallet. Set wallet notify up in your bitcoin.conf

walletnotify=curl https://yourwebsite.com/script.php?txid=%s

Now anytime there is activity on your bitcoind wallet your script will run, with the transaction id stored in a GET under ["txid"] and then you can do a script like:

require("easybitcoin.php");
$bitcoin = new Bitcoin("someusername", "somepassword");

$txid = $_GET["tx"];
$txinfo = $bitcoin->gettransaction($txid);
$details = count($txinfo["details"]);

for($i=0;$i<$details;$i++){
$check = $txinfo["details"][$i]["address"];
$addy = "1SomeAddressToMonitor";
    if($check == $addy){
    //activity on your address, do something
    }
}


How to create a sending address with Bitcoin Core?

You are not looking for a sending address but for a receiving address!

Coins always come from the address that you received them to, so one doesn't need special "sending addresses". Your purpose here is to enable the escrow to send you a refund in case something goes wrong with the purchase.

To find out your address, switch to the "Receive" tab:

The "Receive" tab will show you a list of all your addresses. The list will be empty at first, so you have to click "Request payment", which will open a new window showing your address:

You'll want to copy the alphanumeric string after "Address:" in the last line. To show the address again after closing the window, you can double-click the line in the list, or select it and click the "Show" button in the bottom left corner.


looking for faucet API so i could use it for tests - Automated faucet

Use regtest, the regression testing network, not testnet. Results using it are reliable and repeatable,  most importantly don’t rely on the will of others.


Coinbase transaction's 100-block cooldown period

how is the output of a coinbase transaction (plus block's transaction fees) different than the outputs of any other transaction?

Because it's validity is tied to WHICH block it is included in. You can't take a coinbase transaction and include it as if it were a standard transaction in another block, because it creates more bitcoins than it spends, which is not allowed for normal bitcoin transactions.

This issue is called being reorg-safe (reorganization-safe). It is a general principal of the blockchain, and it means that if a fork happens and you have to undo the latest block or two to replace them with different blocks, that shouldn't change which transactions are valid. With normal transactions, it's pretty easy to just add them to block X instead of block Y when a fork happens.

But if you have transactions that depend on a recent coinbase transaction, then you can't take those transactions and put them in another block easily. So the 100 block rule is to keep the blockchain reorg-safe, so nothing bad happens in the case of a small fork.


Why does a bigger block size infer miner centralisation?

Because a key aspect to understand is that transferring a block over the network globally is not completely instant. The bigger the block is, the longer the block propagation statistically takes.

However if you are propagating the block to part of the network that is close, like transferring the block to yourself (which of course means that you won't need to transfer the block at all), the latency disappears. If you find a valid block, this means that you have a slight mining advantage to mine with the new block as the last valid block, while other parts of the network is still mining on the old block as the last valid block, during the time the new block you just mined is propagated to the rest of the network. The larger the new block you just mined, the longer time you have to mine on the new block while other parts of the network are still mining on the old block as the last valid block.

In an industry where even the slightest percentage wise of advantage leads to being able to outcompete your opponents, longer block propagation times should theoretically mean to higher concentration of big parties on the network.


Any way that running a node could help speed up confirmations at exchanges

No. The Bitcoin protocol is written such that the target block generation time is 10 minutes. The actual block generation time varies depending on the difficulty and hash rate of the network, in addition to luck.

Also, there is no guarantee that your transaction will be included in the next mined block. If you set a high transaction fee, your transaction is more likely to appear in the next block. If you set a low transaction fee, your transaction is likely to sit around in the mempool for hours or even days.

Once your transaction has been included in a valid block, then the confirmations start adding up every time a new block is found. There's nothing you can personally do to speed that up, unless you buy like a billion dollars worth of mining equipment and put it all online at the same time...and even then the effect will probably be negligible.


python-bitcoinrpc: only DEBUG available?

Okay, there's a bug in the pip version of python-bitcoinrpc...

use pip install git+https://github.com/jgarzik/python-bitcoinrpc.git instead.


one-cpu one-vote is about Proof of Work. Except it really is not a vote and "votes" aren't being recorded as to which CPU they came from.

What it really means is that if you participate in mining (so you are performing Bitcoin's Proof of Work), you have the ability to decide which blockchain is "the blockchain" in the even that there are multiple valid blockchains. How this works is that a miner chooses a block to build their block on top of, and they dedicate their computing power to extend that blockchain. The blockchain that "wins the vote" is the blockchain that has the most cumulative Proof of Work, which is generally the one that the most miners have decided to mine on top of.

There is no way to "fool the network" because it isn't a vote. Nothing is broadcast to the network except complete and valid blocks.


What is the maximum size of a transaction?

The maximum transaction size is the size of the block. Source.

// Size limits (this doesn't take the witness into account, as that hasn't been checked for malleability)
if (::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION | SERIALIZE_TRANSACTION_NO_WITNESS) * WITNESS_SCALE_FACTOR > MAX_BLOCK_WEIGHT)
    return state.DoS(100, false, REJECT_INVALID, "bad-txns-oversize");

Transactions larger than 100 kilobytes (including witness at a 75% discount rate) are non-standard. Source 1. Source 2.

static const unsigned int MAX_STANDARD_TX_WEIGHT = 400000;
...
if (sz >= MAX_STANDARD_TX_WEIGHT)
{
    LogPrint(BCLog::MEMPOOL, "ignoring large orphan tx (size: %u, hash: %s)\n", sz, hash.ToString());
    return false;
}


If you were using an coin mixing service it would have sent your coins to many different places, to try to make it harder to trace.

Since the blockchain allows us to see where all coins go at any time, this is really the only way they can do it.

Without seeing the transaction (which defeats the point of you making it) I would say the system is working as intended.


How to get public key from a Electrum based wallet?

If you mean the extended public key aka master public key then you can get that via wallet menu > information. If you mean the address specific public key go to view menu > show address, switch to addresses tab, right click on the address in question and choose details to view the public key. You can also search the addresses on that tab by pressing ctrl+f.


How to handle an old, abandoned Litecoin withdrawal from btc-e.com

I sent a message to the support centre of the new exchange (WEX.nz).
I got this automated reply:
"Hello!
We informed in the news that we don't possess historical data on transaction and orders of the old platform, that's why we cannot approve or deny your words about funds deposit. The funds were credited to the new platform WEX.nz in the amount shown in your profile. During the period after BTCE closing and before WEX opening, all transactions were fulfilled out of control of the old platform as well out of control of the new one."

In my profile I got 0.00005462 Bitcoin and 0.00005462 Bitcoin Cash. Thats all.. It's worth about 1 USD.

How can I get those litecoins that still are on my address?

Thanks in advance


How to search (via json API) transactions to my wallet?

There is no "message" field in Bitcoin transactions, only the payment information is transferred on the network. While you can generate a label for a payment requests on your end, or include a label in the QR code for the benefit of the payer, neither would be transferred on the Bitcoin network. The proper way of distinguishing payments on Bitcoin is to give each payment a unique invoice address.
Instead of using plain Bitcoin Core, you may want to take a look at BTCPay Server, which is a self-hosted open-source payment processing solution that facilitates on-chain and Lightning Network payments. If you want to continue using Bitcoin Core, look into the listunspent call.
H/T to @Anonymous and @darosior, whose comments I've collected to write this answer.


Why does it take a different time to generate a different pattern of the same length in vanitygen?

Each leading 1 in an address after the first 1 represents a leading zero byte in the 160 bit hash of the public key, and so makes the search 256 times harder.  See the wiki page for Base58Check encoding for details.  Whereas any other character makes the search only around 56 times harder.

Every version 0 bitcoin address begins with a 1.  And 1 in 256 of them begin with two 1's.  However, I don't know where the 23 comes from.  Perhaps it's a result of Benford's law - we're changing to base 58, and so can expect more addresses to start with '12' than any other 2 characters.

To see this, suppose there were 256 addresses, from 0x00 to 0xFF, and that we converted them to base 10 to make addresses.  There are 256 different addresses, and 111 of the 256 begin with a '1' (1, 10, 11, ..., 19, 100, 101, ..., 199).  In bitcoin's base58 encoding, value 1 is encoded by character '2'.

Edit: the above is kind of convincing until you see that:

'12' through '16' all have difficulty 23,
'17' through '1P' have difficulty 22,
'1Q' has difficulty 65 and
'1R' through '1z' have difficulty 1353.


Known cases of miners withholding blocks when used as randomness?

You're probably better off going to some ethereum venue, as ethereum has been rife with broken schemes like this-- riggable "fair" lotteries and such.


Why are there so many recipients when I send money from one exchange to another?

When you bought bitcoins on Bybit, Bybit added the corresponding Bitcoin balance to your account. Your request to withdraw your funds to your Coinbase wallet caused Bybit, in the role of the custodian of your funds, to issue a payment that sent the funds to your wallet (and reduce your balance with Bybit accordingly).
Bitcoin transactions may perform multiple payments at once by assigning funds to multiple recipients in separate transaction outputs.
Presumably, Bybit is a large enough service that many other users requested withdrawals around the same time, and this allowed Bybit to batch together all those payments in a single transaction. As every transaction needs at least one transaction input, a transaction header, and usually a change output to assign the remaining funds back to the sender, payment batching is more blockspace efficient and allows the service to reduce their cost per withdrawal.