Canadian bought BTC on cex.io in USD - how do I deal with them to not lose money with CAD-USD exchange rate? I'm a single mom and was gifted some cash that I decided to try and "invest" haha, in bitcoin and other coins.

In my haste to purchase, I signed up for cex.io and funded with my credit card - so I got $300 USD but paid $409 CAD --- I used that USD to buy Bitcoin.

Then I realized the exchange rate killed me - or did it?

I am now using QuadrigaCX (duh, it's Canadian!) but I still have the coins I bought in USD on cex.io ($900 worth but paid like $1230 CAD)

My question is - do I transfer my BTC to my Canadian exchange...

do I hold them in the USD cex.io until I want to sell them,
or what??

I feel so silly, like I paid an extra $100 by forgetting about the CAD to USD exchange rate.

Any help or advice greatly appreciated!

Even the Canadian exchange places like quadrigacx or Einstein deal in US funds for the sake of trading.
You spend CDN to get US so you can buy and trade.
   If I could give you a piece of advive...  trade your bitcoin for LITECOIN before sending it to a different exchange place. Bitcoin will cost about $40 in network fees to send. Litecoin is pennies.
    After that  you send from your litecoin wallet on cex to your litecoin wallet on Quadriga.
Only ever send lite to lite , btc to btc etc...
        Go to quadriga and fund your account. Select litecoin. It will show your wallet address. Copy exactly.
Go to cex  litecoin waller. Hit "send litecoin" put the litecoin address that you copied from quadriga. And send funds.
You may get an email asking you to confirm.  Every site is different. It will take about 20 minutes. (6 confirmations)
It will then show up in quadriga.


What is the definition of an inactive channel? On the Lightning Network, after how much time since the last received channel update is a channel considered inactive?

If you look at the channel_update message of BOLT 07 you will find that a node

  MAY create and send a channel_update with the disable bit set to 1, to
  signal a channel's temporary unavailability (e.g. due to a loss of
  connectivity) OR permanent unavailability (e.g. prior to an on-chain
  settlement).

  MAY sent a subsequent channel_update with the disable bit  set to 0 to
  re-enable the channel.

This means that if you shutdown your node correctly the node or the peer will set the channel to inactive and send a channel message. In particular there is no time(out) encoded to the protocol.

If your node stays online and the TCP-connection stays alive the channel won't become inactive.

If your node dies the peer might send an inactive message. However from the specification it is not clear when and how this will happen.

In general it is considered to be a good practice to shut down your node properly and send out the fact that the channel is inactive so that others won't experience unnecessary routing errors. I think lnd will start collecting statistics about failed routing attempts and locally start to rank nodes by their reliability. While planned downtime is also not as nice as constant uptime it will certainly not downrank your node as much as discovered downtime during routing attempts.

Sorry that this answer might be not as satisfying as you hoped for. Another way to approach this would be to look at the implementations and check when and how they send channel_update messages. For example in c-lightning the send_channel_update function is called 5 times. in Most cases to activate a channel. I can only find 2 cases in which the channel might be broadcasted to be inactive:

static void maybe_send_shutdown(struct peer *peer)
{
    u8 *msg;

    if (!peer->send_shutdown)
        return;

    /* Send a disable channel_update so others don't try to route
     * over us */
    send_channel_update(peer, ROUTING_FLAGS_DISABLED);

    msg = towire_shutdown(NULL, &peer->channel_id, peer->final_scriptpubkey);
    sync_crypto_write(peer->pps, take(msg));
    peer->send_shutdown = false;
    peer->shutdown_sent[LOCAL] = true;
    billboard_update(peer);
}

and:

static void handle_peer_shutdown(struct peer *peer, const u8 *shutdown)
{
    struct channel_id channel_id;
    u8 *scriptpubkey;

    /* Disable the channel. */
    send_channel_update(peer, ROUTING_FLAGS_DISABLED);

    if (!fromwire_shutdown(tmpctx, shutdown, &channel_id, &scriptpubkey))
        peer_failed(peer->pps,
                &peer->channel_id,
                "Bad shutdown %s", tal_hex(peer, shutdown));
    ...

The last one handle_peer_shutdown is the regular shutdown the first one maybe_send_shutdown seems to be called at three points in the code. It can be traced down from there to see if there are any special circumstances at which the channel is broadcasted as inactive.


How much "Proof of work accepted by server" needed to generate 1 bitcoin (or a part of it) I am using Bitminter client, and I am confusing about how much I earn in one week while my system working overnight.

https://bitminter.com/ says "Mining one bitcoin with just a PC now takes millions of years".

What is the basic rule of calculation?

Thank you.

As a miner in a pool, you will be paid a fraction of the pools income based on how much you contribute to the pool, compared to the other miners. So it all depends on how powerful your mining setup is. The reason that using just a PC is so unprofitable now, is because dedicated hardware (ASICs) that is specifically designed for mining is being used, which is thousands of times more efficient.
The total hash rate of the bitcoin network is nearing 7 exahashes per second according to blockchain. This means the difficulty of finding a valid block must be really high in order to keep the block time at an average of 10 minutes. The estimated time to find a valid block is proportional to the difficulty, something like difficulty * 2^32 / hashrate seconds. Now a home PC, with a hashrate in the tens or hundreds of megahashes per second (rough estimate, depends on your hardware) basically just can't compete, at literal billionths of the networks total power. You'll end up paying a lot more in electricity consumption than you will make from mining.

There are a number of calculators available online, for example:

https://www.cryptocompare.com/mining/calculator/btc
https://www.coinwarz.com/calculators/bitcoin-mining-calculator


Has the bitcoin network ever been "down"? I'd be interested to know if the bitcoin network has ever been down. By "down" I mean that a client would not be able to synchronize with the network to obtain data like the txs in the mempool or recently mined blocks.

My guess would be that this would be extremely rare due to the decentralized architecture, but it'd be great to know for sure. If there have been downtimes, I'd be interested to know how frequent these have been and how long they have persisted.

A bitcoin node could be down or (extremely rarely as you say) all its peers could be down... but the bitcoin network could not be considered down; you could still synchronize by connecting to different peers manually using fallback nodes or even have your own list of nodes.

The only way for the bitcoin network to be down is if all the nodes+miners are down which would be nearly impossible even with a few dozens of nodes (current estimate is 6000+ nodes). However, in the very beginning, when there where 1 or 2-3 machines it was possible (see example in @Murch's answer, where that early on, there was only one node on the network: Satoshi's).


Double spend attack by sending higher fee transaction directly to the pools possible? The standard client prioritizes TXs by the time of receipt, e.g. a conflicting transaction will not be relayed. This is not enforced by the network, though. Is there anything that would prevent this scenario from happening with 0-confirmations?:

Send 0.01btc fee TX to 0-confirmation accepting merchant.
Receive digital good.
Send 0.02btc fee TX directly to "all" the major pools/miners.
Miners will include the higher fee TX because they make more profit from it. (Not sure they currently do that but they could.)
brag about successful double spend

Is there anything but worry about their reputation keeping pools/miners from dropping lower fee TXs in favor of higher fee TXs?

If a merchant accepts 0-confirmation transactions, he has to accept that the transaction can be reversed. So he only should do that if he trusts you for more than the amount you transferred to him. You won't get any bragging rights for doing that, since Bitcoin never promised to be secure without sufficient confirmations.

That trust may come from different sources. For example he might know your name, and will sue you for lack of payment. Or you put an amount that exceeds the payment into escrow.

Or perhaps he just doesn't care. For example for many digital goods(most software, movies, music,...), you have negligible marginal costs, and you're already relying on the user being honest enough to not download a copy from Pirate Bay without paying you.

Personally I believe those attacks are irrelevant, since Bitcoin isn't well suited for small fast payments in the first place. I expect those to be handled by higher level protocols, with Bitcoin itself being used to handle larger balancing payments and as a secure value store.


How to use Bitcoin Wallet with MtGox? I downloaded the Bitcoin Wallet from bitcoin.org; it's on my PC with a $0 balance. I want to purchase some bitcoins with dollars on MtGox, but how do I make it such that my purchase shows up in my wallet?

I have an account on MtGox, but I don't see anything under Funding Options where I can link my wallet with the MtGox transaction, then again, I've never purchased Bitcoins so maybe I'm misunderstanding something.

You need to buy bitcoins on MtGox using another currency. These bitcoins will show up on your MtGox account.

You can then withdraw these bitcoins from your MtGox account to your own wallet. You can find this under Funding options > Withdraw funds > Bitcoin. Enter the address your wallet gives you and MtGox will send your coins to that address so that they show up in your wallet.


How can I recover my "unspent" bitcoin I made a transaction since 10days ago to my Brother, But still not delivered to the receiver. It still remain "unspent" help me out on how to retrieve it.

You can make another transaction with a larger fee to override the previous one.


Transactions for multiple crypto-currency coins in cold storage without downloading full block-chains I've searched on the internet and still unable to understand the usage of cold storage. Actually, I want to buy a few types of low price crypto currency coins and save them in my personal devices or papers. Later I need to send them to some exchanges to sell at higher price. I don't want to rely on online sites/firm meanwhile before exchange. Neither I want to download blockchains of each currency.

So, how can I efficiently save my coins in my personal captivity? If I use offline wallet generator, how In-ward and Out-ward transactions will be carried out?

This is probably a question for a longer discussion, less for an q&a forum :-) There are too many opinions on how to, based on the desired outcomes and values (and paranoia). The higher the values, the more important is a proper stress tested storage system. My current solution would be a mix of virtual machines and different hardware.

I think of storing several altcoins in several cold wallets (offline). My major concern would be data loss due to broken hardware. Therefor I'd have two or better three backups. I would create several offline PCs in virtual machines/environments, and also have an offline Linux, and maybe an older MacOSX and/or some RaspberryPIs (all offline). All systems have one advantage over the other. In the virtual machines I would try to setup a wallet, by compiling myself. If not, I take a default wallet. Once the procedure is "clean", I can do the same on an offline PC. It's astounding, how many dependencies there are...

