Recover old ufasoft coin wallet from a wallet.db file

For starters, if you don't trust a piece of software, don't give that software access to a wallet file.  That's just asking to be ripped off.

I am unfamiliar with "Ufasoft", but a quick web search makes it appear to be a small software company that at one point in time created a CPU/GPU bitcoin miner and wallet.  If that's the case, then you may need to reach out to that company for support.  The wallet file may not conform to the Bitcoin standard.  In fact, it looks like the wallet supported many coins, so it might be some hybrid multi-coin wallet format.

Best of luck.  When you use non-standard wallets, you'll end up not being able to ask the larger community for support.


Can I access a BCH wallet with a BTC seed phrase?

If the seed phrase was generated by a BTC BIP-0039 compliant wallet and you have a BIP-0039 compliant BCH wallet then the answer is yes you should be able to get hold of your BCH funds.

It should be easy to try. Get a BCH wallet and enter your seed phrase and see if your coins appear.


Web Wallet Creation with PHP and bitcoind

I would look into using sxtools/libbitcoin or maybe just the blockchain.info API. You can make private keys using a vanitygen if you want to make addresses without using bitcoind and perhaps (if you are skilled enough) create raw transactions and push them straight to blockchain or chain sites or even a public bitcoind.


Can the blockchain be included in future packages of the standard client?

You can download the transaction history separately (don't have the link on me currently). Adding it to the client would also be disencouraging - 1GB of a "program" doesn't appear too user-friendly.

Alternatively, one can use a lightweight client (like Multibit or Electrum), or an eWallet (like StrongCoin).


If you recover your wallet.dat file, you can import it into a working bitcoin node and sweep the wallet. You must have access to the hard drive of the broken computer.

Your wallet.dat file can be located at:
Linux ~/.bitcoin/
Mac ~/Library/Application Support/Bitcoin/
Windows%APPDATA%\Bitcoin

You can also import the .dat file into blockchain.com which naturally I do not recommend since it defeats the purpose of decentralization.


If you withdrew the BTC then you must have had a wallet somewhere to withdraw to. A wallet software could have been installed on your PC or, could be with a web wallet provider or, the balance could still be with your slots.

If you have no information about your wallet (check old emails for account information from a web wallet provider), cannot remember any details and, cannot find any evidence of any Bitcoin wallet on your PC (there are may but, they all make a data folder somewhere..) then, unfortunately, your BTC is lost.


OK, the three figures you care about here are:

"msatoshi_total": 1600000,
"msatoshi_to_us": 1599884,
"their_channel_reserve_satoshis": 546,

They have 1600000 - 1599884 millisatoshis, ie 116.  But they need to keep at least 546 satoshis reserve, ie. 546,000.  Until they do, we won't let them spend any.

Hence the warning when you created an invoice: there's no way someone can pay it with the current channel configuration!


aftet sending btc with bitcoin core can i exit after wards?

Once successfully broadcast, your transaction will be entered into the mempools of other nodes on the network, and it will eventually be confirmed in a block when it's fee-rate becomes competitive. This will occur whether or not you keep your wallet/node online in the meantime. So once your transaction is broadcast to the network you can exit the program without any issue.


How many combinations are there from the BIP32 mnemonic list?

BIP 32 is not a mnemonic specification, so it has 0 possible combinations.

I assume you are talking about BIP 39. In that case there are are 2048^12 combinations for 12 word mnemonics, 2048^18 for 18 word mnemonics, and 2048^24 for 24 word mnemonics. However BIP 39 currently supports 8 languages, so there are (2048^12 + 2048^18 + 2048^24)*8 possible combinations.

The checksum doesn't matter because BIP 39 does not specify that the checksum must be enforced. The checksum can be invalid, and all that BIP 39 compliant software should do is show a warning.


This happens when bitcoind has processed a large amount of blocks in its dbcache but has not written them to disk before the process is exited.

See here for more details.


There will be 32 halvings, but the block subsidy will be reduced 33 times with the last reduction not halving it, but reducing it from 1 sat per block to 0 sats per block (see table with calculation). So there will actually be 33 eras with a block subsidy, which would mean that per your calculation the last new bitcoins would be created in 2141.
However, the first halving occurred in 2012, so that's how you get to 2140 if you assume 4 years per era. Actually, the average time per block since the Genesis block has been about 9.5 minutes (4,431 days for 671,456 blocks). In 2020, the average block interval was about 9.9 minutes. Assuming that an interval of 9.9 minutes would be maintained, the last block with a block subsidy would be found in December 2138.


NXT single address per user vs bitcoin single address per transaction

It's not hard to use Bitcoin approach in client software. NRS (Nxt Reference Software) doesn't support this because anonymity is not ensured this way, it only creates a delusion of anonymity (http://people.csail.mit.edu/spillai/data/papers/bitcoin-transaction-graph-analysis.pdf). CoinShuffle (http://crypsys.mmci.uni-saarland.de/projects/CoinShuffle/coinshuffle.pdf) will be added to Nxt soon to provide a better protection against deanonymization.


Bitcoind in test network doesn't display transactions

Sounds like you did not give bitcoind time to "sync", no other explanation comes to mind. Starting bitcoin-qt may be more obvious.


Privacy. How to prevent transaction recipient tracing prior transactions of mine

You might want to consider finding a reliable Bitcoin Tumbler (Bitcoin Mixer).

But be aware that you are placing trust in a third party, especially for custodial mixers. Some people have lost money to fraudulent mixers. I would do my research into a company very carefully before risking using them.

Some wallets have mixing capabilities built in to them. These may be a better option.

One example of an article on the subject is How to Mix Your Bitcoins Using Coinjoin for Greater Privacy -- but I can't vouch for the correctness of this article. I suggest taking the time to do your own research.


Can I prove a double spend attempt with a signed tx with same input?

No Atomic Swaps are by definition atomic meaning either there's a swap and both parties redeem the coins or no . I suggest you take a look at the Decred repository to understand the mechanics of the swap .


I can recommend the Qt Creator IDE or Xcode on OSX. The later has (since Xcode 8) problems auto-completing C++.

If you use Qt Creators IDE, you can also debug the Qt objects natively.

In Qt Creator, do the following:

Install all dependencies
git checkout https://github.com/bitcoin/bitcoin
./autogen.sh
./configure --enable-debug (maybe more)
Then, create new project in Qt-Creator "import project from existing
source".
Go to project settings / run, select src/qt/bitcoin-qt (or src/bitcoin) as executable
Happy debugging / coding.


How does the Bitcoin network deal with bad actors?

Assuming there is a miner that will put invalid transactions into a block:

First, this miner has to find a very high-difficulty hash to make the block valid.
That alone is extremely improbable, as it is trying to find a hash faster than hundreds of thousands of honest miners.  The honest miners will probably find a correct hash to a valid, honest block, much much faster than the dishonest miner can complete his corrupt block.

Secondly, if the miner can find a hash, and successfully publish this corrupted/invalid block, any node that receives this invalid block will examine the data and recognize it as invalid.  When they see an invalid block, they will refuse to add it to their block chain, refuse to share it with other nodes, and probably blacklist the node that sent it to them.

The corrupt miner will have spent a lot of time and effort finding a hash, only to find itself quickly blacklisted and ignored.


Can someone explain in detail how p2pool payout works?

Are you sure the link you gave is for a P2Pool block? I just found this resource which lists the blocks solved by the P2Pool. This was the top block listed, and it has many outputs in the generation transaction, paying to each of the miners in a pool who contributed to the share chain within the last N blocks (N is some pool-specific number).

  1) How does the system enforce these payouts?

As far as I understand it, blocks on the share chain are only accepted by the other members of the P2Pool if they have appropriate payouts. So, while you could make a block that pays all to you, you wouldn't get that block accepted on the share chain, and you wouldn't get credit for your work. To have the appropriate payouts, the block must split up the reward to each of the solvers of the last N blocks. If a miner has multiple shares in the share chain within the last N blocks, their payouts can be grouped into one transaction output.

  2) How does the system get it's initial seed money for the first payouts?

P2Pool works with PPLNS (Pay per last N shares), which is pool hopping resistant. P2Pool also doesn't give any payouts until someone in the pool solves a block. Essentially, all pool payouts are awarded in an actual bitcoin block, so there's no need to have a fund to distribute rewards set up ahead of time.


The minority of miners that do not support BIP91 (and by extension BIP141), could start rejecting blocks of those who are signaling BIP141, thereby creating a different chain.
  Is that a possibility both in theory and in practice?

Yes that is possible, but unlikely. Since BIP 91 has a majority of the hashrate, I think it is unlikely that there will be a persistent chain fork. Rather what is more likely to happen is that there are short multi-block forks that are then orphaned and reorged out as the majority hash rate chain becomes longer than those forks.


Alternative uses for last five decimal places of an individual Bitcoin (0.000xxxxx)

One idea that comes to mind is to use them as a transaction ID to bind the sender to the recipient instead of generating a unique Bitcoin address per sender.  If done carefully, this may allow more versatile use of vanity addresses.

Since the address space of the transactions is relatively small (only 5 digits to play with), one idea is to use a random 4 digit suffix that is valid for a short period of time.  Use the final / Fifth bit as a checksum that can also be ommitted if the conversion rate BTC to USD exceeds $100 but is below $999

Example

An item costs 10 BTC, and the buyer clicks "check out"
The seller creates a new transaction ID (9998) records it, and makes it expire in 1 day.
The seller calculates the checksum.  Since the sum of 9+9+9+8 is 35, an odd number, the checksum is set to "1".  (if it had been even the checksum would be "0")
On checkout the seller pays 10.00019998 BTC to the seller, possibly to a vanity address
The payment is received by the seller and visible in the transaction history.
The seller does checksum of the transaction (9998) with the checksum bit (1) and passes
The result is even so the transaction is valid (less likely a typo was made)
The seller looks up transaction ID 9998 in the database.  If the Tx is invalid, or the date is greater than 24 hours, then a refund is sent to the seller.