I would install the default wallets on the offline machines, note down the priv keys and/or seeds, capture a photo of the priv key/seeds (make sure your mobile doesn't sync the photo to the network, and delete it after downloading!), and keep it written down and/or somewhere in a veracrypt container on the different offline PCs. It is good to distribute, hardly all break at the same time. Also I note down the public keys and/or addresses. Then in the exchanges, one could send keys to "my" addresses.

I wouldn't download all the blockchain(s), that is not required. For example in Bitcoin, it is sufficient to have the priv key, to get it loaded in an SPV wallet like Electrum. In Ethereum there is MyEtherWallet. Other cryptos only have the "full client", which make it a bit more difficult, when it comes to spending. The clients might not recognize the funds, which have been sent from an exchange to the cold storage since its inception. As long as there is no SPV type wallet, you would have to download the chain up to the point, where you received last funds, or assemble a tx yourself, and send it to the network. I have done this several times with bitcoin, but never for altcoins...

You asked for an efficient process, my guess is, there isn't. I leave it to the audience, to convince me of the opposite :-) There are too many dependencies and different requirements, even if you have the technical understanding, implementing a wallet and being able to cold storage still requires a good thinking on process and trying it out regularely. I'd be very annoyed, if I think I have saved my data, just to discover one day, things have changed and I cannot access funds!

Here in the forum are many links to the keyword "cold storage", and over at bitcointalk as well. So my post is not at all covering all and every options. Maybe people can share some more options.


Do I need to run a full node before the 2X fork? There is a meme out there that goes like this:

"Bitcoin Cash taught people they need to own their own private keys, segwit 2X will teach people they need to run full nodes"

Do I need to run a full node before 2X, or are my coins safe on Trezor?

Your coins are safe on Trezor, you don't need to run full node for coins unless you want to help mine.

If you want to access Segwit2X coin or any other BTC forked coins (in future) asap after the fork, then you should transfer your BTC coin to a lite client and get the private key of that wallet.

Or else, you can wait until Trezor supports Segwit2X coin, in that case, you will get those coins in Trezor itself.


How many weight units does an input use? What is the weight unit cost of an input? And can you batch/aggregate the inputs or is it linearly growth when you add more inputs to a tx?

What is the weight unit cost of an input?

2 things affect the weight of a tx, the total number of bytes , and the total bytes minus witness data.

Transaction Weight = Base transaction size * 3 + Total transaction size, where

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

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

See BIP141

  Can you batch/aggregate the inputs or is it linearly growth when you
  add more inputs to a tx?

You can't batch inputs, but you can combine them and send them back to yourself first in a larger amount, but that requires an additional transaction. Probably the best you can do now is to use a segwit address to receive funds so when you go to spend the inputs, the witness data lowers the weight of each input.


In bitcoin core, how to avoid the dust exception? When I try to broadcast a transaction, my bitcoin core throw a "dust" exception.

amount: 0.00029
fee: 0.00001
bitcoin core version: v0.16.0

The same transaction can success in testnet, but fail in mainnet.

When I send 0.0003 BTC to an account in my bitcoin core, it can success. So, I think send 0.00029 BTC out of the node is still possible.

I set the fee to such a small number to lower the transaction cost, since there will be many transactions like this one. If this fee will not work, then what is the lowest fee?

I try to set the option "discardfee", but didn't make anything change.

Any advice is helpful, thanks in advance.

The current dust limit fee rate is 3 satoshis/byte. If, at 3 satoshis per byte, an output would cost more in fees to spend that it has in value, then that output is considered dust. If you are sending to non-segwit addresses, this limit is 3 sat/byte * 148 bytes = 444 sats. If you are sending to P2SH-segwit addresses (the default address type in Bitcoin Core), then the fee limit is 3 sat/byte * 91 bytes = 273 sat. If you are sending to bech32 addresses, then the fee limit is 3 sat/byte * 68 bytes = 204 sat.

You can lower your dust limit by setting -dustrelayfee to something lower than 0.00003 BTC/kB (equivalent to 3 sat/byte). However I do not recommend that you change this as even though your node will accept transactions with outputs that are otherwise dust, other nodes will not and your transactions will not be relayed.

Furthermore, you should not set your transaction fee rate to be less than 0.00001 BTC/kB (equivalent to 1 sat/byte) as this is the default minimum relay fee and transactions that have a fee rate less than this will not be relayed. Just because your node accepts a transaction does not mean that other people's nodes will.


How to create watch-only wallet on a server with a full node? Given: there're online shops and a server with a full BTC node that I plan to run. I'll be using a full node to monitor incomming transcations thus receiving payments in an automatic manner. Only. Namely, a customer will see a result of his payment in, at most, 10 minutes.
Question: How can I create a wallet that's receive-/watch- only, that'll have to stored on a server?
That is, if a server gets broken into, a hacker won't be able to do anything with a wallet he steals, later on. But I will be because a private key will be stored on my local computer. I'll login into a server once a week and withdraw the funds from a wallet.
--
I don't consider any other - paid, free, open source - ready solutions. The question isn't about a solution to receive BTC payments.

You can install Bitcoin core and import an address as watch only, then you can track all transactions.


Are there any Scala libraries/implementations/projects on bitcoin? There are quite a few Java libraries and I am building my Scala code on BitcoinJ, but obviously, native Scala libraries would be quite a bit more elegant. Has anyone tried?

I really don't think it's needed. Bitcoin is a complicated project, it's better to have one canonical JVM-based library than a library in each JVM language.

AFAIK there is currently no Scala library, and I'm betting there won't be for some time (unless perhaps as a wrapper to bitcoinj?)


Trace and contact bitcoin thief My btc-e account was hacked (or my passwords stolen from my computer). I was able to make screenshots while they were withdrawing my bitcoins. So i have the btc wallet adress where the money went to and I have the ip adress of the thief.
Is there really nothing I can do? Can I find and contact the owner? how?

The ip is: 21211716315

The wallet is: 15M9rP1GshzBfMbqnHL77iqVcvmgbzVa4S

Unfortunately, there is not much you can do.

By design, it is very difficult to identify a person from a Bitcoin address. In principle, if the thief eventually  transfers the coins to an exchange in order to sell them, it could be possible to trace  the coins to that point, and the exchange might know who got the money. But they would probably not divulge this without a court order (if even then), and they may be in a different country with different laws. Moreover, the thief could use a mixing service or other techniques to make it much more difficult to trace the coins to the exchange.

The IP address is a little better (yours is missing some dots, by the way). You can use a tool such as whois to find the ISP to whom the address is registered, and their records would show which of their subscribers was using it at that time. But again, you'd need a court order, and they could be in a different country. Furthermore, there's a very good chance that the thief is not actually their subscriber, but someone who compromised their subscriber's computer and used it remotely. There could even be several layers of this.

Each of these steps would need the assistance of law enforcement, so it would be reasonable to report the theft to your local or national police agency, and give them the information you've shared with us. (It could take some work to educate them about Bitcoin, or find an officer who is already familiar with it.) But unless      the thief has done a shoddy job of covering his tracks, it's unlikely he'll be caught, and even less likely that you'll be able to recover your coins.

Sorry.


What does PPS mean/stand for? On many mining pools/bonds I see things listed as 105% PPS / 110% PPS weekly payout.  What does PPS actually mean?

Where I've seen it, it refers to the mining payment method "Pay per share".

This question has an answer that describes what a "share" is.

On some mining sites that have existed, the earnings for a share have been essentially paid immediately. However, this method exposes the pool operator to a possibility of loss in the case that, on average, they find less that the expected number of blocks. This can be made much worse by a large miner participating in the pool and performing a block-withholding-attack. To prevent these problems, most pool operators prefer slightly modified pay-per-share methods of payment, such as SMPPS (Shared Maximum Pay Per Share).

A payment method is not strictly Pay Per Share if the earnings aren't available for payout immediately, or if risk is passed on to the miner. Note also that it may not always be clear how much of a fee is being charged by a pool operator; it can be as low as 0% or as high as 7% (but if they tell you the payment per share, you should be able to work it out by dividing the block reward of 50BTC by the current difficulty and comparing it with what the pool pays).

A pool would not payout 105% or 110% except perhaps as a promotion when it is trying to increase its number of participants and offers an increased reward such as 55BTC per block (ie 110% of what is earned) at its own cost.

Update: The discussion you linked to in your comment is regarding the issue of mining "bonds" where the issuer promises to pay 110% of the shares mined. Each bond appears to be selling for around 0.6BTC, and represents 2Mh/s of mining speed. Given that the bonds are "perpetual", presumably the issuer has allowed for equipment replacement and maintenance costs, and power etc. Payouts are advertised as "currently 110% of PPS", so it is presumably a promotional offer. The issuer must be earning a margin somewhere along the way to cover the cost.


What does "Reindexing blocks on disk" mean? When I upgraded to 0.8.1, it said Reindexing blocks on disk and it took about four days (Grr).  But later, it said something about a corrupted database and it had to do it again! What is it doing?

0.8x versions of the bitcoin-qt client now use a different database to store the blockchain.  This change was necessary to allow for larger block sizes.

The reindexing process is converting the previous database (which used BerkleyDB) into the new one (Which uses LevelDB).


Bumping unconfirmed transaction with sendrawtransaction I have a transaction which doesn't confirms for last 3 days and is not most likely going to confirm at all in near future due to a recent situation in mempool.

Will it be working if I'll do the following? Are there any risks to loose my bitcoins forever, or even to get banned by system for double-spend?

Dump that transaction with 'getrawtransaction'
Decrease one of it's outputs by X in my hex editor, so that X will be added up to transaction fee
Sign that transaction with 'signrawtransaction' and send it

Could the free ViaBTC Transaction Accelerator service help you ? The service requires a minimum of fee rate of 0.0001 BTC/kB and has submission limit of 100 that is reset every full hour.
"https://pool.viabtc.com" under "Tool".


Transaction has 900+ confirmations but doesn't show up in my wallet I've received a payment to 1KGUphZbuMj5dU9WD4ZKVqHdtz2jSLPXv3. It has over 900 confirmations, but it doesn't show up in my Exodus v20.12.22 wallet on Windows, yet. I have no idea what to do. Is there a way that I can get my wallet to recognize the transaction?

900+ confirms ...

Then you have definitely, incontrovertibly and irreversibly already received the money even though your wallet doesn't know yet.

... but nothing in wallet

Sure but remember that wallets don't contain money. They check the public blockchain to add up how much money you have.

No idea what to do.

is it properly synced to the network?

no idea

https://support.exodus.io/article/75-how-do-i-refresh-my-wallet
says

Did you send a coin to your wallet, but it's not showing in your balance? Is your Bitcoin displaying incorrectly? Do you get an error when trying to send?
If so, then your wallet may be out of sync with the blockchain. A quick wallet refresh tends to fix a number of balance-related problems and help your wallet correctly align with the network.
As a first step, make sure you are using the latest release of Exodus. Here's how to upgrade.
Refresh the wallet by clicking the logo:

Open the crypto wallet you want to refresh inside of Exodus.
Mouse over the asset's logo and click.
A dialogue asks you if you want to rescan the blockchain. Click Rescan. When the refresh icon is finished spinning, all your transactions will be updated and refreshed.

I think I'd try refreshing before upgrading but it's your call.
I hope you have your recovery phrase or your private key written down somewhere safe.


Why is MtGox trying to trademark "Bitcoin"? Someone on the #mtgox IRC channel pointed me to this. It seems to be an application by Tibanne Co. Ltd. for the Trademark name BITCOIN.

I asked MagicalTux on #mtgox about it, but got no answer.

Why is he doing this?

Some countries have a strict first-to-file rule. In these countries, if some malicious entity tried to trademark the term 'Bitcoin' it could cause problems for others trying to use it to talk about the currency. Tibanne is trying to protect the community from this kind of nonsense. Source.


Litecoin-qt getblocktemplate ￼Support for 'segwit' rule requires explicit client support (code -8) I have downloaded the Windows version litecoin client from https://litecoin.org/. I am trying to setup CoiniumServ to serve as a LiteCoin Pool.

Most configuration are done.
However, I am facing this issue. When I try to query getblocktemplate from the litecoin-cli, I will get this error Support for 'segwit' rule requires explicit client support (code -8).

Can anyone help ?
Thanks in advance!

You need to explictly declare the segwit rule:

litecoin-cli getblocktemplate '{"rules":["segwit"]}'


What if all transactions are off-chain in Bitcoin? As we know, there are several off-chain solutions called payment channels in Bitcoin. The users can move off-chain their transactions and maintain a local ledger themselves. They only need to turn to the global chain when a dispute happens or some channel is exhausted. And moreover, the payment network can organize the payment channels together so that users with no direct channels can also perform off-chain payment. The network also brings the opportunity to recover the exhausted channels with off-chain method by adjusting the balance among the channels.
So I have the following questions:
(1) Is it possible to move all transactions off-chain? I think it is possible for the following reasons. Firstly, no one will cheat from the perspective of game theory, so no dispute will happen. Secondly, no channel will exhaust with the off-chain recovering method.
(2) If not, what prevents it from happenning?
(3) If it is possible, what if all transactions move off-chain? I can imagine that if no transactions are on the blockchain, the the blockchain will disappear even when it is still exists. We no longer need to maintain it. Then what it brings to this world?

I agree that a future could emerge in which most payments will be handled offchain. Whenever you want to pay someone and it can't be done via lightning you could just open a payment channel for that amount and keep it open. I also assume cheating won't be too much of an issue and people have strong incentives to keep channels open as the bitcoin are much more liquid on there.
However channel openings and closing will still be a thing thus the bitcoin base layer won't become obsolete and still needs to be maintained. Also some rebalancing is not possible off-chain.
I think in the scenario the bitcoin base layer becomes the institution enforcing the rules of the Lightning Network but it will just be too expensive to do transactions regularly on the baselayer.


After sending some bitcoins, why do I have zero available to spend when I clearly didn't send my entire balance? With some of the clients I use regularly (Multibit, Bitcoin for Android), I've noticed that, after I send bitcoins to an address, I have 0 BTC available to spend despite having perhaps a several bitcoin balance.

Looking more closely at the transaction details on Blockchain.info or Blockexplorer.com, I observe that the client sent my entire balance back to myself in the same transaction.

For example, my balance in my wallet before the transaction is 1 BTC. I send 0.5 BTC to address C from my wallet, plus 0.0005 BTC for transaction fees. I should have 0.4995 available immediately to spend on another transaction. However, the clients show 0 BTC available, but a balance of 0.4995 BTC.

When I look at the transaction, I see two input addresses, addresses A and B. The outputs are 0.5 BTC to address C, the destination of my payment, and 0.4995 to address B.

Why then do I have 0 BTC available when I clearly should have 0.4995 BTC available?

In this scenario, neither address A nor address B had a sufficient balance to pay 0.5 BTC by itself. The two together did have enough. So, the clients are intelligent enough combine the amounts of two addresses together in order to meet the desired transaction amount.

Unfortunately, the combination has the effect of sending bitcoins to yourself as "change" in the transaction. In this scenario, all of the available balance was split between address A and address B. In combining those in order to satisfy the payment to C, some was consolidated as "change" into address B.

Think of it mathematically, as well. This shows the equilibrium, from the point of view of the accounts you control.

balance(A) + balance(B) = payment_to(B) + payment_to(C) + transaction_fee(0.0005)

This is the transaction.

balance(A) + balance(B) - payment_to(C) - transaction_fee(0.0005) = payment_to(B)

That payment_to(B) is the change.

Unfortunately, because of the number of confirmations the clients wait before allowing one to spend incoming transactions, the balance is present but unavailable to spend for several minutes, or as much as hour or more.

Clients should handle this better by warning if transaction about to be sent will create this confusing situation.


How do I get the public bitcoin address from a given private key in wallet import format offline? I have made paper wallets. And I continually send what bitcoins I get to them. I'm paranoid that I've been sending bitcoins to the paper bitcoin addresses where somehow at sometime my saved private keys got corrupted. So from time to time I want to run a script, python or whatever, to check if my private keys do correspond to the public address that I've been sending bitcoins to. I want an offline solution so things like the satoshi client would not do. Is there a small script written by someone that can solve this?

I'd check out the python library PyBitcoin (https://github.com/blockstack/pybitcoin or "pip install pybitcoin").

It's pretty simple to get the address from the wif private key:

>>> from pybitcoin import BitcoinPrivateKey
>>> private_key = BitcoinPrivateKey()
>>> private_key.public_key().address()
'1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T'

You can also derive a private key object from it's raw hex representation:

>>> private_key_2 = BitcoinPrivateKey('91149ee24f1ee9a6f42c3dd64c2287781c8c57a6e8e929c80976e586d5322a3d')

P.S. This library also works with Litecoin, Namecoin and a bunch of other coins.

Disclosure: I'm one of the creators.


Why is this unconfirmed? Can someone tell me how to get a confirmation please or cancel this;

e8c5489abcb60ecdb925ac880ec1e238c9a65ca4c5480065a6ca268bf00ea7ba-000

This transaction (e8c5...) will never confirm because its inputs have already been spent by transaction 93cc4fe50e6069dccb827f56636bb4cd20f9865dd4d7e3b7946bbbca97576e80, which currently has 9 confirmations.

There isn't any inherent need to cancel transaction e8c5; the network is never going to consider it valid.  You might want to remove it from your wallet client software in order to avoid having it display an incorrect balance or other confusion.  How to do that will depend on what software you are using.


do i get a new private key for every transaction that I transfer to my cold storage If I buy crypto in little bits at a time and I transfer to the cold storage wallet every time I buy some, would a get different private keys for each transfer? how to keep track of all those keys?

For example: If I buy 10 cryptocoins today and I store in my hardware wallet and I get private key A, then I buy 15 cryptocoins next week and I again transfer it to my hardware wallet, will I get private key B for the second transaction?
Thanks
Eve

Every address you use to receive crypto will have a corresponding private key. So if you buy 10 coins today and transfer to your wallet, it will have a private key for the address you use. Next day, you buy 15 and transfer to a different address generated by your hardware wallet, it will have a different private key.

You do not have to keep track of the private keys. All those private keys are generated from the same root key which is generated from the 12/18/24 word seed you set up for the hardware wallet. All you need to remember/record is the 12/18/24 word seed.

Try playing around with this https://iancoleman.io/bip39/ . It will give you an idea of what happens inside the hardware wallet.


What happens when more transactions are created than confirmed? I am surprised that there are 220k unconfirmed transactions in the blockchain. And more transactions are getting queued in every minute. If 6 blocks are mined in every hour then in an hour only 12000 transactions will be confirmed. But it seems in every second 3-10 transactions are added. So in an hour, approximate 21600 new transactions will be created.

So what will happen to the unconfirmed transactions, if they lose that money or the transaction will be canceled?

See one transaction (Transaction Details) made by one of my friends but not confirmed. So he is thinking to way out from bitcoin. I am so sad that no one will accept this currency if this cannot be solved.

Update: Please consider that I am new to Bitcoin, I just want to know what will happen to the transactions if it is expired?. Also if there is an address change in the transaction then to which address the refund will go (if it happen)

If 6 blocks are mined in every hour then in an hour only 12000 transactions will be confirmed. But it seems in every second 3-10 transactions are added. So in an hour, approximate 21600 new transactions will be created.

That sounds approximately correct. Space for blocks is a free market, with a limited amount of supply. By definition that means that not every issued transaction will find a place. This is expected.

Also note that there is no minimum cost or maximum demand for transactions. A transaction chooses its own fee, and anyone in the world could just try to issue large amounts of very cheap transactions if there was excess space in blocks - requiring the whole world to validate them.

  I am surprised that there are 220k unconfirmed transactions in the blockchain. And more transactions are getting queued in every minute.

There are zero unconfirmed transactions in the blockchain. The blockchain contains by definition only confirmed transactions. I assume you're looking at some website that shows you their list of unconfirmed transactions. But there is no guaranteed consistency across nodes. In particular, most nodes on the network use a mempool of limited size, which evicts the lowest fee transactions if it grows too large. On top of that, every node can choose their own policies for what unconfirmed transactions to accept.

The point here is that these is not so much a "queue" of waiting transactions. There is a market of offered transactions, and miners will pick some from them, in some order.

  So what will happen to the unconfirmed transactions, if they lose that money or the transaction will be canceled?

The transactions are not in the blockchain, which means there is no consistency across the network about them, by definition. They may confirm at some point, or not. But as long as they don't confirm, they didn't happen. There is nothing to cancel, or to refund. From the point of view of the network, the transaction just hasn't gone through.

The question is what your wallet software or service will let you do.
It may permit you to treat the transaction as abandoned, and allow you to respend the same money. Look for RBF (BIP125) if you want some technical details, but in short, it's a procedure that permits wallets to replace an outstanding transaction with another one that pays a higher fee.

  See one transaction (Transaction Details) made by one of my friends but not confirmed. So he is thinking to way out from bitcoin. I am so sad that no one will accept this currency if this cannot be solved.

Bitcoin is inherently not a very convenient payment mechanism. It doesn't offer instant payments, or customer protection, or guarantees you're sending to a legitimate business.

All of these things are being worked on as systems to build into or on top of Bitcoin, but there is a lot of missing technology.

  Update: Please consider that I am new to Bitcoin, I just want to know what will happen to the transactions if it is expired?. Also if there is an address change in the transaction then to which address the refund will go (if it happen)

Expiration is just one policy that some nodes choose to determine which transactions to keep in their memory pool. It's not very related to this issue, as anyone on the network could just re-broadcast an older transaction, and it can get accepted again by nodes after it was expired before.


Bitcoin Core transaction stay unconfirmed My transaction from Bitcoin Core to Trezor Wallet stays unconfirmed. Because of too low transaction fee ? How do I resolve ?

Status: 0/unconfirmed, in memory pool, broadcast through 9 node(s)
Date: 23.08.2017 11:39
...
Transaction fee: -0.00005760 BTC
...
Transaction ID: 3d9a0ab7d39bf553584a19433280e61065225891f257cca4f9f00811939d2189
Transaction total size: 192 bytes
Output index: 0

Found solution in related posting a looong way down into previous answers:
Make use of the free ViaBTC Transaction Accelerator service (requires a minimum fee rate of 0.0001 BTC/kB): "https://pool.viabtc.com" under "Tool".


mnemonics for ripple wallet I am trying to write a ripple wallet. I want it to be HD wallet.
So I am generating 12 word mnemonics but I am not sure how to give this as a seed to ripple javascript api. See:
https://ripple.com/build/rippleapi/#generateaddress

I'm not 100% sure how this API works, but it looks like it lets you supply the entropy. Test to see if you always get the same address and secret if you supply the same entropy. If you do, then just use the mnemonic and any HD scheme you want to derive a secret of any kind (you can use the same algorithm you'd use for bitcoin) and pass that secret as the entropy to that API call.

Two cautions with this approach:

1) You must test to make sure that API really is deterministic. Try it on a few different machines and a few different JS implementations and make sure the same entropy always leads to the same address and secret.

2) Your ability to recover keys from the mnemonic would be tied to your access to this library. If the library ever changed its key generation algorithm, you might be unable to recover the keys. So pick a version that works and don't ever change it.


Do mined coins show up on blockchain explorers and can the balance of the addresses that mined the coins be seen? Somebody wants to do a deal for a bitcoin transaction but when proof of the coins is required they say that the coins will not show up on blockchain.info as they were "mined coins".

Is this really true? Will mined coins really not show up on blockchain.info for the address' balance?

If that is the case how can proof of funds of bitcoins be seen before the deal goes through?

They DO show up in the blockchain. The block reward(new mined coins) is sent to the miners address who has found a block via the coinbase transaction.

The coinbase transaction can be viewed and is found as the first transaction in every block.


How do I remove Wallet from Bcoin? I'm playing with bcoin cli and created lots of wallets. Is there any way to remove wallet via WalletDB Api?

As Bucko commented in August 2017:

  Unfortunately right now there's no way to remove a wallet via the API in bcoin. There is a zap endpoint but I don't think it does anything yet. If you don't care about losing other wallets, you can just delete the wallet db directory from your bcoin directory.