Have a look at libbtc (https://github.com/libbtc/libbtc).

There is a function btc_script_classify() which will return what script type it is (P2PK, P2PKH, P2SH, P2WPKH, P2WSH) and it will return data elements (usually the RIPEMD160 of the pubkey).


How do I use Stellar API to power my Universal Trading and Multicurrency Payment+Transacton Gateway?

I'd start by reading the concepts here so you know what stellar will do for you vs what you have to do on your own: https://www.stellar.org/developers/learn/
It also has the API documentation.


Correction: I had thought that Bitcoin Core implements BIP44, which it does not. Thus, what I previously wrote about the gap-limit was wrong.

To restore your wallet-backup you place the wallet.dat into the Bitcoin Core data directory as Pieter described.

When Bitcoin Core is started, it will load the wallet.dat. The wallet.dat includes the information up to what blockchain height it was used last. So, Bitcoin Core will now from what blockchain height to search for additional transactions.

Hereby, Bitcoin Core will generate a key pool of, by default 100, unused addresses that it also checks for. Whenever it discovers a transaction corresponding to any of its addresses, it will generate more addresses from the deterministic chain to fill the key pool back up.

To recover addresses beyond the key pool, you can just request new addresses in Bitcoin Core until you have found all your funds. This type of initial backup doesn't allow you to recover meta-data such as notes about the transactions' origins or recipients as they are only stored in the wallet.dat and cannot be recovered from the preceding backup.


Is the 21 Bitcoin computer using Core or Classic?

I assumed so myself since the alternatives were not in a mature stage (technically and/or socially accepted) when 21 released their computer.

However, in their tutorial they do say that you will have a Bitcoin Core full node running at the end.


Does restoring wallet.dat require the same paths and configs in servers?

A wallet.dat file contains no information specific to a particular install of Bitcoin Core, or its configured data and wallet directories.

You can freely copy just the wallet file to another instance, without having to copy the block data or other information such as peers, mempool, etc.


signmessage and verifymessage CLI commands not accepting Address from getnewaddress?

signmessage and verifymessage only work with legacy type addresses. They do not work with segwit addresses. There is ongoing work to introduce a new message signing standard that will work regardless of address type.
Some discussion about why they only work on legacy addresses can be found in this issue: https://github.com/bitcoin/bitcoin/issues/10542


Is it possible to change an output of a partially signed transaction?

In one word: no. Changing tx output after signing makes existing signature invalid.

( There are some special cases, like signature hash type SIGHASH_SINGLE or SIGHASH_NONE, but we assume that the buyer uses correct signing SIGHASH_ALL )


It's not about the type of address but wallet. Some will show unconfirmed balances/transactions, others won't.


What are the minimal system requirements to run a full Bitcoin node?

Just some thoughts:

As of the time of writing the main net's full blockchain size is 21,670,092,800 bytes, a bit more than 20 GB, that is. So you should have way more disk space that just 20-30 GB.
A Raspberry Pi runs with an SD. SD is known for its limited rewriting capabilities (it's not a heavy duty storage solution, it will bite the dust after a while) and on top of that there's also the very important factor of the data transfer rate. SD's top model type (Class U3) maxs at 30 MB/s while a typical SATA-3 disk will max at 750 MB/s, which BTW can go as high as 2 GB/s with a SATA Express attached to a twin PCI Express 3.2 lane, but I guess this is not a low-spec computer any more. And yes, I know, you can mount an external USB HD to a R-Pi but even in this case you'll never get these speeds.
Some of the top single board computers could perform well, and I think this is the best solution for a low power-consumption full node. For example if you attach a SATA hard drive to IGEPv5 Full Version you will most probably get quite good performance at a very low cost, both of acquisition but operational as well.
A low-spec computer could deliver great results with some lightweight linux distributions, my personal favorite is Lubuntu that comes with an LX11DE UI and then bitcoin's installation would be as easy as:

Menu > Accessories > LXTerminal > $

sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install bitcoind

Edit 1: Pictures speak louder than words (as a response to Jannes's comment, so I'm attaching a few performance screenshots from a full node running in Windows that just received a new block and a couple of minutes after that, as well as an analysis of the I/O index:

Verifying incoming block:

One of the I/O spikes of the block verification at level 3 (default for all clients):

I/O analysis for the above graphs:


How to move Bitcoins from desktop wallet to mobile wallet?

If you want to move Bitcoins in the sense of a wallet command it would require some more technical integration.

However, the easiest thing is to scan the QR-code of your Android mobile wallet with your webcam. I use QuickMark for the scanning. Then you can simply copy paste the Bitcoin address to your desktop wallet and send Bitcoins to your phone via the network.


Why is it important for individuals to be able to run their own nodes?

Every time you check your wallet, your wallet is displaying information that it fetched from a bitcoin node (usually with other software running on top of it, like ElectrumX). If you absolutely trust the server behind your wallet, then as an end-user, it's not necessary to run your node. However, you might still want to run it, because you care about bitcoin and want to help new users/companies download the blockchain, make the network more resistant to DDoS attacks or, if you live in an authoritarian nation like North Korea, you might want to make it harder for the government to censor bitcoin.

Running a node is especially important if you run a bitcoin-related company. In this situation, you shouldn't be relying on an external service as you don't know if it will be down, hacked or have bad intentions.

Also, if you receive a large payment in bitcoin, you want to make sure you received it. You can check seven different bitcoin explorers but, depending on your level of paranoia, you might want to check your own node and verify that it has at least two to six confirmations.

Check out Andreas's video about this.


What does the segwit upgrade path look like?

Wallets and merchants should first upgrade to support receiving and spending from segwit outputs. The software should be capable of recognizing segwit outputs that belong to its wallet and be able to spend from them.

Then wallets and merchants should then upgrade to giving out P2SH nested segwit addresses as those do not require users to have upgraded to new wallet versions. Wallets and merchants should also provide an option to give out bech32 addresses if the user wants to use those but also warns them that not all wallets will be able to send to those addresses.

Over time, as more wallets support bech32, wallets and merchants should transition to give out bech32 addresses by default. The timeframe of when to do this is unknown as it is hard to know when all wallets support bech32.


What is the store that sells the famous alpaca socks for Bitcoin?

That would be Grass Hill Alpacas at http://www.grasshillalpacas.com/
From their website:

Grass Hill Alpacas is located on 115 acres that has been in the family for over 125 years. The farm is located at the foot of Grass Hill in the Haydenville section of the town of Williamsburg, just 10 minutes from the center of Northampton. The last time the land was actively farmed was in the 70's, when the last of Stanley "Stubby" Nash’s oxen were sold. Currently our operations are based on 5 acres of old pasture land that we have reclaimed and fenced in. With more than 40 acres of fields, we have plenty of room for expansion as needed.
We brought our first 6 alpacas onto the farm in the summer of 2006. It has been an exciting, rewarding time for our family and our farm. We have learned alot, had some great experiences and built wonderful new friendships that will last a lifetime. But the best part of it all is that we did it together as a family...side-by-side... working the same land that great-great-grampie worked.

Also, don't forget this song about the famous alpaca socks:
Max Min - Alpaca Socks (Official Music Video)


Can a cryptocurrency be liquid while it is in its pre-sale, or even ICO

It could, but liquidity during ICO (meaning you can buy and sell tokens before ICO ends) could lead to many economical problems. For instance, if people could buy your token on exchange - they will not buy it on ICO, so you will not get  funds you need for the project.


Why is 20 the maximum public keys in a multisig transaction?

The number 20 seems to originate from this commit : 8c9479c6bbbc38b897dc97de9d04e4d5a5a36730, also tagged as v0.3.12, which introduced the term 'SigOps".  Sadly, I don't see any mention of this change in the commit message itself, or in this version's release note, and there isn't any documentation.

We see that both a limit for a maximum number of sigops in a block was set :

static const int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;

and a way of counting them :

int GetSigOpCount() const
{
    int n = 0;
    const_iterator pc = begin();
    while (pc < end())
    {
        opcodetype opcode;
        if (!GetOp(pc, opcode))
            break;
        if (opcode == OP_CHECKSIG || opcode == OP_CHECKSIGVERIFY)
            n++;
        else if (opcode == OP_CHECKMULTISIG || opcode == OP_CHECKMULTISIGVERIFY)
            n += 20;
    }
    return n;
}

And the rules are still the same, specifically for bare multisig scripts (those not nested in p2sh or p2wsh).  A bare CHECKMULTISIG operation is always counted as 20 sigops (today 80, with witness scale factor), so allowing anything more than 20 checksigs in CHECKMULTISIG will invalidate this assumption and will make it so creating blocks with more then maximum allowed sigops possible.

The rules are less strict for p2sh\p2wsh scripts.  If the opcode just before CHECKMULTISIG is in the range [OP_1, OP_16], then that number is counted as the sigops for the multisig verification, with anything else counted as 20.  In practice, 15 is the maximum of pubkeys you can push as a p2sh script because of the 520 bytes push limit, but for p2wsh, an example of 17-of-20 would look like :

0x01 0x11 <pubkey1> <pubkey2> ... <pubkey 20> 0x01 0x14 CHECKMULTISIG


Is there a remote Bitcoin API that doesn't require anything to be stored locally?

This question is a little old now. But you could use the blockchain.info JSON RPC api. It is designed to be compatible with the original Bitcoind implementation and most functions can operate without private keys.

http://blockchain.info/json_rpc_api


View backed up wallet.dat using sqlite browser

db_dump
You can use db_dump from the Berkeley db-utils package.
I've used that under Windows-10 by using WSL (Ubuntu) - It can definitely dump an unencrypted Bitcoin wallet.dat file.
The Berkeley DB libraries used by Bitcoin core for the wallet.dat are a key-value store - and the keys used appear to be words like "key" and "keymeta".
As far as I know, the structure (if not simple data types) of the key and value are not known to the DB libraries. I believe applications such as Bitcoin core will often be storing blobs whose contents cannot be dissected by general tools which lack knowledge of the applications' schema.  The same observations are likely to apply to sqlite browser
However db_dump output is a worthwhile step up from a hex dump! The -p or -da options may be useful.

SQLite
https://github.com/bitcoin/bitcoin/pull/19077 says

This PR adds a new class SQLiteDatabase which is a subclass of WalletDatabase. This provides access to a SQLite database that is used to store the wallet records. To keep compatibility with BDB and to complexity of the change down, we don't make use of many SQLite's features. We use it strictly as a key-value store. We create a table main which has two columns, key and value both with the type blob.

...

We keep the name wallet.dat for SQLite wallets. We are able to determine which database type to use by searching for specific magic bytes in the wallet.dat file. SQLite begins it's files with a null terminated string SQLite format 3. BDB has 0x00053162 at byte 12 (note that the byte order of this integer depends on the system endianness). So when we see that there is a wallet.dat file that we want to open, we check for the magic bytes to determine which database system to use.

I'm using current Bitcoin core 0.21.0, but the wallet I examined was first generated in 2018 and has the Berkeley DB (BDB) signature. Bitcoin core has not rewritten the file in a newer/different format.
https://github.com/bitcoin/bitcoin/issues/20160 provides a timeline for the phasing out of Berkely DB (which obviously affects the contents of this answer)

Wallet.dat
My brief examination of a wallet.dat backup using a hex-dump suggested that the wallet mostly contains private keys, addresses generated and some sparse metadata about each.
See also

dumpwallet output documentation & explanation? (2021 and relevant)
What do the different .dat files contain? (2011, ∴ limited usefulness)
File format -- rev*.dat (2017, interesting but different file)
What is the database for? (2013, ∴ limited usefulness)
UXTO DB structure (2017, not relevant but interesting documentation)

wallet.dat contains your private keys, your address book, a copy of the transactions that send coins from or to one of your addresses, accounts, reserve keys, personal settings, and a pointer to the current best block.

(Note: Bitcoin core's "accounts" feature was deprecated some years ago)


Can you break down what data is encoded into a bech32 address?

bech32 addresses are defined in BIP 173. A list of address prefixes on the Bitcoin wiki is here.
This slide is taken from Pieter Wuille's presentation on bech32 at SF Bitcoin Devs in March 2017.

bc is representing Bitcoin (mainnet) and is human readable.

Testnet bech32 addresses start tb

Signet (both default Signet and custom Signets) bech32 addresses also start tb (although an earlier iteration of Signet used sb).

Regtest bech32 addresses start with bcrt. This is defined in chainparams.cpp here.

1 is just a separator and doesn't represent any particular data

q is the witness version. This represents zero as the first SegWit witness version introduced was SegWit v0. Taproot introduces SegWit v1.

w508d6qejxtdg4y5r3zarvary0c5xw7k is the hash of the witness program.

v8f3t4 is the checksum

As the slide says, mainnet P2WPKH addresses are 42 characters and mainnet P2WSH addressses are 62 characters under SegWit v0. Future witness versions can be up to 74 characters although SegWit v1 addresses (Taproot) will be the same length as v0 P2WSH addresses (62 characters). Witness programs as defined under SegWit v1 are 32 bytes.
There is a bech32 demo decoder site here.


How does one create a brain wallet from a seed using SHA256?

A bitcoin generator can generate an address.

i.e. https://brainwalletx.github.io/


As you correctly identified, there are two types of seed nodes, i.e. DNS seeds and seed nodes. DNS seeds are stored in chainparams.cpp. As of today (April 2017) the following nodes are listed in this file.

seed.bitcoin.sipa.be
dnsseed.bluematt.me
dnsseed.bitcoin.dashjr.org
seed.bitcoinstats.com
seed.bitcoin.jonasschnelli.ch
seed.btc.petertodd.org

I performed nslookups on these DNS names and they return a list of IP (14-26) addresses that all seemed to be running bitcoin nodes.
There is also the concept of seed nodes which are hardcoded IP addresses in the event that someone is experiencing a DNS failure or other issue.  These nodes are only contacted if no other discovery mechanism works.


Visa, MasterCard or any other network copy Bitcoin blockchain tech?

It would make no sense for Visa to copy Bitcoin.
Visa is a company built around control of a payment network. Visa's system only works because they control access and payment verification, which is what makes them money.
In Bitcoin, no single entity is in sole control. There is no way to make money off of the transactions on the network except to put in the validation work and reap the mining reward. By copying Bitcoin they'd destroy their own business strategies.

What they could do is to bastardize the Bitcoin system into a centrally controlled "Private Blockchain". However, if you're not trying to achieve decentralized control, there is little other incentive to use a blockchain in the first place. They could create a much more efficient system with themselves in control, as blockchains are inherently inefficient – it's the price for being decentralized.


IsCanonicalPubKey method in Bitcoin Core source

bool IsCanonicalPubKey(const valtype &vchPubKey) {
    if (vchPubKey.size() < 33)
        return error("Non-canonical public key: too short");
    if (vchPubKey[0] == 0x04) {
        if (vchPubKey.size() != 65)
            return error("Non-canonical public key: invalid length for uncompressed key");
    } else if (vchPubKey[0] == 0x02 || vchPubKey[0] == 0x03) {
        if (vchPubKey.size() != 33)
            return error("Non-canonical public key: invalid length for compressed key");
    } else {
        return error("Non-canonical public key: compressed nor uncompressed");
    }
    return true;
}

1) Public keys must be either 65 or 33 bytes long.
2a) 65 byte long public keys must start with one byte prefix 0x04
2b) 33 byte long public keys must start with one byte prefix 0x02 or
0x03
3) Any other byte sequences can not be treated as public key