How will Lightning Network nodes secure their hot wallets? The success of the Lightning Network is dependent on payment routing. Successful payment routing will require online nodes with automated signing facilities. This entails online nodes with hot wallets.

Well known advice within the Bitcoin community is to not use hot wallets.

What can a Lightning Network node operator do to secure their nodes hot wallet and protect their private keys?

The signing requirements for nodes in the Lightning Network are limited to the ability to sign that transactions that make up the smart contracts of the open channels.  So first off, only the money in the channels is "hot", which by its very nature it has to be.  It would be wise to not keep more money in a lightning node than is required for the channels.  For example, keeping your savings on a lightning node would be foolish.

However, lightning nodes also will also earn fees (although how much is unclear), meaning that profit will be generated as the nodes run.  This profit, too, is initially locked up in the channels, but will eventually be settled by means of an on-chain transaction.  Nodes will likely have a mechanism to send funds from the closing of a channel to a more secure wallet for safe keeping.  Either that, or they will take those funds, and use them to fund new channels.

  What can a Lightning Network node operator do to secure their nodes hot wallet and protect their private keys?

There is nothing special that lightning nodes will have to do.  All the advice is basic information security practices.  Don't open ports on your node that you don't have to.  Use a strong password to access your node. Disable remote logins if you have physical access.  Keep the software that is running patched and up to date.  Decrease your attack surface, and reduce the amount of liability (money) you have on any single node to a reasonable amount.

Remember that you put money into a node so that it can make more money.  Making money does not come without risks.  Mitigate those risks to an acceptable level.


Do banks exchange bitcoins to traditional currencies If someone was not concerned with the anonymity aspect of bitcoin, can he/she exchange traditional currencies to bitcoins and vice versa from banks? Do banks do this? and if not, why?

This is something that has not arrived yet (to my knowledge), but will probably emerge in the future.

We're getting close, e.g. the German Fidor Bank has a partnership with Bitcoin.de that let's you quickly transfer money to said market place, as well as having a partnership with Ripple; Ripple has signed up a large number of banks as customers, if current news reports are accurate; finally, multiple banks and the NYSE are investors in Coinbase.

There are numerous other such relationships of which almost certainly one will eventually come to fruition in this regard.


transferring funds from bittrex to binance I want transfer a btc from bittrex to binance but they are telling me that they are supporting only non segwit adress. I don’t know if my btc adress In binance it’s non segwit too.   Thank u

I'm answering this question under the assumption that you are asking how to tell whether an address is a segwit address.
Judging from some Reddit threads I've found, Bittrex does not support withdrawing to native segwit addresses. Native segwit addresses start with the prefix bc1…. If the deposit address you got from Binance starts either with 1… or with 3… and Bittrex accepts it in their withdrawal request form, you should be fine. If it does start with bc1… look whether there is some option on Binance to switch the address format for the deposit address.


My address has been changed Someone sent bitcoins to my address

1FGhx3FEJptmr4b8N68ceWbqHdTt7c4Ycz

But when I look at my address now, it has been changed to

1HEt95bb7ngshaQhUqi7LZVrJRxDRHu7ws

Will the bitcoins still arrive at the first address?

My guess, without knowing what exactly you did or which wallet you are using, is that you clicked again on the "receive bitcoin" button. Every time you do that a new address is created. This is for security/privacy reasons (you should not reuse addresses).

Anyways normally all addresses (actually their corresponding keys) created this way are automatically saved in your wallet so you should be good.


Can't remove unconfirmed transaction Armory 0.95.1
Bitcoin core 0.14.1

I am stuck with a payment that has the state "not in the blockchain yet".

I already updated armory and bitcoin core, tried to rebuild the database and did the "clear all unconfirmed" command.

I added a fee of 0.0001 Bitcons to it, never had issues with this. The transaction was initiated several hours ago, it still has 0 confirmations.

According to blockchain.info the current confirmation time shouldn't be longer than 100mins...

Armory 0.95.1 is incompatible with Bitcoin Core 0.14.1. Use Bitcoin Core 0.13.2 instead.


Using NBitcoin or C# to derive Litecoin and Ethereum Addresses from Master HD Key I am using NBitcoin, C# and the Bip44 standard to create an hdroot to derive child keys from. I then create keys that I want to use for Litecoin and Ethereum addresses by setting the proper 'coin_type' in my derive statement:

var ltcAddress = hdroot.Derive(new KeyPath("m/44'/2'/0'/0/0"));
var ethAddress = hdroot.Derive(new KeyPath("m/44'/60'/0'/0/0"));

Obviously these are Bitcoin addresses by default. How can I now convert them to the proper Litecoin and Ethereum counterparts?

Not sure how NBitcoin works, but it looks like so far you have derived your private and public key, you now need to hash it in the Ethereum method rather than the bitcoin way.

Look at step 3 in this answer: https://ethereum.stackexchange.com/questions/3542/how-are-ethereum-addresses-generated

Edit:
Nethereum has implemented it in C#: https://github.com/Nethereum/Nethereum/blob/master/src/Nethereum.Signer/EthECKey.cs#L115


Transferring funds from a cold wallet to a hot wallet - on chain or off chain? I've seen two techniques when it comes to transferring funds from a cold wallet to a hot wallet.  In one technique the cold wallet signs a transaction (offline of course) and transfers funds to the hot wallet using an on chain transaction. In the second technique, the PK itself is transferred from the cold wallet to the hot wallet. Besides for saving on transaction fees with the second approach - is there any benefit of one technique over the other? Or are they basically equivalent form a convenience/security standpoint?

If you want to keep your cold wallet cold, then you shouldn't be importing privkeys to an online device. If the goal is to ultimately send BTC out of your wallet(s), then you can skip the hot-wallet step entirely: just send from the cold wallet to the final recipient(s). Otherwise, having to export and handle the privkeys will create additional security considerations and risks, that likely do not outweight the benefits of easier spending from the cold wallet (in some ways, the point of a cold wallet is that it isn't easy to spend from, after all).
Keep in mind that there are security considerations involved in importing privkeys from an HD wallet: if you are using non-hardened key derivation, then knowing a child privkey + parent xpub will allow someone to derive the parent privkey. Leaking a child privkey can therefore compromise all other child privkeys at the same derivation level.


Block verification time Does block verification time (by all nodes in the network) takes up a large portion of the total block propagation time?
What is the percentage, on average?

It depends significantly if you're asking about the average, N-th percentile time, or a worst case including the possibility of maliciously constructed blocks.

Nodes use the first copy of a block they receive, obviously. A consequence of this is that block propagation along a slower path will be outpaced by block propagation on a faster path.  As a result, overall propagation time depends mostly on the behavior of fastest paths and there are many optimizations in the Bitcoin network to make the fastest paths usually quite fast.

On the vast majority of blocks >99% of the transactions in the block are known in advance and already validated. With validation already cached the only further validation required are trivial tests such as preventing double-spends within a block and verifying that block time/height are consistent with transaction lock-times.

On blocks consisting of known transactions relay among BIP152 HB-mode peers occurs without most of the validation (only POW and the hash root are checked, which takes under 1ms on a typical fast host). Similarly, fibre forwarding doesn't need to wait for validation (or complete reception, for that matter) even when many transactions aren't known in advance.

As a result on average the amount of time used for validation in propagation in the network today is probably closer to 0% than to 1%. I would expect based on data from matt's relay network that the 99.9th percentile would have a couple percent in validation.

In the worst case, however, no transactions would be known or already validated and, also in the worst case, a block could require minutes of processing to validate.  Fibre would still forward fairly quickly though still several times slower than typical due to the additional data needed.  In such a worst case situation the vast majority of the propagation time would be spent on validation, even where Fibre propagation is used (which doesn't need to wait for validation even when the data is unknown), just due the final receiving node's own validation.

This other answer may be of interest to you: https://bitcoin.stackexchange.com/a/80928/52021

The community has spent a fair amount of effort optimizing the non-malicious block case both because it was clear what needed to be done there and because providing equitable access to very fast propagation is essential to avoiding creating an advantage for larger miners.  Arguably, however, for many concerns the worst case performance is more critical.  Fibre makes some advance on the non-validation related worst case performance, and not making the worst case worse was a major design goal in segwit but the worst case remains a more difficult and somewhat less well addressed problem.


What happens if I buy Bitcoins and the price goes down? What happens if I buy Bitcoins and the price goes down. Will I lose a quantity of my money?

Consider:

If you bought a bar of gold at $1200 / ounce, then the price of the gold drops to $600 / ounce, you wouldn't actually lose any money at all unless you decided to sell your gold at that time.  However, if you wait until the price of gold rises to $1800 / ounce, then sell it, you will gain money.  The key is an ounce of gold is still an ounce of gold, regardless of the "price" in some other currency.

Same goes for bitcoin, or indeed any currency.  If you trade it at one price, then subsequently trade it at a different price, you'll either gain or lose money.


Will bitcoind import private keys for multi-sig descriptor with watch-only flag set to true? I am importing a "warm" multi-sig quorum into bitcoind using importmulti like so:

{"jsonrpc":"1.0","id":"curltest","method":"importmulti","params":[[{ "desc": "sh(multi(2,[eb2d2f9e/44'/1'/0']tprv8g5heqz5AnCKdYQHsHyYvyDvWFdp5RN8Z5uhvb1FrzgPmeuYseQNsknt1KFf1b1Y9dtNaNMbxkaNdkP7FLbhP9a4UosbV5rWLAMFPhUcMVT/0/*,[e19b3701/44'/1'/0']tpubDCkUBfVNYjzdX37ARqSFWNAA5WvQRGy3Y5PA13ve1dSVtBLr7tEf6c7C2sYtnRazFfsfAdCfuv9JG62BnUVvofvvvs9iyDreQhTRJJ6Mp8u/0/*,[65b2e5d3/44'/1'/0']tpubDCFM6STEuVkkh6qCCooJw4TXHRzyq6R6tBeigSQSgf4xY6ZwAeoSQH2ZTTfcsZTrJ7wJF2bixpn38XcKj3KihxH5LzMraCLwsbt3bnkAHrU/0/*))#2pztwc0s", "timestamp": "now", "range": [2500,5000], "watchonly": false, "label": "StandUp", "keypool": false, "internal": false }], {"rescan": false}]}

And occasionally getting the following response (sometimes it works without returning an error and sometimes not):

response = {
    error = "<null>";
    id = curltest;
    result =     (
                {
            error =             {
                code = "-4";
                message = "Error adding key to wallet";
            };
            success = 0;
            warnings =             (
                "Some private keys are missing, outputs will be considered watchonly. If this is intentional, specify the watchonly flag."
            );
        }
    );
}

I do not want to specify the watch-only flag to true as I am importing private keys into the node and want the node to be able to sign. It is very odd that this seems to happen randomly. It feels like a bug.

If I set watch-only to true will it still import the descriptors private keys?

Just to prove my point here is the exact same command attempted a second time which returns success as true:

{"jsonrpc":"1.0","id":"curltest","method":"importmulti","params":[[{ "desc": "sh(multi(2,[eb2d2f9e/44'/1'/0']tprv8g5heqz5AnCKdYQHsHyYvyDvWFdp5RN8Z5uhvb1FrzgPmeuYseQNsknt1KFf1b1Y9dtNaNMbxkaNdkP7FLbhP9a4UosbV5rWLAMFPhUcMVT/0/*,[e19b3701/44'/1'/0']tpubDCkUBfVNYjzdX37ARqSFWNAA5WvQRGy3Y5PA13ve1dSVtBLr7tEf6c7C2sYtnRazFfsfAdCfuv9JG62BnUVvofvvvs9iyDreQhTRJJ6Mp8u/0/*,[65b2e5d3/44'/1'/0']tpubDCFM6STEuVkkh6qCCooJw4TXHRzyq6R6tBeigSQSgf4xY6ZwAeoSQH2ZTTfcsZTrJ7wJF2bixpn38XcKj3KihxH5LzMraCLwsbt3bnkAHrU/0/*))#2pztwc0s", "timestamp": "now", "range": [2500,5000], "watchonly": false, "label": "StandUp", "keypool": false, "internal": false }], {"rescan": false}]}

response = {
    error = "<null>";
    id = curltest;
    result =     (
                {
            success = 1;
            warnings =             (
                "Some private keys are missing, outputs will be considered watchonly. If this is intentional, specify the watchonly flag."
            );
        }
    );
}

I have tested setting watch-only to true and it gets rid of the errors and the node can still sign.


Who is the programmer behind SatoshiDice? I have talked with Erik Voorhees and I learned that he is not the person that programmed SatoshiDice. Does anyone know who is the developer behind this game is?

This is all I could dig up from https://en.bitcoin.it/wiki/SatoshiDice

  SatoshiDice was the brand given the service initially created by BitcoinTalk forum user FireDuck before selling the system to another operator.


Does Segwit mean easier government monitoring? I have noticed a steady stream of PR articles talking ad nauseum of the dangers of a contentious hard fork and how miners refusing to signal segwit are screwing us all. Many are quite well written and read like propaganda to me, so I am naturally suspicious of their intentions and motives.

I see many talking about investors that have a long position in BTC, also founders of startups that seek to open up a market for sidechain solutions. My understanding of segwit is that by moving witness data aside, then third parties no longer have the ability to change a tx id, which gave me the realization just hoe hard it would be to monitor the blockchain for specific transactions.

Would it be safe to assume that law enforcement or governmental entities are having a difficult time tracking criminal behavior because of this and that segwit would make their investigations significantly easier and less complicated? By adopting segwit are we abandoning what little anonymity remains in Bitcoin or am I missing something important?

No, that's completely wrong. There is absolutely no anonymity benefit to third-party transaction malleability.

Third-party transaction malleability makes use of a symmetry in ECDSA signatures that allows changing a transaction's id to exactly one alternative id. The alternative signature has been deprecated and non-standard for years, but miners could still confirm a malleated transaction if they chose so. In fact, it's rather simple to convert transactions from one txid to the alternative txid, and this happened recently, when Bitclub mined a few malleated transactions. Besides a few poorly coded websites suffering hiccups, this was largely a non-issue. However, this issue currently delays use-cases that rely on chains of unconfirmed transactions which would be broken by a malleated transaction in the middle of the chain being confirmed.

Transaction malleability is completely irrelevant for tracking, because tracking typically happens after the transaction is confirmed and therefore has already become immutable. Since the connection is made via following from transaction outputs to outputs, there is no hindrance whatsoever due to a malleated transaction.


I suppose trading bots are the reason here. They calculate usually with big precision, so such orders are normal for them.
It is also possible that btce is doing some crosspairs (MtGox does it for sure):
Someone wants to sell 1 BTC for 800 EUR. Exchange insert this order also to USD market with the price 1100.123123 USD. Due to price USD/EUR the amount might look like this.

Finally, some exchanges can reverse pair, e.g. BTC/USD and USD/BTC. Then the price will look so strange.


Where Can i Buy Bitcoins without using exchange? I'm Planning to work on a exchange where i dont want to connect to other exchanges. so where is the exact source or marketplace to buy/sell bitcoins without accessing any other exchanges . Any help plz reply ASAP

Check localbitcoins.com, which is a site allowing users to interact and buy/sell from each other without the traditional exchange 'features'.


Accessing Bitcoin core software through a mobile phone with no internet connection I am new to to Bitcoin and was allocated a project to develop a (middle-man)service that can allow a person (using a mobile phone with no Internet connection) to use Bitcoin. Since Bitcoin Core is the software that enables a person to use the currency, does this mean my developed software should find a way to communicate with the Bitcoin core software installed on my desktop computer? Or are there any other applications that should be installed?

Here are some considerations and recommendations. I hope that someone can provide a more complete answer than this one, though.

First off, creating new wallet software and getting it right is deceptively difficult, even if you're starting off with a nice library such as Bitcoinj. Unless you feel extremely comfortable with Bitcoin in general, I'd recommend that you use (to the extent possible) an existing full wallet implementation with a good reputation.

On the server side, you'll probably want wallet software you can easily interface with, either by directly calling its library functions, or via an RPC interface. Here are three such options you may want to consider:

Bitcoin Core (RPC access)
Armory (RPC and Python library access)
Electrum (RPC and Python library access)

Take a look at the bitcoin.org choose-your-wallet page for a rough comparison. Please also note that the latter two are deterministic wallets; unfortunately there's less (no?) API documentation available for these two.

You should also take note that Armory has a rather broad interpretation of its AGPLv3 license—if you have a company General Counsel, I'd definitely ask them to consider this before proceeding.

On the server side, you'll need to develop your own accounting database to track individual account balances (do not use the Bitcoin Core deprecated "accounts" feature). Read up on cold storage if you don't have enough insurance to cover the loss of all of your bitcoin, and split your bitcoin between hot (on-server) and cold (off-server) wallets.

I can't offer much other insight than the above, except perhaps to guess that client-server authentication issues are likely to be your biggest potential for bitcoin loss. If you're not an expert in client-server security, or for that matter in security issues related to your chosen mobile platform(s), you should consider consulting with someone who is.


Any good reason to prevent duplicated address in send transaction for Pos coin? The use of sendmany in a PoS coin is an obvious source for preparing stake inputs, however it historically has been prevented to send  to duplicate addresses in one transaction with such an error as "Invalid parameter, duplicated address:"

It seems like a reasonable issue in BTC, but are there any good reasons to prevent this?

This is a limitation on the interface used for send many. The address,amount list is a dictionary internally within Bitcoin Core, and cannot have duplicate keys. As many other projects are forks of Bitcoin Core, the limitation applies to them as well.

You can work around this by constructing a transaction manually or with a library that doesn't not use the RPC interface, nothing at the actual protocol level prevents this.


Why don't most Bitcoin exchanges like Mt. Gox accept debit cards? The Mt. Gox FAQ reads:

  Unfortunately we do not accept any credit or debit payment

Why is this so? It seems like the most natural way to buy bitcoin would be to pay for it using money in my bank account. However this very method seems to be avoided almost everywhere.

Main reasons :

1) Bitcoin is anonymous, free and irreversible. Credit and debit card transactions have to be reversible, Paypal transactions are reversible. So such a system would be a gold mine for card thieves, money launderers, scamers, etc. A relatively small website cannot face the risks.