Backing up wallet with pen and paper, destroying electronic copy, restoring from keyboard -- how?

The Satoshi bitcoin client has a dumpprivkey command available in the console, which outputs an encoded string of about 50-60 alphanumeric characters.  That should be pretty easy to write down, and it can be reimported with the importprivkey command.

But if you're really paranoid, why ever have your private key on a computer at all?  Flip a coin a bunch of times to generate some random bits, and then run the ECDSA keypair generation routine with a paper and pencil!  Hash the public key (you can use a computer for that part) to get your address, and transfer all your bitcoins to that address.  If you want to spend them someday, run ECDSA's signing algorithm by hand to make a raw transaction, key it in, and put it on the network.

Of course, stealing the piece of paper where you wrote down the key is probably a lot easier than decrypting an electronic copy.  It seems to me your trust is a little misplaced.


Closed wallet in MultiBit, is it gone for good?

The user crowther had his wallet stored in:

C:/Documents and Settings/"user name"/AppData/Roaming/MultiBit


Its late answer but anyhow.

Definitely you don't need to have wallet linked to and funding source.
Actually opposite : your wallet must be independent from any financial entities and trusting only blockchain.

Yes your Electrum wallet will receive crypto currency. But why ask? Just send small amount for test!

My favorite wallet for bitcoin is Eclair Mobile just in case u need one.


Block 566687 nonce with extranonce, how to interpret?

I can't find any code examples to try and find the nonce for a block using the extra nonce, rather than the usual examples that go to a maximum 32-bit unsigned integer as the nonce.

The nonce for the block remains unchanged. Since the extra nonce is part of the coinbase transaction, it modifies the merkle root, which is part of the block header. Thus, for each extra nonce, you get a unique merkle root, which then allows you to try the full range of regular nonces with that merkle root.

You do not need to concatenate or otherwise mix the two nonces in any form - the extra nonce's purpose is simply to alter the merkle root.

To validate a block with an extra nonce, you don't need to do anything special. Just build the transaction merkle tree, verify the merkle root matches the root in the block header, then hash the header and check it agains the target. It's the same process for blocks with and without the extra nonce.


Apple does not allow Bitcoin wallet applications on its devices.


How to run Bitcoin Core as onion service on Windows, Ubuntu and Android?

Windows
You can follow one of the steps from 2 and 3. Step 2 uses cookie for authentication and Step 3 uses password.

Download and Install Bitcoin Core from https://bitcoincore.org/bin/bitcoin-core-0.20.1/bitcoin-0.20.1-win64-setup.exe

Edit the bitcoin.conf file, enter the below things and save it. Default location of the file is %UserProfile%\AppData\Roaming\Bitcoin\bitcoin.conf

listen=1

debug=1

logips=1

testnet=1

listenonion=1

onlynet=onion

proxy=127.0.0.1:9150

torcontrol=127.0.0.1:9151

How to setup cookie auth for Tor control?

Open C:\Users\Prayank\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc and add below line:
HCookieAuthentication 1

IGNORE THIS STEP IF YOU ALREADY DID STEP 2. Edit the bitcoin.conf file, enter the below things and save it. Default location of the file is %UserProfile%\AppData\Roaming\Bitcoin\bitcoin.conf

listen=1

debug=1

logips=1

testnet=1

listenonion=1

onlynet=onion

proxy=127.0.0.1:9150

torcontrol=127.0.0.1:9151

torpassword=XYZ
XYZ: Replace it with your password in plain text

How to setup password for Tor control?

Open command prompt/PowerShell and run the below commands:
cd "C:\Users\Prayank\Desktop\Tor Browser\Browser\TorBrowser\Tor"
tor --hash-password "XYZ" >torhash.txt
Open torhash.txt file, copy the last line which has below content, paste in C:\Users\Prayank\Desktop\Tor Browser\Browser\TorBrowser\Data\Tor\torrc and save it:
HashedControlPassword 16:1CEDITEDOMERANDOMSHITCF8EBCD9A50CLOLCDACF
Run the below commands in command prompt or PowerShell to ensure connection with Tor control works:
telnet 127.0.0.1 9151
AUTHENTICATE "XYZ"

Launch Tor Browser

Launch Bitcoin Core Wallet (Testnet) using the shortcut with a green icon or run "C:\Program Files\Bitcoin\bitcoin-qt.exe" -testnet in command prompt or PowerShell and change the path accordingly

Run getnetworkinfo in console window and check the localaddresses. Check if testnet3/onion_private_key file is created and analyze the logs in debug.log file.

Ubuntu
You can follow one of the steps from 2 and 3. Step 2 uses cookie for authentication and Step 3 uses password.

Download Bitcoin Core and run the below commands:

tar xzf bitcoin-0.20.0-x86_64-linux-gnu.tar.gz
sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-0.20.0/bin/*
/usr/local/bin/bitcoin-qt

Edit the .bitcoin/bitcoin.conf file, enter the below things and save it.

listen=1

debug=1

logips=1

testnet=1

listenonion=1

onlynet=onion

proxy=127.0.0.1:9050

How to setup Tor?

sudo apt install tor
Open /etc/tor/torrc and add below lines:
ControlPort 9051
CookieAuthentication 1
CookieAuthFileGroupReadable 1
Restarts Tor: sudo /etc/init.d/tor restart
Add user to Tor group: sudo usermod -a -G debian-tor <username>
Run Bitcoin Core: /usr/local/bin/bitcoin-qt

IGNORE THIS STEP IF YOU ALREADY DID STEP 2. Edit the bitcoin.conf file, enter the below things and save it.

listen=1

debug=1

logips=1

testnet=1

listenonion=1

onlynet=onion

proxy=127.0.0.1:9150

torpassword=XYZ
XYZ: Replace it with your password in plain text

How to setup password for Tor control?

Open command terminal and run the below commands:
torpass=$(tor --hash-password "my-tor-password")
printf "HashedControlPassword $torpass\nControlPort 9051\n" | sudo tee -a /etc/tor/torrc

Run getnetworkinfo in console window and check the localaddresses. Check if testnet3/onion_private_key file is created and analyze the logs in debug.log file.

Android
Download, Install and Run either ABCore or Nayuta Core.

I have selected Bitcoin Knots in the settings of ABCore however there is an option to use Bitcoin Core as well.


Is it possible to check if an Address was generated from an HD Public Key.

No, it is impossible to know. You would have to check every possibility.


How do I run the bitcoin bx tool in my terminal

bx is found here: libbitcoin-explorer. There are copious notes there about how to install.

Can I also recommend noting btcdeb for assisting in debugging bitcoin script, should you get that deep.


bitcoin mssql decimal/money storage size

You need at least DECIMAL(16,8) to store any valid Bitcoin amount (i.e. up to just over 20 Million Bitcoin, requiring 8 digits to the left of the decimal point) precisely (i.e. down to a single Satoshi, requiring 8 digits to the right of the decimal point).

Depening on your application and how you (or your collaborators) think of Bitcoin amounts, it may be preferable to process them in Satoshi, enabling you to treat them as integers (BIGINT would then be the SQL datatype). Of course, then you have traded the dangers around non-integer handling for those associated with large integer handling.


Validate a payment using bitcoind and json rpc

I would start by looking at the mempool. See getrawmempool, getrawtransaction, decoderawtransaction api calls.  Once you see the transaction your looking for in the mempool you could consider that status #1

Once this transaction is confirmed in a block it will show up as part of the getbalance for that account and other RPC calls like listunspent etc..  You could consider that status #2

Then it's up to you how many confirmations you want for the payment to be considered confirmed.


Bitcoin & Bitcoin-cash in Ubuntu same server : Use same Block Data for both

So do I require to download all blocks of bitcoin-cash node?
Yes. Bitcoin and Bitcoin Cash share a history, but only up to the fork.
Possibly you might be able to make yourself a bootstrap.dat up to the fork for Bitcoin Cash to load, depending on exactly what software you are running for each. There are accurate and working instructions for creating bootstrap.dat linked in another recent question here.


How can I know *exactly* when my name_new domain is ready for the name_firstupdate step?

It seems you can issue your name_firstupdate transaction whenever you're ready (in particular, right after doing the name_new).  It won't be included in a block until the name_new is mature (12 confirms) but should be picked up shortly after that happens.

I don't have any source for this other than recent experience, but my names are showing up when I do name_list so I take it that they are properly registered.

EDIT: I thought about it a little, and I suppose you should wait a little bit (at least until your name_new is included in a block).  The reason being that nobody can know what name you're trying to register until you do name_firstupdate, and so they can't steal it from you.  Sending both the name_new and the name_firstupdate is vulnerable because someone can quickly issue their own name_new for the same name, and depending on luck (or in the worst-case, their control of a significant hashrate) claim it before you can.

Someone more familiar with the intimate details of how requests for the same name are resolved can comment on whether this scenario is possible or not.


Do BitCoin wallets generated by websites have validity?

You can save the bitaddress.org site and load it offline and it will still work.

You can also use VanityGen to generate "vanity" addresses.


export Bitcoin Cash private key from Bitcoin QT after send out BTC to exchange

First of all, there is no "private key at the time". Your wallet does not have one private key which it changes for each transaction or on a time basis. Rather your wallet contains multiple private keys, one for each address you use. It is not one private key per transaction.

Secondly, the ID in the exported .csv file is not the private key. In fact, there is no way for your wallet's private keys to be exported from the GUI. You will need to open the debug console (Help > Debug Window > Console) and use the dumpwallet or dumpprivkey commands to get the private keys. The private keys will always begin with a 5, K, or L. If they do not, then those are not valid private keys.

However you should not need to export your private keys to import into a Bitcoin Cash wallet. You can use a Bitcoin Cash wallet which is based on Bitcoin Core; such wallets read and use the Bitcoin Core wallet.dat file.

So to be able to spend your Bitcoin Cash, first move your Bitcoin to a new wallet. Then download and install a Bitcoin Core based Bitcoin Cash wallet such as Bitcoin ABC, Bitcoin Unlimited Cash, and Bitcoin Classic Cash. Then copy your Bitcoin Core datadir (which includes the blockchain, the databases, and your wallet.dat file) and have your Bitcoin Cash client use it. You may need to have it reindex the blockchain. Once that is done, you should be able to spend your Bitcoin Cash and use the Bitcoin Cash wallet software as you normally do with Bitcoin Core.


Does the block reward get halved every 4 years regardless of hardware advancements?

The block halving takes place every 210,000 blocks. The difficulty retargeting mechanism makes it so that 210,000 blocks take approximately 4 years, but this is not exact. If the hashrate is rapidly growing, it will take a little less than that.

For example, if the total network hashrate doubles every year, it will take about 1 month less. If it doubles every week (increases by a factor of 4.5 quadrillion every year), it will take only 2 years.


Which Bitcoin RPC call is used for setting transaction priority?

The transaction priority is implied by the fee which you set for it. You can estimate the fee with your desired priority using https://bitcoincore.org/en/doc/0.16.0/rpc/util/estimatesmartfee/

Simply compute your transaction size (bytes) and adjust the transaction fee according to the sat/kB returned by the estimatesmartfee call.


What is needed to get listed on a currency exchange website?

First, you're going to have to prove that your altcoin is useful and has value and liquidity. You can't just create a new coin and expect people to value it. The most successful altcoins have something different about them or some feature that other coins don't have. In other words, you need to create some demand.

Second, once you have demand, then you need to give some assurance that your coin is secure. There was one coin that managed to insert malware into their base node client, got installed at an exchange and wiped them out of their holdings. Your code will most likely need to be open-sourced and audited.

Third, you would start at some of the lower tier exchanges that will take list altcoins relatively easily like Poloniex.

Fourth, if your coin gets popular enough there, then you can move to an exchange like Shapeshift.

Fifth, if your coin gets enough popularity, you can then move onto major exchanges like Coinbase.

Note though, that not many coins make even get to step 3. Steps 4 and 5 are even tougher. So far, the only coins to have made it to step 5 are Ethereum and possibly Litecoin.

Best of luck.


GDAX deposit accounts - what happens to addresses that change?

The address changed because you used the old one.

Don't worry, the transfer is valid, and they keep track of the old address. However, for future transfers they want you to use another address. This is beneficial to privacy.


Basic point multiplication with G in libsecp256k1

Remember, as Pieter Wuille said, all exposed functions (only those that you'd need to use) are in include/secp256k1.h

You can use secp256k1_ec_pubkey_create like this:

secp256k1_context *sign = secp256k1_context_create(SECP256K1_CONTEXT_SIGN);
secp256k1_pubkey pubkey;

// Here our private key is 1, little endian
const unsigned char seckey[32] = {1};

if (!secp256k1_ec_pubkey_create(sign, &pubkey, seckey)) {
    // Private key out of range
    // abort!
    secp256k1_context_destroy(sign);
    exit(1);
}

// Use 65 and SECP256K1_EC_UNCOMPRESSED for uncompressed public key
unsigned char outpubkey[33];
size_t written_bytes = 33;
secp256k1_ec_pubkey_serialize(sign, outpubkey, &written_bytes, &pubkey, SECP256K1_EC_COMPRESSED);

printf("Public key: ");

for (int i = 0; i < 33; i++) {
    printf("%.2x", (unsigned int) outpubkey[i]);
}

printf("\n");

secp256k1_context_destroy(sign);

Whose output can be verified with ThePiachu's tool and the private key 0100000000000000000000000000000000000000000000000000000000000000


The wiki describes this:
 - https://en.bitcoin.it/wiki/Protocol_specification#Common_structures

BlockExplorer will show the raw data.  For example:
 - http://blockexplorer.com/rawblock/00000000000008d11f13eed2e13f2765eceaf00de36e0ec040a10cc3738bdc74


does anyone know how to send the "exp" parameter in an Electrum request

Yes.  Use "expiration": "3600" and it'll work.


Bitcoin open source web wallet with Bitcoin wallet service

Where the user email and password are stored when user registered on
  the web wallet websites like blockchain.com ?

In the ORDBMS database.

  Is the blockchain.com directly interact with the bitcoin blockchain
  and store the email and password on blockchain ??

The blockchain.com has full bitcoin node and interact directly with bitcoin node. They doesnt store users data(email, passwords and so on) in the blockchain

  How the web wallet works ? How they are interact with the blockchain ?

Web wallets is a plain middleware between full nodes and users, they are in the cloud.

  How the more secured web wallet interact with blockchain ?

Your wallet is protected, but there is always a chance what this web wallet(or any other web service which offers web wallets) will be hacked.


Is there an easy way to check out the market cap of the alternative cryptocurrencies?

Introducing ... Bitcoin Pie.

Supported Coins are Bitcoin, Tenebrix, NameCoin and SolidCoin. If your favorite coin is not supported, point me towards an active exchange (with or without an API), and a block explorer, and I'll integrate it.


Key points in bold.

Hoarding doesn't need to be prevented. At least, not yet. See this answer for a solid argument: How does hoarding hurt Bitcoin?

Bitcoin attracts hoarding by design. To change that would turn it into something else.

As Bitcoin matures, I expect that it will remain a problem that speculative trading brings  instability to the market, similar to the gold market. If you put your retirement savings into gold, you'll likely do quite nicely, but there's also a significant chance you'll lose most of it in a price crash. It's not a reliable store of value. Even if you have several years you can wait for the value to come back up, you may still lose out.

Even though bitcoins are more efficient to trade than gold and cheaper to store, it's subject to the same volatility when traders manipulate it. The more popularity Bitcoin has, the bigger the traders will be that take an interest in it, like they do in gold. This could mean that when Bitcoin is mature we still see the same level of volatility that we see today with Bitcoin (and gold).

To me, this says that Bitcoin is great for efficient online transactions, but in the long run (once the market has reached its saturation point) won't a completely reliable store of value. For that, a diversified portfolio of productive investments is better.

If that becomes common knowledge, then people will eventually accept the volatility as a necessary risk in the use of Bitcoin. After all, on average it will still almost certainly cost less than credit card transactions and traditional international money transfers. Secondly, risk-reduction services (ie insurance) tend to fill gaps in the market like that for those who don't want to take the risk.

In the meantime, Bitcoin is doing a great job, but it doesn't mean something better won't come along.


Recovering Blockchaininfo wallet in Electrum wallet

A mnemonic seed phrase can be used to derive an unbounded number of addresses, so you need to supply some additional information, so that the wallet software will know which addresses to derive.

This additional information includes the derivation pathway, and the address type.

There are some standards developed to specify these variables, see for example BIP 32, 39, 44, 84.

So to recover your wallet, you'll want to figure out first which derivation path the original wallet used (you should hopefully be able to find this in the software docs / help), as well as the address type used (should be self-evident, based on the address prefix).


What format is the time of a Bitcoin transaction stored in?

If you are literally referring to the "time" or "blocktime" property of a transaction within the blockchain, then this timestamp is in Unix format.

And if by "convert it to a meaningful value", you mean a human-readable format, you can use a unix command line (e.g. Terminal on OSX) to do a quick conversion:

Linux:

$ date -d @1395103695

Mac OSX:

$ date -j -f "%s" 1395103695

...which would return the following:

Mon Mar 17 14:48:15 HST 2014


What is it mean Difficuly & prob when using vanitygen?

Difficulty tells you how likely it is that vanitygen will be able to find the address pattern you're looking for on the next guess. A value of 2n is twice as difficult (half as likely) than a value of n.
Because the process is completely random, it's impossible to give you a '100%' ETA. We can only estimate that, on average, you will find your key before some time period half the time (hence why 50% is used). Note that it re-adjusts the value to 75% once it hits that 50% mark (and re-adjusts again after hitting 75%, until the key is eventually found).
That is the likelihood that you would have found your key by now, from the time when you started generating your key.


How do I get the value of a btc address transaction with pybitcoin tools?

You can use the unspent command to find unspent outputs sent to that address, or history to see all outputs to that address whether they are spent or not. Note that it relies on public APIs to read the blockchain for transactions.


what is the significance of the rpc port and it's relation to the functionality of bitcoin

There's no reason why you need to change them if you're not concerned about running Bitcoin and an altcoin on the same device/IP address.


How does bitsquare sell/buy fiat currencies when it is decentralized?

In this situation you are the third party who verifies those deposits are legit. All banking transactions take place directly between the buyer and seller. Bitcoin goes into an on-chain 2of3 multi-signature address (in the case of bitsquare and cancoin) or a custodial wallet (in the case of localbitcoins). Once the bitcoin is in escrow the seller gives their bank payment details to the buyer and the buyer initiates a bank transfer directly to the sellers bank account. At this point the seller will release the bitcoin from escrow and send it to the buyer.


Bitcoin fund disappeared from my Mycellium account

The block explorers show that this address received 0.04526392 BTC today and spent it all two hours and a half later. Either this is an intermediate address or someone with your seedphrase / private key sent the money somewhere else.
The address with the current actual balance of 0.051 BTC is 1CqxsGigGw1ufiGJUYnjLNuSqsRkLfJ2R6.


In which output (0 or 1) a transaction fee is included?

Neither.

The transaction fee is the difference in value between the inputs and the outputs of a transaction.


Is it possible to make transaction using wallet private key

You can check and watch the balance by adding the address corresponding to the private key as a watch-only address, but it's impossible to make a transaction in Bitcoin Core without importing the private key.


Are Bitcoin transaction fees competitive?

There is no advantage or disadvantage for miners to include transactions, except for:

If they don't include transactions they don't receive the fees (which are still dwarfed by subsidy for now, but perhaps not forever), though fees can also be paid out of band.
It takes some time to build a block candidate with new transactions immediately after learning about another miner having broadcast another block. This time is short, but nonetheless nontrivial and may represent a loss of income (through subsidy) if it is wasted. Some miners therefore start working on an empty block immediately (which is certainly valid), and only in a second step switch to a candidate that includes transactions.

Bitcoin's consensus rules have no hardcoded amounts in them besides the subsidy. This means that miners are free to pick whatever transactions they like (as long as they are valid), regardless of fee. Due to block resource limitations (size pre-segwit, weight post-segwit, sigops, ...), the optimally rational choice tends to be to prefer transactions with high fee per weight. This effectively creates a block space market, where transaction creators bid for the rate-limited space available in blocks.
Some protocol rules on the public P2P network have additional rules for relay. For example, there is a minimum relay feerate (1 sat / vbyte), and replacement transactions have to "pay" some feerate for the bytes of the transactions they replace. Their minimum values are not set by the market, but by policies implemented by the network's node software. They can also be bypassed by submitted directly to miners. During times of contention, these rules are mostly irrelevant, as the markets will force transactions to pay higher feerates anyway.
A long time ago, the default mining software that came with the Bitcoin client included a policy that would reserve a small area per block for "free transactions", which were selected based on "priority" (which was defined in function of age and value of the UTXOs spent rather than fee). I believe this was intended to promote cheap transaction usage. It was purely a client-side choice that was uneconomical for miners.


Is the unencrypted copy of the wallet still usable after a copy is encrypted?

The old wallet is unaffected, assuming it uses separate data files (e.g. when new wallet is on a different computer or is a different software product).

The password is typically used to protect the program's critical data by encrypting it. It does not change the private-keys.

In the case of Bitcoin core, the data files would be wallet.dat (where private keys and other settings are stored) not the directories holding the blockchain data.

See https://en.bitcoin.it/wiki/Wallet_encryption

  This page describes the algorithm used for encrypting the wallet.dat file used in the original Bitcoin client.

...

  Wallet encryption uses AES-256-CBC to encrypt only the private keys that are held in a wallet.

...

  At runtime, the client loads the wallet as it normally would, however the keystore stores the keys in encrypted form. When the passphrase is required (to top up keypool or send coins) it will either be queried by a GUI prompt, or must first be entered with the walletpassphrase RPC command. This will change the wallet to "unlocked" state ...

Obviously, if you had two different wallet programs using the exact same single wallet.dat file, encryption by the new software would affect use of the old software


Coinbase transaction smaller than .001 btc? & Blockchain says my Bitcoincore wallet is invalid

Also, my blockchain wallet says that my bitcoincore wallet receiving qr code is an "Invalid Bitcoin address: " Why?

It might be that your Blockchain.com wallet doesn't yet support the Bech32 address format (addresses starting bc1...) introduced four years ago.


Transaction and block broadcast use a gossip mechanism which floods the network. A node will send a transaction or block to its peers. Once those peers validate the transaction or block, those peers will send the transaction or block to their peers and so on and so forth. This results in all nodes receiving a transaction or block.


Replacing an unconfirmed transaction with another one isn't really double spending, as Chytrik mentioned.

Several of the older wallets do support dropping unconfirmed txs, freeing up the inputs another transaction. In my experience, Bitcoin Core and Electrum tend to be the best candidates for such actions.

Newer, more consumer facing wallets, such as Ledger Live generally tend to not expose such functionality in the name of simplicity.


Did the FIBRE protocol reduce the occurrence of chain forks?

Is Fibre protocol deserved for rare temporary forking? If blocks are propagate that fast, there are less chances for temporary fork to happen and even if it do, they are short (small length)? Miner can fast continue to work on (what it seems to him) block head of the chain?

Well the point is that a miner can more quickly switch to a new block that has been found on the network. The time a miner spends on building on top of block A, while a block B has already been found by someone else, is very likely a waste of money and energy.
Note that this is not just in the interest of the miner, but of the entire network: a hypothetical 51% attacker is not subject to these losses, as they only build on top of their own blocks. Thus, faster propagation of blocks on the network means that this advantage 51% attackers have over honest miners is reduced.

Is Fibre protocol deserved why mining difficulty is pretty much the same across the network (I assume it's the same, otherwise it would be problematic, right)? If difficulty changes after 2016 blocks on average and block propagation is fast, everyone can adjust their mining difficulty pretty easy and there wont be much difference inside the network (most of the nodes will up to date)?

No, difficulty is not a function of time, but of the previous blocks. So regardless of which block a miner is working on, they always know exactly what the difficulty of that block needs to be (as they have the block's ancestors).
Better block propagation means they can switch to the next block faster, along with the difficulty change that that entails, however.
PS: Note that as of September 2020 the public FIBRE network is no longer operational, and I don't know if any private deployments exist.


Can the Bitcoin blockchain eliminate the need for Trusted Computing in Smart Contracts?

...how do you determine that the computer program that's supposed to resolve the dispute has actually been run, and if so whether the output of the program is being reported fairly by the computer that ran it? ...
But it occurs to me that the issue with external state contracts is analogous to the issue I described above that's solved with the blockchain. So why can't you solve it the same way in this case?

If I understand you correctly, the question you're asking is: Why can't you extend the blockchain trust/coordination system to handle the problem of resolving disputes about the validity of a computation's output (or validity of an observation, like "who won this game?").  After all, if the blockchain gets everyone to agree on a transaction record, why not on arbitrary claims about the world?
The answer, in short, is that the blockchain restricts the "claims" that it "proves" to ones that, by construction, it can provide (strong) evidence for.  And those claims rely on special cryptographic properties that don't (as far as we know) generalize to arbitrary claims about the world.
More concretely, what the blockchain is claiming (and getting network coordination on) is something like, "These transactions happened in this order."  And it proves it by saying, "Transaction T30 must have been seen by someone who had already seen transactions T29, T28 ..., and spent 9000 units of work (say, computations of SHA-256) on it."  Which in turn is proven by how SHA-256 has a known computation difficulty, and the proof-of-work for Transaction T30 was generated uniquely from the previous transactions.
That's a very different problem than proving that a certain (family of) computation(s) has a certain result.  For that problem (as Nate Eldredge mentions), you will want to use Zero-Knowledge Proofs, an active area of research.  But those a) only apply to "pure functions", not arbitrary questions about the Real World, and b) require a certain asymmetry between computation and verification -- i.e., it must be a lot easier to verify them than to do the computation, or else you've saved nothing: just do the computation yourself instead of trusting others' reports!
And it's ever further off from the problem of "proving" real-world observations.  So yeah, the best we have cryptographically is to designate an address as trusted on certain matters, and then check the validity of their signatures.
In terms of verifying real-world claims, the best we have is to check all the implications of that claim, which is just old-fashioned fact-checking.  For the ballgame example, that would be checking things like "What do the newspapers report about the game?  What do the league records say?  Who played next in the tournament?"  Which is fine in practice -- like resolving things at the bookie.  But it doesn't provide a cryptographic proof, which would have to be robust against attackers e.g. falsifying news reports and such.
Okay, I've rambled enough now.  Did I answer your question?


Welcome to Bitcoin.SE!

You need to add the -datadir={dir} parameter to your command line.

A full list of command line options is available if you key bitcoind --help


Bitcoins P2P network is a flooding design, new transactions and blocks are broadcast to every connected peer, and they broadcast to every one of their peers. Valid data reaches all participants very quickly due to the random selection of peers that all nodes make. All validating participants keep a 'mempool', a collection of unconfirmed transactions they believe are valid, miners collect transactions they wish to include in blocks from their mempool and turn them into a candidate template to mine against.


Any charts/bots out there for volumes going from private/unknown wallets to known exchanges?

You should check out WhaleWatch on Twitter. This account posts the exact kind of thing you’re looking for- specifically for BTC and USDT. They differentiate between wallet to wallet and exchange to wallet etc. They post data live and the amount too. There are other accounts just like it on Twitter but they’re a good place to start.


From looking at the code, the wallet.dat can contain entries of the following types:

name - an address book name
tx - a transaction
acentry - an accounting entry
key - a pair of public and private keys
mkey - a master key
ckey - an encrypted key
defaultkey - the default receiving address' key
pool - a keypool entry
version - the version of the software that wrote this wallet
minversion - the earliest version of the software that can read this wallet
cscript - a script
bestblock - a pointer to the end of the best blockchain seen
wkey - a private key (no longer used)
setting - used to store user interface settings (no longer used, except to hold an invalid setting to stop pre-0.4.0 versions of the client which don't understand minversion from loading wallets that are too new for them)

See also this answer.


Monitor bitcoin transaction confirmation timestamps

The time at which a transaction was confirmed can be found in the 4B timestamp in the block header (POSIX time encoding)

To compute average transactions confirmed/hour, you can consider the header timestamp and the number of transactions in each block in your considered timeframe. The first byte following the header represents the number of transactions in the block. However, you may want to exclude the coinbase tx from the transaction count for your purposes.

If you wish to compute the time between broadcasting and confirmation of a given transaction, you must have knowledge of when a transaction was specifically broadcast. Since this is only the case if you broadcast a tx yourself, you cannot compute this exactly. You can however, determine when a tx was first accepted to the mempool of your local node, and use that as a proxy. Bitcoind offers a tx subscription service which publishes newly accepted mempool txs over a zmq interface. By indexing these with local timestamps(time of mempool acceptance), your application can later determine the time passed to the confirmation of a previously indexed tx from a block which includes this tx and the block header timestamp.


Is there Windows based mining software that allows you to set precentage of GPU/CPU or set low priority

Bitcoin CPU and GPU mining is not general considered to be worthwhile anymore because of high difficulty.

If you wish to proceed, you could try limiting the mining application to a single core in task manager for CPU mining.  Additionally Some miners have "aggression" or equivalent settings that may be able to limit the resources the process takes.


Is it possible to forward bitcoins without the private keys?

Short answer: no.

Longer answer: to 'forward' coins one needs to spend them out of the first receiving address, and to the next one. in order to spend them, one needs to sign a transaction using the private key associated with the first receiving address.


Why can't coins be sent from testnet to mainnet?

Testnet and mainnet are two different blockchains, and their coins are incompatible.

A transaction takes outputs that already exist on the blockchain, and re-assign them as outputs to different addresses.  Think of a blockchain as a database.  Let's say testnet has outputs A, B, and C.  They are in the testnet database.  However, mainnet has never heard of these outputs.  They simply don't exist in the mainnet database.  Any transaction that is submitted to mainnet using A, B, or C will be immediately rejected.  Likewise, if you submit the same transaction to testnet, then the transaction goes through...but it goes through on testnet.  Mainnet is still none the wiser.


Difficulty is only recalculated/updated once every 2016 blocks.
The node itself should only calculate the difficulty once every 2016 blocks.


Easiest way to collect funds of big lists of bitcoin privatekeys

I would import all the private keys into my wallet immediately after generating them with bitaddress.org.  There's no need to wait for them to be used.

See this answer for how to import the whole collection at once.


What does change address mean inside Electrum wallet?

Receiving addresses are addresses generated specifically for sharing with people to send payments to you. Change addresses are generated by your wallet automatically when you send funds to someone else.

To understand how change addresses work, consider this example. Say you received 0.1 BTC once, and 0.2 BTC another time. Now you have two UTXOs (unspent transaction outputs) to use to send to someone else. Now you want to send 0.25 BTC to someone. You have to use both of your outputs to have enough to send, but then you have 0.05 too much. You can't partially spend UTXOs, so what you have to do is make a transaction that spends both the 0.1 BTC UTXO and the 0.2 BTC UTXO, and sends 0.25 to the receiver and 0.05 back to yourself in a new address called the 'change' address.

You should not be giving addresses from the 'change' section out to other people. Use receiving addresses for receiving, and let your wallet program automatically handle change addresses.


Is it legal to buy Litecoin and sell those within a few minutes?

I cannot think of any law it would violate.  But legal advice needs to come from a lawyer who you hire.

Note that if you sell it for more than you paid to buy it, regardless of how long you held it, you need to report it on your tax return as a capital gain, and pay the appropriate taxes.  (If you sell it for less, you may be able to deduct a capital loss, subject to a variety of restrictions.)


If there were no transactions, would mining be possible?

Yes.

Miners would just produce empty blocks. They would only be paid a subsidy (12.5 BTC per block, currently) and not any fees from transactions.

In its early history, Bitcoin had many empty blocks.


Transactions are signed with ECDSA. Incidentally, bitcoin addresses are hashes of the ECDSA public key that can spend them. You can't spend somebody else's coins unless you 1) do a bruteforce search to find their private key or 2) find a public key that hashes out to the same thing. Both are much, much harder than doing a double spend attack.


Best method for getting bulk address information (total sent, received, and final balance)

If you do scientific or academical research, you probably won't use blockchain.info. Because this would mean you basically trust bitcoin.info as blockchain source. It really would consider creating and querying your own blockchain copy by installing and syncing a Bitcoin-Core node.

A simple python (or different language) JSON RPC script could solve your problem.
(requires a synced bitcoin-core node)

Add 1000 (of the 100'000) addresses over RPC call importaddress
Get balance of each address by calling `listreceivedbyaddress
Stop bitcoin-core
Delete wallet.dat
Start bitcoin-core

--> go back to 1)

You might increase or decrease the address frame (1000) depending on your system CPU/Mem/Disk resources.


How Does Network Difficulty Relate to the Odds of Finding a Block?

The difficulty is calculated in multiples of difficulty 1, which is defined as a probability of a single hash to be valid of 1/(2^32), i.e., in expectation one PoW is found by iterating through all 2^32 possible nonce values.

So given a difficulty of 40640955016.576 we have a probability for a single hash to be a valid PoW of 1/(2^32*40640955016.576). This in turn results in the ~5.72e-21 given by blockexplorer.


Possibly the hardest data you can get is the details about every individual trade on MtGox. Using the API you can get the trades and then build any derived information you'd need. The data is complete except for the depth information which would be of little use compared to the sheer size.

Mt.Gox currently dictates the price, being the biggest market, but you could certainly splice in additional information from other markets as well.


Is the number of coins limited by rule or by computational infeasibility?

No it does not become computationally infeasible, 1 halving per 210.000 blocks leads to a total of 21m due to math.

Bitcoin block reward is 50 for 210.000 blocks then 25 for 210.000 blocks then 12.5 etc. So the total reward is 210.000 * (50 + 25 + 12.5 + ...). Inside the parenthesis is a geometric series which can be rewritten as 50 * (1 + 1/2 + 1/4 + ...).

Now using the formula in the link we have a = 50 and r = 1/2 and the sum of this infinate series is 100. Multiply that by 210.000 and you get 21 million bitcoins total (actually a little less than that because a bitcoin is not infinately dividable).


Will a Schnorr soft-fork introduce a new address format (i.e. not bech32)

They will be distinguishable, but they will still be bech32 addresses.

The introduction of Schnorr signatures requires a new type of output. Segwit was designed with such extensibility in mind, and it defines 17 version numbers. Currently, only version 0 is used. Segwit v0 outputs with a 20-byte hash are known as P2WPKH outputs, and v0 outputs with a 32-byte hash are known as P2WSH outputs.

A new version number can be introduced, for example v1, and given semantics through a softfork. Schnorr signatures is one of the changes being considered for a proposal.

However, bech32 addresses literally encode a version number plus a payload, which maps directly to the various versions of segwit outputs.

The version number in Bitcoin bech32 addresses is in the 4th character. For all v0 outputs, that version character is 'q'. For v1 outputs it will be a 'p'.


24H means 24-hours period.

Open 24H:
The price of the first transaction 24 hours ago.

Range 24H:
H - High: Highest price reached.
L - Low: Lowest price reached

Last Trade:
Value of the last transaction that took place.

Volume 24H:
The amount of BTC that change hands.

Change 24H:
Price and % change during the past 24 hours.


Easy way to accept bitcoin payments without external service

If you're not running a Bitcoin client of some sort, or referencing a 3rd party (rely on an external service) then your usability will suffer.

For example you can create private keys and address pairs for receiving funds using a library, so you can accept payments just fine without a node or a 3rd party. The draw back is you don't have a way to monitor the blockchain, check for UTXOs, or push transactions.

If you're looking to do those things as well with as little 3rd party as possible, I'd suggest use a library to create addresses, and build transactions, and then line up a series of open API's that allow you to check the UTXO set, and push a signed transaction. If one fails, then hit the next one, and if that fails hit the next, etc. It's a little extra work, but you won't have to sign up with a service, you don't have to run a node, and you don't have to feel like you're relying on an API service since you'll have fall backs.

Here are some push tx endpoints:
https://api.blockcypher.com/v1/btc/main/txs/push
https://chain.so/api/v2/send_tx/BTC/
https://btc.blockr.io/api/v1/tx/push

Here are some APIs to get the UTXO of an address
https://blockchain.info/unspent?active=1bitcoineateraddressdontsendf59kue
https://chain.api.btc.com/v3/address/1bitcoineateraddressdontsendf59kue/unspent
https://api.smartbit.com.au/v1/blockchain/address/1bitcoineateraddressdontsendf59kue/unspent


Can't we change the block data instead of a nonce?

It's possible, and this does happen (refered to as extraNonce), but this is orders of magnitude more resource intensive to do, as you need at least the left hand side of the merkle tree, rather than just 64 bytes of the header.

In Bitcoin the nonce is only 32 bits, which means every 4.2 Billion hashes you need to either update the timestamp, or modify the transaction tree to create fresh work. For a standard block today, this is more than 22 SHA256 hash invocations, versus less than one for modifying the nonce alone.


How is the witness reserved value set in a coinbase transaction?

The only constraint on this value is that it must be 32 bytes. Otherwise there are no constraints. This is done to allow for a future soft fork to commit to new data and have non-upgraded nodes still be able to store something in the block that commits to the new data. As such, the witness reserved value must remain unconstrained to allow for a future soft fork to work.


Why shouldn't I accept PayPal when trading bitcoin?

First of all, it is likely a violation of PayPal's Acceptable Use Policy as of Oct 2011:

  3(h) involve currency exchanges or check cashing businesses

Given this, it's unlikely that PayPal would be amenable to helping at best, and may close your account (and freeze the funds it had for six months) at worst.

Another chief problem is the high likelihood of chargebacks. PayPal has generally sided with the buyer when any dispute is brought against the seller for any reason. For this reason alone, it's best to accept Bitcoin only when you trust the buyer and have some influence on their reputation.

Furthermore, Paypal has high fees (current 2.9% + $0.30 USD).


How does Bitcoin verify that a user owns the bitcoins he/she spent?

Bitcoin doesn't really care about balances, accounts, people or ownership. It doesn't need to know about any of those things.
Read the above sentence again. It is true. It has many important implications.
Bitcoin is cash, not an account. There's no system that tells a pizza storekeeper how many $10 bills (banknotes) you have under your mattress. The pizza storekeeper doesn't care. They only care that the $10 bill you hand them is not fake.
They don't need your ID. They don't need your name. They don't care whether you don't have a bank account. They don't ask you who owns that $10 bill, because they don't care who paid for the pizza - only that it gets paid for at all.
Don't let the terminology confuse you. The bitcoin blockchain isn't a ledger that keeps track of balances. It is a transaction journal that records only half of a real-life transaction - the half where A gives B some Bitcoin money, not the half where B gives A a pizza.
The transaction has inputs and outputs. The inputs are "coins" that A is giving up and the outputs are typically a new "coin" that B is getting and a new "coin" that A gets back as change (since Pizzas rarely cost exactly $10).
A Bitcoin "coin" is really just an output amount from an earlier transaction that has not yet been spent in a subsequent transaction. It is an Unspent Transaction Output (a UTXO).
Bitcoin nodes just keep track of UTXOs. When a UTXO is spent, the U in its name no longer applies. Every node observing the spend removes that TXO from its list of UTXOs. So every node seeing a second spend of a TXO would know that TXO is now not a UTXO and reject that second spend as invalid.
If a wallet reports a false balance to its owner, no one is harmed but the owner. A fake balance does not enable you to spend money you don't have. Its like a leather wallet that has "$30" written on the outside but which only contains two $10 bills.
That's the difference between bank accounts and cash.


Why would Bitcoin Core freeze my computer when syncing? And is it supposed to take this long?

If your computer has some problem during the night, maybe the download never started, but it is normal that your bitcoin core is not in complete sync at the moment because the velocity of Sync doesn't depend on type connection (well it is part of the truth, if you have a slow connection, it is a problem).
In addition, I run a pruned sync on this days on my Linode node and I can share the data.
Before doing that I run the bitcoin node on a Linode server of 5$ and it runs without problem.
The space on the machine is 25Gb (Wow :-P) and it use only around 2/4 Gb I don't know well this data.
To prove that the connection is not important for the upper bound limit of velocity I can the Linode data where the VM works to sync the Bitcoin Network.

In addition, your bottleneck can be the disk, I know that in an HDD the synchronization is a little slower and it is also possible that you have a delay on the Bitcoin core answer. For instance when you run a command like getblockchaininfo. But this really depends on your Computer conf and HDD quality. In addition, I don't know if your disk encryption, can make things slower, I don't know this because I never use disk encryption (I like privacy but I like to pull my data if my Linux has some kernel panic :-) ).


With 100% segwit transactions, what would be the max number of transaction confirmation possible on a block?

Very interesting question, let's see what the smallest transaction we can build is. For it to be minimal it has to be a single input and a single output. The non-segwit part would look something like this:

4 bytes version
1 byte input count
Input

36 bytes outpoint
1 byte scriptSigLen (0x00)
0 bytes scriptSig
4 bytes sequence

1 byte output count

8 bytes value
1 byte scriptPubKeyLen
22 bytes scriptPubKey (0x0014{20-byte keyhash})

4 bytes locktime

This sums up to a total of 82 bytes for the non-witness part. So with a total non-witness blocksize of 1 million bytes we get a maximum of 12195 transactions. Assuming that all spent outputs were P2WPKH the witness part for each transaction consists of two pushes: one for the signature and one for the pubkey. These are around 72 bytes and 33 bytes long, and each need a length prefix of 1 byte. Additionally there is 1 byte witness version. So the total witness size is 108 bytes. With 3 MB of space in the witness block left, this brings us to about 27777 witnesses per block. So the limiting factor is the space in the non-witness part of the block, so that's the final number that we should consider.

Notice that I used the non-segwit serialization for the non-segwit part since that is what non-upgraded nodes will enfore. Notice also that this is an extreme example, since most transactions are not single-input-single-output. A corresponding non-segwit transaction would have a size of 192 bytes, which, together with the 1MB size limit brings us to 5208 transactions per block, compared to 12195 max segwit transaction per block.

The second part of your question regarding maximum UTXO in a block is rather easy. We'd like to amortize the overhead from the transaction structure, and maximize inputs + outputs. Since inputs are larger than outputs we will simple use a single input and compute the maximum number of outputs that fits in a block which is 32256. Since the outputs are non-segwit data, it also changes minimally from before the segwit activation (only the signature from the one input is moved to the segwit part). Therefore the maximum UTXO churn is 1 UTXO gets removed, 32256 get added. For comparison, without segwit the maximum number added was 32252. Notice that there may be other limits that I haven't considered, but this definitely are the upper limits, and these limits are unlikely to have changed during the activation of segwit.


There are a number of "core" developers. And the ones who have access to commit directly to the Github project obviously have more "power" than other people. Since the software is open source you can of course make your own copy of it and modify it to your likings but you won't be able to change any of the "rules" of the network unless you get the rest of the Bitcoin world to follow you and use your client.

According to bitcoin.org the core developers are Satoshi Nakamoto, Gavin Andresen, Pieter Wuille, Nils Schneider and Jeff Garzik. According to a recent message on the Bitcoin Development mailing list Wladimir (J. van der Laan?) is now also part of the core development team. Obviously Satoshi is not anymore, so I don't know how accurate the list on bitcoin.org actually is.

The ones who have push access to the Github project are according to this message:

Gavin Andresen
Nils Schneider (a.k.a. tcatm)
Pieter Wuille (a.k.a. sipa)
Jeff Garzik
Alex Waters

Gavin, who is the lead developer is active here so I'm sure he can give us a clearer answer himself. Also see Is there a list of core Bitcoin committers?


Can't buy bitcoins from Greece via prepaid card

You can buy Bitcoin via credit card / paypal via https://xcoins.io

Disclaimer: I do work for them as an Software Engineer in our Santa Monica office.


No. After transaction A is included into the chain, transaction B is invalid, and will not be mined. If it does show up in a mined block, the entire block is invalid.

It wasn't always like this. Initially, if a transaction had the same txid as a previous transaction, it would overwrite the first one. Then, if that block was reorganized out of the chain, the second transaction would be removed, but the first transaction would not be added. In other words, adding and removing the block would change the state of the unspent transaction set.

That was clearly ricidulous, so under BIP 30, including a second transaction with the same txid when any output from first is still unspent is invalid. It used to be enforced by the timestamp of the block, but it is now applied to every block in the blockchain except for the two that break this rule.


What is the bitcoind command to see how much btc a specific address has?

There is no such command. Addresses are like a superstructure over a bitcoin transaction processing. Client does not maintain index with addresses and balances on them.


I'm not familiar with the specific design of CryptoNote, but in general a cryptocurrency node must have a way of discovering its first node in the network. Once it discovers that first node, it can ask that node for all of the nodes it knows of, then ask those nodes for all of the nodes that they know of, etc. etc. until it knows about every node in the network. In most cryptocurrencies, there's no difference between a seed node and a regular node.

There aren't a lot of constraints on how you solve this problem. You could have a seed node at a fixed IP address, and distribute an update if that IP address changes. You could have the node look up a DNS record that corresponds to a handful of nodes. You can have the node request a webpage, and add all of the IP addresses on that webpage to the address list.

Bitcoin uses a combination of fixed IP's, plus DNS seeding. See peer-discovery.


My guess is that getrawtransaction only works on utxo transactions which means outputs of that transactions are not spent and still kept index by the bitcoin client.


What's a good resource explaining the best ways to buy Bitcoin (noob friendly)?

A guide almost needs to be one that provides results dynamically based on responses to questions.

The factors that matter are:

Where are you (country)?
How much are you looking to buy?
What payment methods can you use?
How soon do you need the bitcoins?
Is privacy / near-anonymity important?

Only once those are known can recommendations be made.

A fairly comprehensive list of methods exist on the Bitcoin wiki:

http://en.bitcoin.it/wiki/Buying_bitcoins


Finding the timing of blocks, afterwards?

I've tested blocktrail.com and they do provide an arrival time. Any provider will only have so much historical data though.

If you are only interested in data moving forward you could run your own bitcoin node(s) and use -blocknotify= command switch to record your own time(s).

You would need to consider when this notification is triggered.  Normally would be after the block is validated and longest chain is updated, not immediately when the node sees it.

Output from BlockTrail

{"hash":"000000000000000015aab005b28a326ade60f07515c33517ea5cb598f28fb7ea","height":320000,"block_time":"2014-09-10T13:55:18+0000","arrival_time":"2014-09-10T13:55:47+0000","nonce":2145106612,"difficulty":27428630902,"merkleroot":"57c6d11085df633a848eecf78befcdbbab58c2830ca380d4089d5013ab53d0df","is_orphan":false,"prev_block":"000000000000000021ecc2772de2ce57c6bd327c4ceaea52a0ecd70548b8ca41","next_block":"00000000000000001bbfee4521419de4f79c19580027b00f9739ee7b2f0b5c57","byte_size":227086,"confirmations":71045,"transactions":357,"value":262417274672,"miningpool_name":"DiscusFish \/ F2Pool","miningpool_url":"http:\/\/www.f2pool.com","miningpool_slug":"discusfish"}


Do Bitcoin calculators give a realistic figure on pool mining

Regardless of whether you're solo mining or pool mining, as long as it's the same coin, your expected number of coins per day should be the same (minus a pool fee). However, the benefit of mining in a pool is that you reduce variance greatly. For example, let's say you have enough hashrate to mine 1 LTC per day on average. If you solo mine, the expected time to find a block is 50 days, but that doesn't mean you will find a block in 50 days. In fact, you might not even find a block in 500 days. It's all random. However, if you're using a pool that finds a block every 50 minutes, the probability that it goes for 500 minutes without a block is the same as the probability that you, as a solo miner, go for 500 days without a block. So you can expect more regular payouts with less risk, making the pool fee well worth it in my opinion unless you alone have 1% of the total network hashrate or something.

As for how the estimated number of coins per day is actually computed from your hashrate, see my answer here.


I have what I believe are my address and password - don't know what wallet from 2017

That would be a very old Blockchain.info wallet, they're the only ones using a GUID for the identifier.


Has anyone used Bitstamp international bank transfer?

I used it, and it worked fine. You could also check out telenor, I think they are selling bitcoins in Pakistan, so no need to trade abroad. The premium may be worth paying given the rising value of the coins i.e your $ buying power may diminish whilst your transfer is processed by the banks.


How much of bitcoin core software can be custom written at miner's end and how much of the code you can't touch? where does bitcoin draw the line?

Forget Bitcoin for a second, instead imagine a network of nodes that passes around data packets that say Hello World!, followed by the current GMT date. To be a part of the network you just need to transmit such messages, but transmitting a different or improperly formatted message will get you banned.

So to join this network, all you need to do is to write a simple program that creates a message which reads Hello World!, and then the date. The choice of programming language doesn't matter much, neither does the method of discerning what the date is. Even the most newbie developer could write a program that would successfully maintain a position in the network, as long as they follow the rules.

Notice that in this example, what matters is the output, not how we arrived at it.

Back to the bitcoin network:

  But nobody has come up with an explanation that how much of the bitcoin software can be custom-written or it can't be custom-written?

All of it can be custom written. On the bitcoin network there are many different versions of bitcoin-core running, as well as some other full-node implementations such as btcd or bitcoin-knots. For mining it is the same. Each different implementation can be an entirely different codebase, written in a different language, by different developers. What is important is the output of that codebase:

For bitcoin full-nodes, the desired outcome is that the node will stay in consensus with all other nodes about the current state of the network. Broadly speaking, this means following along with all 'consensus rules'.

For miners, the desired outcome is that they will be working to create what the network of full nodes will view as a valid block. A new block must conform to many rules in order to be seen as valid, so again the implementation's output will obviously have to respect those rules. Note that a miner will need to be running a full node to do so, in addition to running some code that actually constructs and hashes block candidates.

Pragmatically speaking, it is much easier to write a custom miner implementation, as there are less rules that must be strictly followed to achieve the desired outcome (ignoring the dependancy on a full node for network status information, of course).

Note that there is no way to check or enforce that other nodes on the network are running some specific code, even if you asked, they could just give a false answer. What does matter is the ability of those nodes to all stay in consensus - it is perhaps easier to maintain this if all nodes are running the same codebase, but it is not strictly necessary.


What happens to bitcoins in a multi-sig transaction if nobody signes?

They stay in the block chain, just as normal transactions do.

Let's look at normal transactions first: When someone (A) sends bitcoins to another person (B), B is not involved in the process at all. A just publishes a transaction in the so called block chain stating that only B is allowed to claim the coins. Not before B wants to spend them, he has to prove that he owns them. This happens by putting the signature for the first transaction into the follow-up transaction.

Thus, every transaction stays unsigned in the block chain until the coins are spend in a follow-up transaction. "Owning bitcoins" means having the ability to sign a transaction in which someone sent bitcoins to me.

Multi-Sig transactions aren't that different, you just need more than one signature. As long as you can't provide them the money is frozen, nobody will be able to spend it.


Historical rollbacks of Bitcoin and Etheruem blockchain

Apart from Ethereum uncles and Bitcoin orphans which are tiny forks that happen all the time, these were two instances that I found related to bitcoin bugs:

https://en.bitcoin.it/wiki/Value_overflow_incident: rolled back by community patch
https://en.bitcoin.it/wiki/DOS/STONED_incident: no rollback needed

To answer your question, the blockchain can never be rolled back due to failure of miners to validate a block. By definition, a block gets added once a miner validates a block. If all miners suddenly turned off their equipment, no blocks would be produced, and transactions would sit in mempool until some miner took advantage of the extremely low difficulty and started producing blocks again.


The checkpoints are hard coded into the standard client. The concept is, that the standard client will accept all transactions up to the checkpoint as valid and irreversible. If anyone tries to fork the blockchain starting from a block before the checkpoint, the client will not accept the fork. This makes those blocks "set in stone".


Must a Block contain a coinbase transaction?

Yes, it must.

Block without coinbase transaction will be rejected by network.

From the Protocol, rule #6:

  First transaction must be coinbase (i.e. only 1 input, with hash=0, n=-1), the rest must not be


In 2009, where were Bitcoin source codes stored?

2008
We don't know if Satoshi Nakamoto is an individual or a group, but Satoshi Nakamoto asked for professional crypto geeks to review his project in 2008.
The original source files were therefore distributed privately through email.

2009
Unsure if Satoshi Nakamoto used any kind of source control before the source codes were available to the public. You probably have to ask the developers that were involved.
First available on Sourceforge.
Initial commits on GitHub were converted from svn on Sourceforge.


Will the amount of "usable" Bitcoins eventually drop to zero?

Lost bitcoin are protected by the same security that protects bitcoin in circulation or storage, hence lost coins are lost forever.

There are many ways of looking at this "dilemma", and its effects are different depending on the economic context, but coin loss/destruction is generally considered to contribute to the value of the remaining "usable" coinbase. Since the lost coins are permanently removed from circulation and become unusuable, the principle of Supply and Demand implies that the remaining usable coins will become more valuable.

In economics, this process is called deflation of money supply. It has the effect of increasing the value of each token. It is the opposite of inflation of money supply ("money printing"/quantitative easing) where additional tokens are created with the effect that each token's value is decreased as the pool of tokens grows in relation to available goods and services in the economy.

You might be interested in this detailed discussion: Inflation, Deflation, Money and Credit


Why does bitcoin use signatures to verify transactions?

Any viable system of value needs this simple property: only the rightful owner of the asset is able to spend it. For example: if you owned some bitcoins, but someone else was easily able to spend them, then that wouldn't be a very trustworthy system now would it?

So, we need a system where someone can prove that they are the rightful owner! A naive way to implement this would be to create a secret password that locks your funds, so that you have to attach your secret password to the transaction, in order to spend them.

But there is a problem with this: once you attach your password, anyone else monitoring the system could see your transaction, and just copy the secret onto a new transaction, which sends your money to the attacker!

What is a solution? Using a cryptographic signature allows the owner of a private key to prove that they have knowledge of the secret, without revealing the secret itself! Everyone else can check the signature, and know that it must have been made by the private key for that address, and they can do this without knowing what the private key actually is.

Plus, the signature changes depending on the data being signed, so an attacker cannot just copy the signature to a new transaction to steal the funds (like in the example above). If you use the same private key to sign two distinct transactions, the signature data will be different for each one.

  is there any other method that could be used instead of signatures?

Perhaps there is, but using cryptographic signatures works just fine, and the underlying cryptography has been studied and tested extensively over the last few decades, so we can be fairly confident it works well.

Many other common authentication schemes require some sort of centralized store of data (eg, user accounts for a website, that are accessible by password), so a decentralized cryptocurrency network has some special considerations in this regard. Cryptographic signatures are used in a LOT of different applications though, they are not specific to bitcoin or cryptocurrencies, they are just a useful cryptographic tool in general.


Bitcoin URGENTLY Need Blocks Files - Download them from some Website

If you were in such a hurry to get your coins, why didn't you install a light client as Multibit or Electrum? You could've installed either, use the address it generated for the destination address of your withdrawal, and receive your coins after some minutes.

The point of using the original QT client versus any of these is to increase the Bitcoin network's security by creating more copies of the blockchain.

Options you have: just keep going! Seriously, 31 weeks is not that much time, in about another day you could get it finished. Else, you could try the ordering the blockchain in DVD (I believe there are other sites like that one selling it) or you could try downloading it from a SourceForge "project" containing them up to a certain point (which I believe you're already past) or these others or any of the other links mentioned at the question which I believe this question's a duplicate of.


The first transaction in the block is one created by the miner, it pays the miner the current block reward + sum of transaction fees for other transactions in the block (if any). If that block is accepted by other nodes, after 100 more blocks the miner can spend the money. Other nodes check that spending of this new money meets all the rules.

Each confirmation is a block added on top of the prior block. You can't fake that, you have to mine it. You have to provide the needed proof of work. Ordinary non-mining wallets can verify a transaction but can't confirm it.

Each node works separately to decide what is valid and what isn't. The 51% attack refers to percentage of hashing power not percentage of nodes. Consensus is more of an emergent phenomenon, it isn't like explicit vote counting.

They already checked them and don't need to check them again. Nodes typically each keep and maintain a list of unspent transaction outputs (UTXOs) - you can think of a UTXO as a valid coin.

They don't care. They keep track of both. They pick one arbitrarily as true.  They regularly compare amount of work in each branch. It's only later that a branch with more work may require a reorganisation (e.g. of UTXO set etc). This happens automatically and isn't a problem.

Before asking follow-up questions you will find it best to  read some existing answers such as

What exactly is Mining?
How many nodes need to validate a newly created block?
51%