2) If you're dealing with credit cards you have to follow some regulations, pay charges to the card emitter network, etc.


Understanding reinvestment in a miner growth scenario I got the following question which I can't figure out:

Alice, Bob, Carol, David and Eve are the five major bitcoin miners. They have each invested a million dollars in specialized equipment for bitcoin mining and have driven every other miner to look for other opportunities, i.e. every block in the bitcoin block chain is mined by one of them. The first four are happy just making money off of mining and save their money in bitcoin banks. Eve is willing to invest every bitcoin she makes in buying more mining equipment. Recall that the probability that a miner succeeds in mining a block is the number of hashes that the miner computes divided by the total number of hashes
that the whole network computes. Assume that on average a dollar buys enough mining equipment to compute 225 SHA-256 hashes per second, that the mining fee for each block is 12.5 bitcoins and that each bitcoin is worth 500 dollars. What is the expected time required for Eve to be able to decide for every bitcoin transaction whether it is entered in the block chain, and therefore accepted, or not.

Can anyone explain how do I need to calculate this?

I will not give you the straight out answer, but i will guide you there.
Basically the question is asking when will Eve have 51% of the network hashing power.
Please note that in this question we dont really need to deal with hashing power, this question can be answered by calculating when Eve will have more than $4M+ worth of hashing hardware.
There is an easy approximation, and then there is a more difficult, but more precise way to calculate this.
Currently everyone has $1,000,000 of hashing power. So everybody has a 1 in 5 chance of finding a block.
Lets assume that Eve will get every 5th block (as she accumulates more hashing power, she will have a higher probability of finding new blocks - incorporating this into the answer is the more difficult but precise way).
So Eve will get 1/5 of all blocks, In a day she will get 144/5 = 28.8 blocks.
28.8 blocks @12.5 BTC @ $500 = $180,000
Now we need eve to have 51% of all hashing power. Or more than the others combined, so more than $4M
So Eve needs to spend at least $3M on equipment.
$3M / $180,000 = 16.67 days
So the approximation is 16.67 days, but Eve will get there faster because as she ads more equipment, her chances of finding new blocks grow.
For the more precise calculation we need to settle on the interval of Eve getting new hardware (hourly/daily/weekly/monthly etc.)
You can map it out and eventually you will arrive at a formula.
Hope this helps.


Is there a website that compares the features of different cryptocoins? Is there any website where I can find a comparison of different altcoins by features?

I'm not interested in hashrate, price, difficulty, but rather in implemented features such as:

Used difficulty retargeting algorithm
Anonymous blockchain
Encrypted transaction network

I think the closest you get is this list of all cryptocoins on Bitcointalk. There is a very brief summery of features there, but you can click further to the corresponding official thread, which should contain all information available on the altcoin.

Sadly, almost none have a thorough explanation of the algorithms involved and are hard to access without looking through the entire code (if available at all). I'm even a bit disappointed in Bitcoin in this case. I have yet to see a javadoc like thorough code documentation for any cryptocoin.


How can I validate the amounts of these wallets (https://bitinfocharts.com/top-100-richest-bitcoin-addresses.html) on my bitcoin full node? Followup question: I am running a bitcoin full-node and it took a month to sync the blockchain. I did not create the full-node with a bitcoin wallet. I stumbled upon this 'importaddress' command (https://bitcoincore.org/en/doc/0.16.1/rpc/wallet/importaddress/) and I was wondering if I could somehow run the command without a bitcoin wallet or find a way to attach a bitcoin wallet and rescan the blockchain without having to restart the entire downloading of the blockchain again. Is it possible to attach a wallet without re-downloading the entire blockchain?

A wallet is not related to whether the blockchain has to be downloaded. The blockchain is not stored in a wallet. Rescanning does not redownload the blockchain unless you are using a pruned node.

To use importaddress, you must have a wallet. It cannot work without a wallet file. If you don't have a wallet file for some reason, starting Bitcoin Core normally (i.e. without any wallet disabling options) will have it automatically create a wallet for you. If you have a wallet and just want to import the address into another one, you can create one using the createwallet command. If you have another wallet file, you can move it to the Bitcoin data directory and load the wallet using the loadwallet command.

However loading or creating a wallet is not what you really want to do. You really don't want to import an address into your wallet; you really want to check if that address actually has the amount of Bitcoin that you see listed on a website. To do that, you can just use the scantxoutset command which was introduced in Bitcoin Core 0.17. It does not need a wallet and works way faster than a rescan. See it's help text (by using help scantxoutset) for how to use it.

What scantxoutset does is it scans the UTXO set for any UTXOs that match a given pattern. This will tell you what UTXOs are associated with an address or output script. From there you can sum their values and calculate the total available balance. This will give you the information you want to see without needing a wallet and without scanning the entire blockchain.


What to do when you genuinely don't understand anything about taxes, yet are apparently expected to pay them for your Bitcoin? I've just read a massive webpage from Swedish Tax Agency about Bitcoin. I'm not trying to "be cute" here, but I must say that I didn't understand a single thing of it. I understand Swedish perfectly, yet have no clue whatsoever what is being said on that page.
It's this page: https://www.skatteverket.se/privat/skatter/vardepapper/andratillgangar/kryptovalutor.4.15532c7b1442f256bae11b60.html
It doesn't seem to be available in English, so maybe it's not very useful to link to it here.
All I can interpret from the page is that the government violently hates Bitcoin and I'm supposed to hand them all my money because otherwise they (supposedly) will throw me in prison. Ever since I first got into Bitcoin, I have had zero thoughts or intentions of ever giving anyone one single satoshi besides the transaction fees. The concept never even struck me. It felt like one of the main points of Bitcoin to get rid of all that stupid BS.
The rules for when and how and how much to pay, and even in what currency, are so incredibly cryptic and complex as to make me seriously unable to comprehend them.
If I cannot understand the laws/regulations, what am I supposed to do? They talk about all kinds of forms and special cases and apparently expect me to calculate all sorts of things and hand them huge portions of my hard-earned BTC. I already have so little, and now they want to take a massive chunk of that away?
I regret trying to read up on this because now it seems like I can never buy anything (such as a place to live) or even mention that I own any BTC or they'll come with the cops and drag me away to a cell and/or seize all my electronics. Or maybe "just" punish me financially with huge fees or something. Again, they make it extremely unclear, but use a very hostile and arrogant language.
I wish I were exaggerating and that I'm just "acting dumb", but I honestly cannot comprehend the information on that page. It seems to me that it has been deliberately designed to not be understandable, as to make people who read it scared and stay away from Bitcoin entirely. How on Earth can other people comprehend any of this? I'm not legally "mentally challenged".
What should I do? Re-reading the page over and over isn't going to help, just as doing the same never helps me in other contexts. I don't want to get into any trouble, but I also cannot give them any of my Bitcoin, nor pay for any theoretical "gains" that I've supposedly made, using fiat. I have virtually no fiat money at all, and if I'm going to buy a home, I want to do it directly with Bitcoin -- not converting it to fiat. I don't know if that makes a difference.
Apparently, I have the brain capacity to deal with Bitcoin Core, and even automate it with its API, but still feel like a 5-year-old child when seeing those tax rules. Not only is it "boring"; it's utterly nonsensical to me. Again, it feels like they do it in purpose. Nothing is made clear whatsoever.
If it matters: All my Bitcoin were paid either with Localbitcoins in early 2013 (prior to KYC/AML, using local bank transfer), and later Bisq (no KYC/AML, P2P, SEPA bank transfers). I have never used any centralized exchange, but it's not like I've been fully anonymous still.
I'm obviously afraid of sending them a letter and asking about my specific situation, because then they will know that I have coins and probably start pestering me about "unpaid taxes" or something. I seriously never even thought about this until quite recently, today even. To me, Bitcoin was (and is) completely separate from the fiat money system, and thus their taxes cannot apply to this. I was prompted to look into this after seeing somebody mention taxes for Bitcoin in a USA context.

If I cannot understand the laws/regulations, what am I supposed to do?

A fairly widespread legal rule is that ignorance of the law is no defence.
If you don't understand how the law applies to your situation, you are expected to seek help from someone who does.
You can contact your local tax authorities and ask them, or you can pay for advice from a tax-expert such as an accountant.
All this applies to Bitcoin as much as it does to other forms of money and other assets or investments.

I'm obviously afraid of sending them a letter and asking about my specific situation, because then they will know that I have coins and probably start pestering me about "unpaid taxes" or something.

I wouldn't have such concerns. We all like for hospitals, roads and waste-collection  to exist and be organised by government and paid for by all of us with any significant income or with assets. If you prefer, pay a tax expert for advise.


How do I do a manual replace-by-fee in Bitcoin Core? I made a transaction with too small a fee several days ago; hence, it has not been included in any block. Currently, it is lingering in the mempool. How can I use Bitcoin Core to make a new transaction from the same address but with a higher fee? Essentially, how do I do a manual replace-by-fee?

Simply send a new transaction with a higher fee. A miner will more likely include it in a block if the fee is higher.


Can 2 bitcoin-cli's use the same blocksdir I am trying to set up 2 clients with both using the same block directory is this possible?

bitcoin-cli simply acts as a convenience interface to the JSON-RPC api of bitcoind - as long as you only have one instance of bitcoind using a given datadir, you can safely use multiple bitcoin-cli calls at the same time.


Can Ripple exist without ripples? Can a system like Ripple exist without a currency like ripples? As they are not used to pay the peers in the system, and their supply / fee ratio is so large they do not appear to be stopping the system from being spammed, could the system work without them? What is stopping the Ripple system from abandoning ripples, asides them being mandated by the protocol?

Not with its consensus mechanism: you need the scarce ripples to prevent abuses to the network precisely from spam and DoS.

But there is the older two phase commit design to implement the ripple concept as a decentralized protocol (that wasn't implemented) and didn't need ripples or any kind of "HostCoin":

http://archive.ripple-project.org/Protocol/Protocol

It has some advantages and disadvantages over the current implementation:

+Better privacy

+Even faster transactions??

-All intermediaries in a Ripple transaction must be online

-Lack of thin clients, people that can't be always online are expected to use a server as a service

Privacy is not a priority for the current implementation right now, but there's plans to improve it through obfuscation.

The ledger could even act as the "register" for "hidden transactions" more similar in properties to the ones of the old 2pc protocol. So it may be more convenient to extend or modify the current protocol than to implement the old one.


Is it possible to run two Lightning Network nodes on top of single Bitcoin Core node? I would like to simultaneously run LND and Eclair nodes on top of single Bitcoin Core bitcoind node. Is it possible? I wasn't been able to pull it off so far.

If possible, how to set up ZMQ and listen-tcp?

Thanks Rene, I have managed to do it. Works flawlessly. :)

Listen addresses must be different, eg. 0.0.0.0:9735 and 0.0.0.0:9736, and both  need to be open in router. Also rpclisten must be different, eg: 127.0.0.1:10009 and 127.0.0.1:10019

When opening channel between them use localhost address, eg. 03di28did92d2dh92d29d229d299239r98398r@127.0.0.1:9736

Technically it should be possible. You can find a pretty straight forward description in the lnd docs at: https://dev.lightning.community/tutorial/01-lncli/index.html

I am running several c-lightning nodes on top of the one Bitcoin node that I'm running. In clightning you just have to specify a different data directory and port for each node. Also on this machine I have an lnd node running.

I could give you examples how to do this with c Lightning but you asked for lnd / eclair. As said I don't see any reason why it would not work with the other implementations but I have not checked it yet. This referring you to their documentation.


How will the migration tool from a Bitcoin Core legacy wallet to a descriptor wallet work? In this Andrew Chow blog post on what's coming to the Bitcoin Core wallet in 0.21 he states:

It is, and will be, possible to take an existing Legacy Wallet, and make a Descriptor Wallet which exactly matches it. There will be tooling that allows users to do this. Even after the removal of Legacy Wallets and Berkeley DB, it will be possible to migrate Legacy Wallets to Descriptor Wallets through the use of a minimally dependent migration tool.

How will this migration tool work? How can the descriptor wallet obtain the descriptor from the legacy wallet given that the legacy wallet doesn't know what a descriptor is?

The migration tool will go through all the keys in the legacy wallet and create descriptors for them. This requires considering everything that IsMine matches on. From the Bitcoin Core release notes:

IsMine refers to the function used to determine whether a script belongs to the wallet. This is used to determine whether an output belongs to the wallet. IsMine in Legacy Wallets returns true if the wallet would be able to sign an input that spends an output with that script. Since keys can be involved in a variety of different scripts, this definition for IsMine can lead to many unexpected scripts being considered part of the wallet.

For HD wallets, it is pretty simple to compute the xpriv for the HD seed using a single descriptor. For non-HD wallets but still only key things, it's a descriptor for each key. The set of scriptPubKeys is finite and O(n!) so it is doable.
For watch-only wallets and multisigs it gets more complicated. Also getting the Descriptor Wallet to treat as IsMine any future script that the Legacy Wallet would have treated as IsMine is probably impossible for all edge cases.
Thanks to Andrew Chow and Pieter Wuille for answering this question on IRC. Any errors are my own.


How do I buy something from someone with bitcoin? I want to meet with someone in person to buy an item with bitcoin. What's the best way to go about this transaction?

If you already have bitcoins you might do following:

The best way (or the most common) is to use wallet in your smartphone and do transaction through mobile.

Scan receivers QR code to your smartphone wallet
Send bitcoins
Wait until your transaction receives enough confirmations - can be cheched at www.blockchain.com just by entering your address and finding up the latest transaction. (don't get scared if the transaction doesn't show up within minutes it might get also hours depending on your transaction fees - the higher the fee is the faster confirmation proccess will be) With 0.001 BTC fee the transaction will show up in the next block.
Obtain bought item

In case that you don't have smartphone, bring your laptop to place, where you can acccess internet connection.

You will need to get receivers public address to send bitcoins to - with smartphone you just scan address.

Hope it helps.

If you dont have bitcoins you will need to buy some through exchange or localbitcoins.com.


Unconfirmed Block Chain transaction On 4-Jan 2017, I have made a BTC payment and now,it's been more than 16+hours to my unconfirmed transaction of 0.1313828 BTC through blockchain wallet.

Please help either to revert back this amount in my blockchain wallet or send it to the same address.

URL: https://blockchain.info/tx/5f3088954a3960132bd52438d4b7124bab50d2776c7ce9bdf158d37dc53d8786

Query:
Will it revert back automatically?
Do I need to do something to pull or push it further? Please suggest

I really appreciate if someone helps me as I read certain blogs this is due to low commission fees and nobody picking it during BTC mining.

Thanks

Yes it could be, that your Transaction is not confirmed.
Pls check unconfirmed Transactions here:

https://blockchain.info/de/unconfirmed-transactions

~ 16000 unconfirmed Transactions.

Until they are packed in Blocks it could take some hours - days.
Depends on how large the transactions are it could take some days, because Blocks have a maximum size of 1 KB.

Sometimes there are just ~700 transactions mined per Block and it reaches 1 KB, sometimes there are > 2500 Transactions put in one block.

I think push will not be a solution because it was already broadcasted to Network.

So be patient it will be confirmed soon :)

Regards


Who pays miners fees? I was under the impression that miners earned coin from the blockchain (creator/owner/pool) or "Created" the coin they are paid??
But I see now that fees are involved to buy/sell/transfer.

For example I had $21 dollars left in in my wallet and wanted to transfer it
to GDAX, I was not able to because of insufficient funds to transfer.

Can someone explain how this works. (seems very expensive)

It is quite simple, you pay the miner a fee as part of your transaction to encourage the miners to include that transaction in a block. Block space is limited so larger transactions in size rather than value have to pay more fee.


1 bitcoin deposited into electrum about 4 days ago I received 1 bitcoin from localbitcoins.com since then in history it says.....unverified + 1 confirmation. I have switched servers as per forum advice and so far nothing has changed. I want to deposit to another address but am terrified to do it. Please note I am no techie, I copied and pasted my deposit address for this transaction on ?a blockchain thing and it is there, how can speed up the confirmation to get my history to say verified, do I have to donate some coin to the blockchain or what? Please if you can help do so in the most simplistic terms only.....thank you

This is a common problem with electrum and nothing for you to worry about. As long as the transaction has confirmed in the blockchain it means that the coins are yours. Usually restarting electrum "fixes" this. Try restarting it a few times.


Why isn't the right chain chosen according to the number of nodes who are broadcasting it? So if a new node join the game, it gets blockchain from other peers.

It may actually receive 2 different chains and it chooses the longer cos of more work done.

I wonder why isn't it simply choose the one that is being broadcast by higher number of peers instead of this mining madness??

Because the cost of pretending to be many nodes is trivial. IP addresses are cheap, and anyone who controls your internet connection can pretend to be everyone.

However, mining is inherently expensive. You cannot fake hashpower.


Channel openning fee too low I recently setup a bitcoin node (bitcoind) and lightning node (lnd) on a linux system. As lifetime windows user this was quite challenging!
Anyway I tried to open my first channel about 4 days ago and the transaction is still stuck in pending. I didnt set a fee manually as I had read that lnd should automatically pick one. I cant find a TXid to lookup what fee was chosen.
Is there a way I can bump up the fee or do I have to wait until it drops out of the mempool?
Next time how can I check what fee will be set and possibly adjust?
Thanks.

The only difference is the last part of your question : "Next time how can I check what fee will be set and possibly adjust?" that depends which implementation you have installed.
For example in c-lightning from the docs at https://lightning.readthedocs.io/lightning-fundchannel.7.html we can Learn that you can use the optional feerate argument in the fund channel command:
feerate is an optional feerate used for the opening transaction and as initial feerate for commitment and HTLC transactions. It can be one of the strings urgent (aim for next block), normal (next 4 blocks or so) or slow (next 100 blocks or so) to use lightningd’s internal estimates: normal is the default.

Otherwise, feerate is a number, with an optional suffix: perkw means the number is interpreted as satoshi-per-kilosipa (weight), and perkb means it is interpreted bitcoind-style as satoshi-per-kilobyte. Omitting the suffix is equivalent to perkb.

For lnd the documentation at https://api.lightning.community/#newaddress says
# One can manually set the fee to be used for the funding transaction via either
# the --conf_target or --sat_per_byte arguments. This is optional.

$ lncli openchannel [command options] node-key local-amt push-amt


Get latest Bitcoin transactions in real-time How is it possible to get the latest transactions txid in real-time? I mean to implement something similar to what blockchain.info does on its homepage. How do they do it to get all transactions info that happens on the network? I'm talking about zero-confirmation transactions.

EDIT
I have found out the API getrawmempool. Does this answer the question? Does it contain all the real-time transactions in the network for the current live block?

blockchain.info offers a web socket for real time information about blocks and tranasactions.
Have a look at https://blockchain.info/it/api/api_websocket

-- UPDATE

to avoid relying on third party services, I would now suggest to use a bitcoin node with zmq


I found a folder called: bitcoin-0.3.22 How do I open it? I would really appreciate if you could explain how do I open a folder called: bitcoin-0.3.22
I am no dev so please be gentle with the instructions :)
I used to buy BTC back in 2011 and I believe I sold them all but now when i found this folder i thought it wouldn't hurt to see what's in it.
Is it even a wallet?
Your help is much appreciated

a folder called: bitcoin-0.3.22

With that name it is probably a folder containing a download of an early version of the Bitcoin software. It may be a kind of compressed file called a ZIP file which Windows Explorer treats as a kind of folder. It may be the results of extracting the contents of a zip file.
Bitcoin version 0.3.22 was released on 5th June 2011
That folder isn't a wallet, there's no money in it.

Any remaining money would be associated with a file named wallet.dat probably in your %APPDATA%\Bitcoin\ folder.  It may have been kept in a different place back ten years ago but that's where it is normally found in current versions.


Chain Race: How to know chain-length of competing chain? If a fork happens, miners mine on the block they receive at first.
Further, they only forward the block they received first (so the block they will use to mine)!

So it can happen that 10% of the network will mine on the chain A. The other 90% will mine on chain B. So only 10% know about chain A and 90% know about chain B. And some edge node will know about chain A and chain B... Depends on how the overlay structure looks like.

What happens if now the 10% fork (chain A) will mine a block and send it to the network? Why won't the other nodes discard the block from chain A? How do they know that this chain is longer? How do they know that the block is not just some part of DDOS attack?

If someone could give me a detailed describtion how the conflict is solved, I would be very happy.

What happens if now the 10% fork (chain A) will mine a block and send it to the network?

When a miner building on top of chain A finds a valid block, it will relay the block to the rest of the network. For convention let us assume the fork (chain A and chain B) has happened at block height N. This is how different nodes on the network will react when they receive a block at height N+1 whose parent is on chain A.

Nodes already using chain A: For them, this block N + 1 is a natural progression of the blockchain and as a result they will just add this block to their blockchain.
Nodes using chain B but has chain A block: There might be some nodes who might have received the chain A block at height N after receiving block at height N from chain B. Since these node received block from chain B first, they will use this version of the chain as their primary one. However, block from chain A that is received later is not discarded but is processed and kept on the disk. So, when block at height N + 1 is received from chain A version, these nodes just revert the chain at height N and use the other block that was kept on disk.
Nodes only having chain B: When they receive block at height N+1 from chain A, these nodes will see that they do not have its parent. As a result, these nodes will query the parent block using the previousblockhash and see if it exists. The nodes having this block will then transmit that block to the nodes not having it. When that block is received, these nodes will see that this chain is the longest proof of work chain and as a result they will now operate on chain A. The block at height N from chain B becomes stale but it is not discarded and is still kept on disk.

  How do they know that this chain is longer?

Nodes accept the longest proof of work chain (in most cases it is same as the longest chain). Nodes sync headers first and verify the proof of work of the chain before asking the actual blocks from other nodes. When nodes on chain B version of chain receive the header of block N+1 on chain A version, they will see that the chainwork of the block received is more than that of the chain they already have and as a result will use it to query the block associated with it.

  How do they know that the block is not just some part of DDoS attack?

When they receive the block header, the proof of work is verified first. So, if the attacker wants to spam the network with invalid blocks, he/she would have to do so with valid proof of work. That means spending immense amount of energy as other miners but not getting the reward (as the block does not have any ancestor, it will be rejected). If the node receives a block header with invalid proof of work, then the node that has sent this block header will be blacklisted after certain attempts of this mischief. This was actually the basis of PoW in 1990s when it was used to prevent spam emails.


Does the `blocksonly` setting prevent other nodes from sending my node unconfirmed transaction, or does it simply cause my node to ignore them? I've seen this option discussed, but I don't have a clear understanding of what is going on.  Since this setting appears to reduce node bandwidth by as much as 88%, I assume it somehow communicates to other nodes that this traffic is unwelcome, but I don't understand the mechanism.  Can someone elaborate?

This allows the bitcoin node to operate similar to a SPV client.  These nodes advertise their capabilities to other nodes as they peer with them.  A node running in blocksonly mode will indicate that it does not want to receive inv messages from any other peers.  Nodes can supply a bloom filter if they are interested in messages for specific address(es), this is also using the same mechanisms that were designed for SPV nodes.


Breaking down a raw transaction: Complete example:

  0100000001186f9f998a5aa6f048e51dd8419a14d8a0f1a8a2836dd734d2804fe65fa35779000000008b483045022100884d142d86652a3f47ba4746ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204b9f039ff08df09cbe9f6addac960298cad530a863ea8f53982c09db8f6e381301410484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adfffffffff0260e31600000000001976a914ab68025513c3dbd2f7b92a94e0581f5d50f654e788acd0ef8000000000001976a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac00000000

Breakdown:

Version (4-byte):

01000000

Number of inputs (variable size but in this case it is 1-byte):

01

Previous transaction ID byte swapped (32-byte):

186f9f998a5aa6f048e51dd8419a14d8a0f1a8a2836dd734d2804fe65fa35779

prev_out_index (4-byte):

00000000

scriptSig length (variable size but in this case it is 2-byte which represents 139-bytes for the following scrtiptSig):

8b

scriptSig (variable size but in this case it’s 139-byte):

483045022100884d142d86652a3f47ba4746ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204b9f039ff08df09cbe9f6addac960298cad530a863ea8f53982c09db8f6e381301410484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adf

Sequence number: (4-byte):

ffffffff

Don’t know what this is:

02

Value to send (8-byte byte-swapped):

60e3160000000000

Output 1 – Receiving address for amount above:

19 76 a9 14ab68025513c3dbd2f7b92a94e0581f5d50f654e7 88 ac

Value for change (8-byte byte-swapped)

d0ef800000000000

Output 2- Change address for amount above:

19 76 a9 147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a8 88 ac

LockTime (4-byte):

00000000

Question:

The bit where I wrote Don’t know what this is, which has the value 02.  I don't know what the purpose of that value is.  What's the purpose of that value?

The bolded byte in the following raw transaction is the number of outputs (two in this transaction):

  0100000001186f9f998a5aa6f048e51dd8419a14d8a0f1a8a2836dd734d2804fe65fa35779000000008b483045022100884d142d86652a3f47ba4746ec719bbfbd040a570b1deccbb6498c75c4ae24cb02204b9f039ff08df09cbe9f6addac960298cad530a863ea8f53982c09db8f6e381301410484ecc0d46f1918b30928fa0e4ed99f16a0fb4fde0735e7ade8416ab9fe423cc5412336376789d172787ec3457eee41c04f4938de5cc17b4a10fa336a8d752adfffffffff0260e31600000000001976a914ab68025513c3dbd2f7b92a94e0581f5d50f654e788acd0ef8000000000001976a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac00000000

The Bitcoin.org Developer Documentation has an extended description of the raw transaction format if you'd like more information.


Why is 550 (MiB) chosen for minimum storage size for prune mode? As you know Bitcoind can run in pruned mode, thus not advertising blocks to other nodes. Even though it has some drawbacks, saving you storage space isn't a benefit you can ignore.

My question is about the magic 550(MiB) default/minimum number. Why they've selected that limit? (& Why not less or more?)

I know it implicitly indicates blocks will be kept for the last (about) 3.8 days (91 hours) (one MiB because of one block every 10 minutes). But where that number come from? I know there is also a dust limit equal to 546 Satoshis.[182*3 ~ 550 here! Even though it is unlikely to be related to this case]

Would you please explaining what the logic behind 550 is? Is there any kind of difficulty level relating to 51% attack or any other stuff like that?

Edit:
From 0.12.0, bitcoind supports relaying NEW blocks to other nodes, thus the first assumption up there, isn't an accurate sentence!

Just got help from someone at BitcoinTalk forum, who directed me to bitcoind 0.11.0 changelog (Which pruning was introduced/implemented for the first time in bitcoind)

As indicated there, Block pruning deletes raw block & undo data:

  ...
  there are four types of data related to the blockchain in the bitcoin system: the raw blocks as received over the network (blk???.dat), the undo data (rev???.dat), the block index and the UTXO set (both LevelDB databases). The databases are built from the raw data. Block pruning allows Bitcoin Core to delete the raw block and undo data once it's been validated and used to build the databases
  ....

which then explains where the number 550 (Not magic anymore!) has come from:

  The minimum allowed is 550MB*. Note that this is in addition to whatever is required for the block index and UTXO databases. The minimum was chosen so that Bitcoin Core will be able to maintain at least 288 blocks on disk (two days worth of blocks at 10 minutes per block). In rare instances it is possible that the amount of space used will exceed the pruning target in order to keep the required last 288 blocks on disk.

*Typo! MiB(1024) is right & not MB(1000). So:

550*1024*1024 = 576716800
576716800 / 288 ~ 2MB

Let me append it that with release of bitcoind 0.12.0, Wallet functionality & block relay that was disabled at pruned mode(& I talked about in my question), are supported again.


How to calculate economic security for bitcoin proof of work? Is this the correct way to calculate security for bitcoin proof of work?
https://twitter.com/drakefjustin/status/1356918733441294336
If a government or group of few rich people or organizations create a token, hold most of the tokens and stake it, price of this token and few people holding this token makes the system secure?
What are other differences in proof of work and proof of stake?

Is this the correct way to calculate security for bitcoin proof of work?

Not sure. But looks like lot of things are ignored in these numbers. I have read about FRM so I will share few things related to FRM ratio and security:
The Fee Ratio Multiple (FRM) is defined as the ratio between the total miner revenue (blocks rewards + transaction fees) and transaction fees. FRM is a measure of a blockchain's security and gives an assessment how secure a chain is once block rewards disappear. This metric was first introduced by Matteo Leibowitz.
A low FRM suggests that an asset can maintain its current security budget (miner revenue) without having to rely on an inflationary subsidy.
Conversely, a high FRM suggests that an asset will require heavy inflation via block reward subsidies in order to maintain its existing security budget.
https://medium.com/coinmonks/introducing-fee-ratio-multiple-frm-1eada9ac9bec

If a government or group of few rich people or organizations create a token, hold most of the tokens and stake it, price of this token and few people holding this token makes the system secure?

No. I don't think this makes a system more secure.

What are other differences in proof of work and proof of stake?

Few differences are mentioned in the answers for this question: Why doesn't Bitcoin migrate to proof-of-stake?
"Proof-of-stake is still in its infancy, and less battle-tested, compared to proof-of-work"
Although difficult to quote anything from websites associated with altcoins, I agree with above sentence which is from https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/