Why is my client saying "A fatal error occured. Bitcoin can no longer continue safely and will quit. "? i am running bitcoin client on OSX. I am by no stretch of the imagination any good at using terminal. I had over 300 btc in there and my computer went black and now client keeps giving me this message "A fatal error occured. Bitcoin can no longer continue safely and will quit.

EXCEPTION: 22DbRunRecoveryException
DbEnv::open: DB_RUNRECOVERY: Fatal error, run database recovery
bitcoin in Runaway exception
"
I can pay somebody to help me fix this problem. dont want to lose the coins i have there. thanks. you'll have to bear with me though. not too good at this.

That alone doesn't provide enough information to know which database file the error is occurring with.   The debug.log might give a more precise indication.

If it is a problem with the blockchain, that is easily resolved.  If the problem occurred after your computer crashed, that is likely what happened.

First though check to eliminate that the problem is that your hard drive partition is filled with no disk space remaining.  That probably isn't the case on your Mac, but just in case, check first.

So, after making yet another backup up your wallet.dat, then you can do this to get a new copy of the blockchain:

These instructions are for mac.  For Linux and Windows the directory names would be different.

 $ cd ~/Library/Application Support
 $ mv Bitcoin Bitcoin-bak
 $ mkdir Bitcoin
 $ cd Bitcoin
 $ cp ../Bitcoin-bak/wallet.dat .

Then launch Bitcoin-Qt as normal.  It will re-download the blockchain.  This could take 24 hours or more, depending on a number of factors.

You might speed that up a bit by getting the blockchain as-of block 170,000 from here:

http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain

After it downloads, extract those files into your new ~/.bitcoin directory.

If after Bitcoin-qt downloads the blockchain to the most recent block and everything works fine (shows your wallet balance and transactions properly), you can then remove the .bitcoin-bak directory:

$ cd ~/Library/Application Support
$ rm -rf Bitcoin-bak

Also, the blockchain download is faster if you are on the most recent release of Bitcoin-Qt, v0.6.3.


Any charts/bots out there for volumes going from private/unknown wallets to known exchanges? To figure out if whales are suddenly moving their BTC or USDT etc from their private/unknown wallets to known exchanges. Or vice versa, if they're comfortable enough to move a lot back onto their wallets.
Or at least how much money is currently on exchanges vs global crypto cap, plotted onto a chart.
Bonus points if there is a way to know how old the private/unknown wallets are. So for ex if wallets from 6 years ago are suddenly moving BTC to an exchange, vs wallets made e.g. this year.

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


Why Full Node stores whole blockchain instead of only the UTXO set? So I have started learning bitcoin recently (from Bitcoin and Cryptocurrency course @ Coursera). And I just learnt that there are "Full-Validating Note" out there that are:

Permanently connected
Store the whole blockchain
Hear and forward every node/trans

My question is why the Full Nodes need to store the whole blockchain instead of just saving UTXO set? If I understand correctly, only having UTXO is already sufficient to prevent double spending.

You are right, and it seems this answer is outdated.

The concept of a UTXO set is more recent than Bitcoin itself. The original software kept a database with information on every transaction output ever created, including whether it was already spent. In that setting, the UTXO set was only defined implicitly by the spentness information in that database.

Bitcoin Core 0.8 (back then still just called Bitcoin) was the first full node software version to make the UTXO set explicit. At the time (2013) it was known that it was possible to also actually delete old block data after validation, as the UTXO set was maintained separately. It was only in 2016 with Bitcoin Core 0.12 that this was actually implemented using a feature known as pruning.

Historically speaking, the answer in the course was not wrong: UTXO maintenance used to imply having the full database. Since the introduction of pruning this is however no longer the case.


Are there ready-to-use indexed bitcoind data files available somewhere? I tried bootstrapping bitcoind, but it's slowly downloading and downloading. I tried putting these files first, but it is still downloading something a bit, stays 100% CPU, iowaits, fills up the thawing free gigabytes and is not going to finish soon.

Is there somewhere ready-to-use $HOME/.bitcoin directory available for download to skip any lengthy initial phase?

If you're going to trust someone to give you a pre-indexed version of the blockchain, you are trusting them about the entire history of transactions. They can claim whatever they want (within certain bounds), and your client will accept it. If there is a mistake in the data (either deliberately or accidentally), it will result in the client rejecting the future valid chain at some point, potentially landing you in a side chain (which may be under control of the attacker). If many people would use the same source for their pre-indexed files, they would all end up on the same side chain, living in their own happy world. Both chains (the real one, and the side one) would allow every existing output to be spent once; if this happens on a large scale, it is a disaster for Bitcoin.

Of course, the long waiting times are a real problem (the upcoming 0.8 version should be significantly faster, though) but if you can't spend the resources and time to maintain a fully validating node (like the reference client implements), consider using a lightweight client like Multibit. It does not offer the same security, but it is better than trusting a centralized instance to tell you history.


how can I recover my private key from my passphrase and password I decided recently to get some BTC and bitcoin core was the storage solution I decided on.

I downloaded the software, and all seemed good. No messages about storage or such.

Around a month later I purchased BTC from an atm and sent it to the Core address.

Upon returning home, I found it was "out of sync". I literally wiped everything off my 250gb Mac in order to accommodate it. Still nothing.

I attempted to reduce the cache size, however Core told me I should reset, and so I did. However, this too didn't help.

I am trying to find how I can recover my private key from my passphrase and password.

I am trying to find how I can recover my private key from my passphrase and password

In general you cannot recover a private key from a wallet password or wallet passphrase.

If what you are calling a "passphrase" is really a "recovery phrase" or "seed phrase", then you can recover private keys from that. A recovery phrase typically consists of twelve or twenty-four words, usually generated for you by the wallet before use, usually from a specific word-list.

AFAIK current Bitcoin Core does not support recovery phrases.

If the wallet is still working, make a backup (File -> Backup Wallet) or extract the wallet.dat file and recreate the wallet on a machine with more capacity -- or -- extract the private keys and import or sweep them into a wallet that supports SPV. Don't delete anything from your 250GB Mac until you have the new wallet working.


How to Connect bitcoind to one of your workers in a pool? I'm trying to start using an old tower to mine bitcoin and am slowly trying to make sense of the setup…

Wallet

I signed up for a bitcoin wallet (coinbase) where I am given an id.
Pool

I joined a pool (Slush's Pool) where I verified my email and added my private? id from my wallet.  They registered a first worker for me:

login: myusername.worker1
password: something given

Miner

(my hardware doing maths), Xeon processor

installed ubuntu server 12.04 64-bit
installed bitcoind, sudo apt-get install bitcoind
configured bitcoind, vim ~/.bitcoin/bitcoin.conf

server=1
daemon=1
rpcuser=INVENT_A_UNIQUE_USERNAME
rpcpassword=INVENT_A_UNIQUE_PASSWORD

What I don't understand is how my pool id is ever connected to what's running on my machine?  I also have no idea what to put for my rpcuser and rpcpassword to ensure it is unique.

I've been reading you can't have a period (.) in your rpcuser name?

Not sure what is the minimum needed in this configuration file:

https://en.bitcoin.it/wiki/Running_bitcoind
http://techcrunch.com/2013/04/08/how-to-mine-bitcoins/

If you're mining in a pool, bitcoind doesn't even have anything to do with the system. It doesn't need to be running, it doesn't even need to exist on your hard drive. The remote pool does that for you.


Is it possible for a slow computer to beat the world mining Bitcoin? I've heard it is not profitable to mine bitcoins on a regular computer via CPU anymore. I accept that.

However, if you did install a miner onto a regular computer and that computer randomly generated "guesses" 24/7 (in a non-sequential fashion). Isn't it quite possible that it could make a lucky guess and beat everyone else mining?

Or, is that absolutely impossible?

I'm thinking about trying my luck at this (without joining a pool) (for fun) if it is possible. If impossible, then please explain why.

It is of course possible... however it is incredibly unlikely!

Mining with a CPU has not been profitable since the earliest days of bitcoin, the expected time to find a block is likely on the order of centuries at this point, and by that time you'll have burned much more in electricity costs than the eventual block reward.

So, as an experiment you could try, but if it costs you even just $5 worth of electricity a month, you would actually have better odds spending that money on a lottery ticket!


Do I have to buy a full bitcoin to get the price increase? If I buy half a bitcoin at $500 and the value of a bitcoin goes up to $1000, does that mean I earn 1 bitcoin or do I have to buy a full bitcoin to get the price increase? How does it work? Please give me some examples.

If you have 0.1 BTC and the Bitcoin price is $10,000, it is worth $1000.
If the Bitcoin price becomes $20,000 you will still have 0.1 BTC but it will be worth $2000.


Feasibility of Integrating Proof of Stake systems into everyday devices? Back in the days of Bitcoin mining there was talk of turning toasters or other electronic devices into Bitcoin mining machines, but that doesn't seem like a good idea anymore having that it requires lots of power and very low ROI having to run it as a node by itself.

My question is, has there been any discussions or projects that use a Proof-of-Stake coin or system integrated into another internet connected device? I'm not talking about just setting up a raspberry pi and installing a POS node onto it and leaving it to mine.

The use of other devices to mine bitcoin probably came from the desire to do something useful with the heat that mining creates.  It takes a lot of energy to slow cook a pot of chili, so the thought was that instead of using traditional heating elements, use SHA256 ASICs.  Regardless of whether the electricity cost was less than the amount of bitcoin mined...you'd still cook your chili.  It was energy you were going to spend anyways, so any amount of bitcoin you mined was just an offset to your existing chili-cooking costs.

I don't think this concept translates to proof-of-stake mining, because I don't see the benefit.  Would you store funds on your toaster, which in turn proves it has a certain stake in the network?  What benefit would this provide over simply proving stake with a computer?  When there is no heat to find a use for, this concept falls apart.


guessing random private key From what I understand (which is not much), private key is like id/password for your wallet. So lets say, I have random number generator and I generate random number, is it possible that generated number could be key to someone elses wallet?

Yes, it is possibly, but not probable, or in other terms, extremely rare. There'll be maximum 2^160 addresses, which is much more than the number of addresses that are used. See this.


Would nine 1MB transactions potentially create havoc on the BitcoinCash network It appears that the BitcoinCash chain is still on its original BCH main chain, and non-upgraded mines/exchanges/wallets can still transact there.
What then would happen if nine (or more) 1MB transactions were created by padding the comments so each transaction was just under 1MB.  Assuming that these none-or-more transactions all had attractive Satoshi's per byte, is the following scenario possible?  If not why not?

Upgraded mines would try and fill a new block with nine (or more) 1MB
transactions while non-upgraded nodes would try and fill a new block
with exactly eight of them.
If an upgraded mine won the next block, then it would create a
physical 32MB consensus rule fork with an initial 9MB block off of
the main chain, and we would be able to see this >8MB block in a
BitcoinCash block explorer (at least for a while).
Subsequent blocks mined by non-upgraded nodes would extend original
8MB non-upgraded main chain, whereas subsequent blocks mined by
upgraded nodes would extend the upgraded now hard fork chain.
Meanwhile exchanges/wallets which have not been upgraded (possibly
some major players due to non-consensus seeking nature of this release)
would operate only on the original main chain, while those that have
upgraded would operate on the upgraded chain, assuming it is longer.
Periodically the chain with the largest cumulative work would
cause transactions on the other chain to be sent back back into the
mempool, potentially allowing this process to repeat assuming that
the new upgraded chain had less cumulative work and that the new
upgraded chain again won the next block race and wrote a new 9MB hard
fork block.
Should this work, the overall effect of this could be tantamount to
a temporary denial of service attack on the BitcoinCash network.

No, the hard fork also brought new opcodes. Transactions using those new opcodes have already been made, which caused the chains to become separated. If the only change were a block size limit increase, the developers would (?) put a consensus rule that says "The size of the first block after the fork must be bigger than 8 MB.", similar to Bitcoin Cash's first block, after forking the Bitcoin blockchain. "...must be bigger than 1 MB..."

Trivia: Rawpool continued to mine for the old blockchain for one day. More information


What parameters are used to calculate the challenge string during bitcoin mining (blockchain creation)? How is the challenge string computed mathematically? What's preventing some node on the bitcoin network from broadcasting a challenge + proof to other nodes as it's own when it received it from some other node?

A parallel to this question would be, how do a node, on receiving, the challenge + proof, authenticate the node which produced this combination?

I tried looking this up elsewhere, but the details of the challenge string calculation seems to be abstracted away in most tutorials.

Thanks in advance!

The data that is hashed, and the hash of which must be below the current target, is the block header. The block header consists of the block version number, the hash of the previous block, the Merkle root of the transactions in the block, the time, the target, and a nonce.

The generation of new bitcoins happens with a transaction, the first transaction of the block, which generates new bitcoins out of thin air. No part of the block can be changed without the hash changing and therefore becoming invalid, and that includes the coinbase transaction's output(s).


How can i access my bitcoin core payment if headers cannot sync due to insufficient storage My Mac laptop does not have enough storage to sync more than 51.57% of headers needed and i cannot access my bitcoin payment. I have tried creating space, trying to change data directory and importing my bitcoin core wallet online. The Bitcoin core app now closes immediately after opening due to my disk almost full.

Have you tried to reduce storage with pruning mode?
https://bitcoin.org/en/full-node#reduce-storage


How fast can one generate Bitcoin addresses? Seeing as the topic of generating address conflicts comes up every now and then, I am wondering if someone looked into the problem a bit further.

Has anyone measured the speed at which Bitcoin addresses can be generated (mainly with some efficient languages, not javascript)? Are there programs akin to GPU miners that instead of generating hashes would generate addresses?

VanityGen uses the GPU to generate addresses until a desired match is found. On my 5870 it does about 27 million addresses per second.


Transaction confirmation How does transaction confirmation work in bitcoin-qt? I suppose, client does not have addresses index with balance on each of them (because there is not such console/bitcoind commands). Looking through all of the blocks - it is too slow.

Transaction processing is a function of mining.  Each time a block is found observed transactions become included in the block chain and get one confirmation.  The Bitcoin protocol is designed to have an adjusting difficulty to ensure that blocks are not generated at a speed greater than that>   This ensures the gradual distribution of new coins into the economy as well.  So long story short this is the model that Bitcoin uses and it is one of the few shortcomings of performing transactions.


How do I generate offline transactions in Java? I'd like to develop a Java binding to the Stratum Overlay Network (a server for thin clients). This requires signing on offline transactions.

Can I directly use bitcoinj's API to do this? Can I copy-paste some java from from it?

In shorts, how would I generate/sign offline transactions in Java?

That depends on how the Overlay Network will be handling the transactions. It might follow the standard protocol, or develop its own. In any case, as the ON is still in proposal stage, everything can change still. Best advise is to follow the forum thread and the Google Doc and see where it settles at.


Are "coin mixers" actually a real thing? Can they be trusted? Ever since I started hearing about Bitcoin, people have been mentioning "coin mixers" to me, and told me to use them. However, even early on, when they were practically throwing away Bitcoins to the left and to the right for anyone to grab, due to their low market price, these always seemed fishy to me.
I just couldn't trust them, even for small amounts of Bitcoin. Certainly not with all my coins.
Today, I just could never trust such a service to do anything but simply steal my coins and don't do anything besides keeping them.
At the same time, I really want privacy. I've paid such extra margins for all these years for purchasing Bitcoin in a "P2P" manner, but my name/identity is still known by various individuals with whom I have traded or purchased goods from.
When I start my Bitcoin service, I will necessarily have to send some Bitcoin out to customers every now and then. And then it will pick "pieces" from my wallet which are known to be tied to me! And that will violate my privacy. But I can't risk losing them entirely, or pay even more than what I've already lost from paying all these extra costs and not to mention the huge transaction fees that the Bitcoin network itself charges. Extra fees for "mixing" the coins is more or less unthinkable.
Are these really a thing? Or just another scam? How can I trust them? Do you all use them? Why wasn't this feature simply built into Bitcoin and automated?

Bitcoin privacy is a complicated and nuanced topic, to really get a good idea of what is involved, I would recommend reading this article. That said, I can still provide you with some more direct answers to your question:

people have been mentioning "coin mixers" to me, and told me to use them. However, (...) I just couldn't trust them, even for small amounts of Bitcoin.

You are smart to not trust your coins to someone else. In the early days of the network, some people ran 'mixing' services, which would accept deposits from users, and then return coins with an unrelated history back to those users. This would break the chain of ownership, but it has several obvious downsides:

You have to entirely trust the service to not steal your funds
You have to entirely trust the service to not be keeping logs of coin ownership
You have to entirely trust the service to be doing a good job of sending you coins with an unrelated history

So for most users, this is not a good solution to the problem of wanting to maintain privacy while using bitcoin.
The good news is that over time new techniques have been invented, that allow the user to obfuscate the history of their coins, without encountering the issues named above. Some examples of these techniques include what are broadly referred to as 'coinjoin' transactions, and 'payjoin' transactions.
'Coinjoin' transactions are a special transaction that take inputs from a large number of users, and then create outputs of equal value. As a user, the equal value output you receive from this transaction cannot be mapped back to your specific input, so you gain privacy in the sense that your output could now potentially have come from any one of the (many) inputs. By employing some clever cryptography and partially signed bitcoin transactions (PSBTs), you as a user never have to trust any server, or other participant of the transaction. The software will only sign your input if it can see that you are being paid one of the outputs, so there is no trust involved! Your coins always reside in addresses that you alone control the keys for. Some examples of wallets that provide this functionality include JoinMarket, and Wasabi.
'Payjoin' transactions provide privacy in a different way: they work to break some of the heuristics used by chain-spying companies, by creating transactions with inputs from both the payer and payee. For anyone that is not party to the transaction, it becomes difficult to infer which input(s)/output(s) were the actual payment. I believe BTCPayServer implements this feature, and there are likely a couple other wallets that can participate in this style of transaction as well (note: it is an interactive process, so you need both wallets to be capable, and online). As with the coinjoin transactions mentioned above, there is no trust involved in participating in a payjoin transaction.
There is also further research being done, to investigate the viability of other privacy enabling techniques. For example, this idea for a coinswap protocol was posted to the bitcoin-dev mailing list just a couple weeks ago, complete with a working implementation.
It isn't clear which techniques will be most useful in the future, but there certainly is a lot of promise for a more private bitcoin economy, if the right infrastructure is built and adopted.
And all of that said, by simply participating in a coinjoin/payjoin transaction, the user does not magically gain an impenetrable privacy shield. For example, if the user receives a coinjoin'd output, and then goes to search for that bitcoin address using a popular block explorer website, then they have just doxxed their interest in that address to the operators of that website (and their ISP, the NSA, etc). So now all of those entities can infer that that particular output is owned by someone at that particular IP address! Woops! Now some privacy has been lost, even if the on-chain history has been obfuscated. To reiterate what I first wrote: bitcoin privacy is difficult (but it is not impossible).

But that's not all! By using the lightning network, you remove the footprint of your payment on the blockchain entirely. Lightning transactions can be extremely private, they don't even need to be publicly broadcast, they can simply be communicated over private (encrypted) communication channels. Lightning is still in somewhat early stages of development and adoption, but it shows a great amount of promise, especially in terms of user privacy. (further to this, if taproot is adopted, then even the opening/closing of lightning channels will become more private, making lightning payments even more difficult to track).

So, to answer your last questions in brief:

Are these really a thing?

Yes

Or just another scam?

Some mixers are definitely scams, but the legitimate ones that use proper protocols are not.

How can I trust them?

You don't have to. With a good implementation, there is no risk of theft.

Do you all use them?

Every user must decide for themselves what level of privacy they want. Not all users have the same needs or desires. But I think it is generally a good idea to engage in privacy-preserving pratices.

Why wasn't this feature simply built into Bitcoin and automated?

In the future, it is entirely possible that wallets will employ these techniques 'under the hood', so that users gain the benefit of privacy, without even realizing what is going on in the background. I believe this is already the case with BTCPayServer, for example.
Other more advanced cryptographic techniques do exist, that can hide transaction information (such as output values, or addresses), but many of these techniques scale even more poorly than bitcoin already does, or have less battle-tested cryptographic assumptions, or require trusted setups, etc. Attempting to add such functionality to the bitcoin network would be a massive undertaking, which imposes a lot of risk on the network. For this reason, finding clever ways of crafting transactions to preserve privacy, without requiring major changes to the network's code, seems to be a more viable alternative.

I've mentioned a few software projects in this post; general disclaimer: I am not associated with any of those projects, I may or may not have used them in the past, and I will always encourage you to do your own research before running any bitcoin software.


can Bitcoin transactions are included in multiple blocks? Once the transactions published to blockchain and are included in blocks by miners. In that case there seems a high probability that a single transaction published can be included in multiple blocks created by different miners? is it true

Yes, theoretically, 2 blocks could be mined at (almost) the same time.
And then, it's also possible that one transaction could be included in those 2 blocks.
But then, there are 2 blockchains, but only one of them (the longest one) will finally be accepted by the network.
So your transaction could be in 2 blocks, but only one time in a blockchain.


Opening Lightning network channel: who is paying? When opening a lightning network channel between two parties, which of the following is true:

1) They must both pay a fee to open the channel

2) They might both pay a fee to open the channel

3) Just one party pays a fee.

The fee here refers to the bitcoin mining fee, not to the amount of BTC the two parties are putting in the channel.

Because a fee is part of a transaction, the fee must be paid by whichever party creates the funding transaction.

Don't think of it as paying a fee to open a channel, think of it as funding a channel with a transaction.  The fee just happens to be part of the transaction.  I believe the current spec has just a single party funding a transaction, but I see no reason why this could not be modified for parties to share the funding cost, in which case both would likely contribute to the fee.


Where do bitcoin transaction fees go I have 2 wallets, and was about to send bitcoins from 1 wallet to another.  I noticed that I had to pay a fee of 0.0001BTC.  Where does that fee go?

One of my wallets was created using bitcoin-qt and the other wallet was created using multibit.

It goes to the Bitcoin miners.

https://en.bitcoin.it/wiki/Transaction_fees


How are popular bitcoin wallets implemented? How are popular online bitcoin wallets, like blockchaininfo's implemented? Why aren't they open-source?

Accuracy not guaranteed

Blockchain.info

Wallets are json files. The json file is encrypted using AES (crypto-js) before the browsers asks that it be stored on the server.
The wallet file is embedded in the login page as a html data attribute, the browser decrypts the file with the provided password and extracts a list of private keys and addresses.
The browser then asks blockchain info the balance and list of recent transactions for the decrypted addresses.
Upon sending the browsers asks blockchain.info for a list of unspent outputs. Then selects the outputs constructs and signs the transaction itself (bitcoin-js). When ready the transaction is serialised and sent to bloackchain for broadcasting to the bitcoin network.
Authentication is done using a unique "Shared Key" contained within the wallet file rather than the users password.
Server side we use 4 servers running MySQL cluster and java. A modified bitcoind client is used to populate the database.

See How It Works

Strongcoin

Similar to blockchain.info with client side encryption.
Private keys are stored individually on the server as a database entry rather than in a single wallet file.
Authentication is done server side using traditional Sessions.
Transaction construction and signing is all done in javascript.
Uses blockchain.info or blockexplorer.com to query balances of addresses. Uses blockchain.info to broadcast transactions.
Server side uses Ruby on Rails and Heroku

Coinbase

Server side uses Ruby on Rails and Heroku
Custom MongoDB database to query balance of addresses.
Server selects outputs, constructs and broadcasts transactions.
Authentication is done server side using traditional Sessions.
The web app directly connects to the bitcoin network using Bitcoin-Ruby to populate the database.

What are they not open source?

They are commercial enterprises with a large amount of development time invested. The code being open source would a) increase competition b) cause identical phishing sites to popup c) clones maybe be hacked or run by scammers damaging the reputation of the main site.

Parts of blockchain.info are open source. I personally hope the rest of the site will be fully open sourced one day but there is much to plan. If the code is just dumped it will not benefit anyone.


Fetch Balance of wallet without Core wallets of all coin? I'm creating an exchange like service, I need some for showing all transaction to user like deposit and withdrawal but I'm not using core wallets of any coin, using paper wallets for wallet creation and I want to show balance of user and transaction. So, is there any API available for so that I can fetch such details of user? Please give such API for Altcoins also or provide me name of any wallet through which my task can be completed.

You can check the balance of an address even if it is not a core wallet by using block explorers. Here are two useful ones for checking the balance of a Bitcoin address:

https://blockchain.info/api/blockchain_api

and an Ethereum account:

https://etherscan.io/apis#accounts

You may wonder how it is possible to check the balance of an 'offline' paper wallet. It comes down to how Bitcoin (and other Bitcoin-like blockchains) work. At the most basic level, you have a private key. You can generate a public key from the private key and then an address from the public key. Bitcoins are sent to this address.

Blockchain explorers can check the balance of any address, even addresses that have not been generated yet! This is because an address is simply a string of letters and numbers that conform to a particular format.

You can read more about addresses here:

https://en.bitcoin.it/wiki/Address


Can a bitcoin exchange recover coins sent to a previous address used on said exchange? In my case, I withdrew from my exchange account from wallet ABC (if I look up the trx on block explorer, it says it came from public key ABC). A few weeks later I went to deposit more money into my exchange account, however I accidentally sent the bitcoin to wallet ABC instead of the nominated 'deposit address' on my account.

I'm freaking out that my coins may be lost. Would the exchange be able to sweep this wallet and credit it to my correct account?

Yes, it would be possible because they hold the private keys for that address. You will need to contact the exchanges customer support. However while they may be technically able to do so, they may not actually credit your account.


How many transactions per block on Ardor? Plans for scaling? How many total transactions are there in each Ardor block? Out of the total transactions per block, how many are child chain transactions? What are the limits and what types of scaling solutions are being developed to address these limitations?

If I'm right, the current hard-coded limitations are:

100 tx/block for main chain (block spacing is 1 minute)
100 tx/block for every child chain.

The current maximum capacity (if there were 100 child chains) would then be 10000 tx/minute (or about 160-170 tx per second), because child chains' transactions are bundled into a main chain ChildChainBlock transaction. A more realistic value would be 5000 (with 50 child chains), so there is space for 50 ARDR transactions per minute.

I guess that's largely a anti-spam measure and can be lifted once it becomes necessary. But even the "realistic" 5000 tx/min would mean about ten times Bitcoin's capacity. It would need relatively powerful nodes, but once child chain pruning is implemented, it would become much faster to sync and "catch up".

Waiting for an official developers' answer though ;)


Consolidate to one wallet service I've used a few different apps to create wallets and have decided to narrow down to a single web-based wallet software.  Is there some way that I can take the addresses from my other apps and import them to my new favorite service?

I'm not concerned about moving currently "owned" value, but rather leaving an orphaned address out there.  I'd hate for someone to send coins to an address that I can no longer access because I've uninstalled a particular app from a particular computer.

I will prefix this answer with the statement "Don't use a web wallet", but since your question explicitly states you want to use one, i'll leave my ideals at the door.
(Side note: Coinbase lets you use their "vault" in multisig mode, where you control the private keys yourself. Withdrawals take 48 hours to confirm, so perhaps it isn't ideal for you, but consider solutions where you retain control of your keys. I am in no way affiliated with Coinbase, other than using their service myself.)
Usually most wallets have an "Export private keys" feature, and  an "import" feature included. Which wallets in particular are you using?
This question indicates the following steps for Bitcoin QT:

To export a private key from your Satoshi bitcoin-qt client:

launch your bitcoin client as usual and wait for it to load the blockchain and start up
click on 'help' in the menu bar (top right)
click on 'debug window'
select the 'console' tab
type: walletpassphrase "your walletpassphrase here" 600
type: dumpprivkey [your public key here]
this will return the private key, you can copy it now; ensure you clear your clipboard/history afterwards
type: walletlock

For MultiBit, This page describes the steps to export:

In the 'Wallets' side panel choose the wallet you want to export the private keys for.
Select the menu option 'Tools | Export Private Keys'. The 'Export Private Keys' screen appears.
By default, the private keys file is called the same as your wallet file, only with an extension 'key' rather than wallet. You can see this in the following screenshot: [redacted]
If you want to output the private key file to a different directory or filename click on the 'Export to. . .' button. A file chooser opens and you can select the file to save to.
It is strongly recommended that you password protect your private key export files. To do this, click on the 'Password protect export file' radio button.
Enter the password you want to use in the 'Password' field and then repeat the same password in the 'Repeat password' field. If they match you get a little green tick on the right hand side.
To output the private keys to the output file specified, click on the button 'Export private keys'. The private key file is written and a success message appears. If the export of the private key file fails for any reason the error message is given on screen.
After the export file is written, it is then verified by reading the file back in again and checking the keys in the file match the keys in the wallet. A verification message is given if this is successful.

If you can indicate which wallet you're using, I can add the steps for exporting to this post. Additionally, if you want to import into a new service, you will first need to determine whether your wallets are hierarchical deterministic (HD). If so, the "private keys" are in reality a single key, which is used (in effect) as a seed for the entire set of keys in your wallet (theoretically infinite). If your web wallet supports HD key imports, you're all set, otherwise you're going to need to figure out how to extract the private keys for each public key you used, and export those.


100% double spending attack probability When we plot the attacker's computational power against the probability of double spending with a number of blocks equal to zero, we always get a chance of 100%.

This plot is based on the original white paper that models the probability of success as a Poisson distribution.

Is this correct?

Shouldn't the probability of success then be related to the computational power the attacker possesses?

It is implicitly assumed that the attacker performs a Finney attack, and hence gets a block for free. If the merchant accepts a 0-conf tx, the attacker will proceed immediately to release a double-spending block he has already computed, and thus succeed.

In any case, Satoshi's analysis is approximate, see https://bitcoil.co.il/Doublespend.pdf for a more accurate one (which makes a similar assumption).


What is the current maximum Bitcoin block size in MB? BIP141 specifies the following:

  https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#block-size

  Block size

  Blocks are currently limited to 1,000,000 bytes (1MB) total size. We change this restriction as follows:

  Block weight is defined as Base size * 3 + Total size. (rationale[3])

  Base size is the block size in bytes with the original transaction serialization without any witness-related data, as seen by a non-upgraded node.

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

  The new rule is block weight ≤ 4,000,000

Effectively, the theoretical maximum size is 3999997B although in practice this limit cannot be reached. In Bitcoin Core v0.15.1 the default value for blockmaxweight in block creation is 3996000B.

Using the following formula with a limit of block weight = 4000000 (yes, decimal MB):

Block weight = Base size * 3 + (Total size = Base Size + Extra size)

The limits are 4000000 = 1000000B * 3 + (1000000B + 0B) through 4000000 = 1B * 3 + (1B + 3999996B)

In practice, the Base size cannot be as low as 1B, for a single transaction we would expect the Base size to be at least several hundred Bytes and the associated Extra size to then be far below it's theoretical limit, however the theoretical maximum block size using the weight calculation extend from 1MB through to just short of 4MB in size, allowing for a traditional 1MB block with no Extra size through to a larger block containing solely Segwit transactions. The practical maximum size for a block containing solely Segwit transactions can only be estimated.


How do you tell if witness data has been tampered with? If you receive a block, how can you tell whether the witness data has been tampered with between when it was mined and when you received it?

Where in the block is the wtxid root, and how do you compute the merkle root of the witness data?

Quoting from BIP141:

  The commitment is recorded in a scriptPubKey of the coinbase transaction.

and

  A witness root hash is calculated with all those wtxid as leaves, in a way similar to the hashMerkleRoot in the block header.

Indeed, the witness merkle root seems to be computed in a similar way than the hash merkle root, since it calls the same function.

I guess you can just check if the witness data has been tampered with by just computing the witness root hash yourself and checking that it matches the stored one.


Transaction ID not found- Status still unconfirmed after a month? I did a transaction back to my bitstamp account on 23.02.2016 but it has not been received. Transaction ID:

1886e0c49ba43a842043fc84358a05d3faf69468c1547e1d2ef3e030b929f834

I do have the blockchain located on an external hardrive since it takes up so much space. Any help on how I can get the transaction to go through?

After 72 hours the transaction will get purged from the mempool if no miner has picked it up. Try resending the funds and include a transaction fee so that the miners will expedite your transaction.


A fee is added per kilobyte of data. That means 1000 bytes or 1024? Wikipedia says kB = 1000 bytes and KB = 1024 bytes.

Which one are we using for Bitcoin?

According to the Bitcoin.it-wiki page on Transaction fees are dependent on multiples of 1,000 bytes  (rounded up).

The above page cites Gavin Andresen's post on 0.8.2 Release notes:

  The default fee for low-priority transactions is lowered from 0.0005 BTC
  (for each 1,000 bytes in the transaction; an average transaction is
  about 500 bytes) to 0.0001 BTC. [emphasis mine]


Are the indexes generated by txindex=1 persisted to disk? I'm running bitcoind with the option -txindex.

$ bitcoind -txindex

it seems to be taking around a day to fully index the whole blockchain.
(I'm using a raspberry pi 4, 4GB of Ram, with an external Hard Drive).

If I shutdown bitcoind and restart, is it going to reindex all transactions again or just load the indexes from disk?

The transaction index is persistent, and bitcoind will pick up where it left off if it is shut down and restarted.

Note that you must start it again with the -txindex option set, or any new transactions it processes will not be indexed. However, with recent versions of bitcoin, it will still maintain the partial index if you forget to set the option, and only reindex blocks for which it wasn't set if you set it again, which is considerably faster than having the entire index deleted and recreated if you forget the option once.


What does PSBT stand for? What is PSBT? What does it stand for?
bitcoin-qt has menu items "Load PSBT from file…" and "Load PSBT from clipboard…"; the dialog box says the file format is "Partially Signed Transaction".

It stands for "Partially Signed Bitcoin Transaction".
Bitcoin Core's documentation describes it as:

PSBT is an interchange format for Bitcoin transactions that are not fully signed yet, together with relevant metadata to help entities work towards signing it. It is intended to simplify workflows where multiple parties need to cooperate to produce a transaction. Examples include hardware wallets, multisig setups, and CoinJoin transactions.


What can you do in case the number of blocks becomes greater than the maximal number of files that can be stored in a file system (ext4, FAT, etc.)? In this case (which has actually happened to me), if I sync all blocks, they fill up the whole file system table of the volume.

What is the best way to solve it? Using one directory that is split over multiple volumes? How can you achieve that? Using symlinks or junctions?

There is also a limit of files per directory. This means that the entire copy of the blockchain database should be split over a double amount of directories each time it reaches this threshold (like dynamic hashing).

I tried to search for solutions that address these issues, but I simply couldn't find anything, like nobody has ever thought about these situations.

This is an issue of inodes, a feature mainly in Unix filesystems (like ext4) which is a fixed-size table storing metadata of all files on the partition. When the partition is created, a fixed number of inodes is created.

On my 500GB drive using the default ext4 from Ubuntu, I have 27 million inodes (this can be checked using df -i if you're on Linux), many times more than the number of Bitcoin blocks in the blockchain. Thus I don't run into this issue, and I imagine most people don't - it's possibly something to do with the specific filesystem/setup you're using.

ext4 specifically doesn't have a cap on the number of files in a directory, so splitting the files into multiple directories would be unlikely to help. FAT32  however has a limit of 65,534 files per directory, the solution there is not to use an outdated filesystem like FAT32.

Generally there are two ways to approach this sort of issue:

Increase the resource (make more inodes)

This can be done by specifying a larger number of inodes when creating the partition, which is relatively easy to do (example) but requires foresight that you're going to be running a node on the partition. Alternatively, make another partition with the required number of inodes.

Use the resource more efficiently (use fewer inodes).

Perhaps the simplest way to achieve this is to just stick multiple blocks in a file - I'm not sure how this would work from an architectural point of view but it's something that would have to be implemented in the client.


Can synchronization be interrupted and continued later? I was using the official Bitcoin client some time ago.
It was version 0.5 I think. Then my computer crashed and didn't use Bitcoin for a long time.

I was lucky because I had a backup of the wallet.
Today, I installed the latest version and it's different.
It is running for many hours now but it's still at 18-20 %.

Should I leave it as it is or I can turn off my PC and continue tomorrow?

If I use my old wallet, will it start from the begining?
If yes, is it better to stop the software,
delete everything, replace wallet and start all over again?

It takes a long time (maybe a couple of days) to download the entire blockchain. You can interrupt it at any time and it will continue where it left off when you restart the Bitcoin client.

The blockchain (which is the public transaction ledger) is independent from your wallet (which is your private keys). You can load your old wallet into the Bitcoin client at any time.


Could someone provide an example of a tx spending from an input with a relative LockTime? I want to see an example of a raw transaction which spends from an input which has a relative LockTime applied to it. An example would be a transaction from a Lightning payment channel in which a user force closes a channel and claims their 'local' balance, after having waited for the 'to self' delay in their commitment transaction.

It would be very helpful for understanding how to spend from an input encumbered with a relative LockTime.

If you look at https://blockstream.info/address/bc1qdv0fk4c73fem89s708pzdny8q25d7k5nrckckp87c8alwaw803fq3mqrpz you will see that there are two transactions.

The first one  https://blockstream.info/tx/943f18e17aa2ba716f2d13785268a1bd6b25c39d2718f3b4785559a5eeaba883 is the funding TX to open the payment channel included in block 587093 (at least according to what was send over gossip)

The second one https://blockstream.info/tx/a175425ee2f3c01acc97ef32ab1082db14eaa94e5af4c54f02f3b01dec72558e is the force closed timelocked commitment tx included to block 587314

The output 0 of the commitment tx has a relative timelock and was self spend / sweeped with this transaction https://blockstream.info/tx/0be2b9a3a6a9dc99443d6ce7bd3beaf33c713a4938af3bf0fec1e918257bbd32 which was included in block 588801

If you decode the transaction you see nothing special

304402204a54d94068512c22847cc07fa85f2b93feaf758411920a9b20ce9b85831e8aa5022005924cb82c331c5173e21477a4d8298eb25c0d967ace065b883455f2537c3d0a01 <empty> 632103f96d73ffe138690f032e97408af933a71782ad27a28df66a750b48c56b2d7fa96702cf05b275210304f332f50363cd01b679d9fb50fb8691fb0fb638737867bd02f06850c6191a2268ac

p2wsh witness script
OP_IF OP_PUSHBYTES_33 03f96d73ffe138690f032e97408af933a71782ad27a28df66a750b48c56b2d7fa9 OP_ELSE OP_PUSHBYTES_2 cf05 OP_CSV OP_DROP OP_PUSHBYTES_33 0304f332f50363cd01b679d9fb50fb8691fb0fb638737867bd02f06850c6191a22 OP_ENDIF OP_CHECKSIG

nsequence
0x05cf

previous output script
OP_0 OP_PUSHBYTES_32 c9452fef6bd1c72c8648d6ac78ce552543a1e5bf80a470fb259ff670aa5ced26 (v0_p2wsh)

However you can observe the nSequance = 0x05cf which encoded in decimal is 5*256 + c*16 + f = 5*256 + 12*16 + 15 = 1487

As the commitment tx was included in block 587314 the timelocked spend from it would have been rejected any block earlier than 587314 + 1487 = 588801 which was exactly the block height of the third tx.


Import all existing addresses in local bitcoind I started local bitcoind client. And started it as RPC server. I know that i able to get balance only for my account address. But how i can work with all existing addresses? How i can get balances and txs? Maybe exist some db for this?

You can import any address you want to watch or "work with" by navigating to console window and sending the following command:

bitcoin-cli importaddress "address" "account" <rescan>

after blockchain scanning complete you can send

bitcoin-cli listtransactions "account" "Count" "skip" watch-only
bitcoin-cli listtransactions "*" 1 0 true

So you get all transactions.

You can get all commands from bitcoin.org


Number of bitcoind peers drops precipitously every 30 days or so I run bitcoind headless on a linux box with maxconnections=256 and port 8333 open on the router. Using Bitcoin Node Manager I monitor node status occasionally. Peer count of course starts at 8 and slowly, over the course of three or four weeks, ramps up to 150 or so. Roughly every month or so the number of node drops precipitously to less than 20, then starts climbing again. I can verify via the logs that bitcoind did not restart and that my network did not go down. I have a second node that runs solely over TOR and while it does not have an many peer connections, its peer count doesn't fluctuate in this way.

Does anyone else notice this?
Any ideas what might cause this?
Any tips on how (or even if) I should troubleshoot this? (i.e. things to look for in the logs)

Being doing my own diagnosis on this issue. I have bitcoind and lnd running on the same raspberry pi, as per the excellent Raspibolt guide by Staticus. I wrote the following script to log both daemons' cpu usage, mem usage and total number of bitcoind peers:
#!/bin/bash
echo \
"$(date +%D,%T),"\
"$(ps -U satoshi -o comm= -o %cpu= | grep bitcoind | awk '{print $2}'),"\
"$(ps -U satoshi -o comm= -o %mem= | grep bitcoind | awk '{print $2}'),"\
"$(ps -U satoshi -o comm= -o %cpu= | grep lnd | awk '{print $2}'),"\
"$(ps -U satoshi -o comm= -o %mem= | grep lnd | awk '{print $2}'),"\
"$(/usr/local/bin/bitcoin-cli -conf=/etc/bitcoin.conf getconnectioncount)" >> /home/satoshi/bitcoin_connections

My issue may be simply allowing too many connections to my daemon. As peer count grows, mem usage does as well. When it gets to 130+ peers total system memory usage is >80%. My issue may simply be an issue with running out of memory. I'll edit this post when I have more results.
Edit:
It seems that as I get to around 120-130 peers the combined mem usage of bitcoind and lnd exceed 60% of the 1 gig on my RPi, pushing total mem usage over 90%. At that point peer count drops off. I presume the daemon starts to respond very slowly as memory runs out and other peers drop mine. I set maxconnections=125 (default) and the daemon has run for weeks without issues. Since 125 is the default, the same result could be achieved by commenting out the maxconnections line in bitcoin.conf completely.


How does one lock their own Bitcoins for X amount of blocks and prove that you locked it? Is there a method of locking Bitcoins for X amount of blocks and also being able to prove its locked? How would one do this and with what wallet? Mobile wallet possible?

Reason why is I'd imagine one can build some interesting applications for this if you can PROVE you locked the coins for X amount of time. What if there was some type of bounty reward paid if X amount of bitcoins was locked for say 1-5 years?

You could send your Bitcoin to an address that has a redeem/witness script containing OP_CHECKSEQUENCEVERIFY (for a relative timelock) or OP_CHECKLOCKTIMEVERIFY (for absolute timelock). Once the transaction has confirmed, the output cannot be spent without the timelocks being met first.

By revealing the script, you can show that those outputs have a locktime and thus cannot be spent until after that locktime passes.


Will transaction confirmation time be reduced as the network size increases? Right now it takes 6 confirmations, which takes about an hour to verify a transaction. Will the rate at which transactions confirm become faster over time?

No. The average time per confirmation will always be about 10 minutes (but it's possible that the variance will be lower in the future). And the number of confirmations required to prevent double-spending by an agent with a given hashrate will also not change (6 is an arbitrary number reflecting a "low enough" probability for someone with a "high enough" hashrate).

What will change is services to bridge the gap. There will be split-key eWallets which cannot steal your money on one hand, and can have trusted green addresses on the other; and there will be insurance agents such as https://zipconf.com/ that absorb confirmation risk based on their model of the probabilities of double-spending.


Impossible to restore Copay wallet on new phone I just changed my phone and reinstalled Copay.
I'm trying to restore my BTC Wallet from the 12 words key phrase i saved, but copay keeps telling me "impossible to import.Wallet Recovery sentence is invalid".

Anyone has an idea?

Anyone has an idea?

Use a spelling checker on your twelve-word recovery phrase.

Even better, use a tool to check the phrase against the appropriate BIP39 dictionary for your language.

Example

>wordcheck able moose zoo
able                           - OK
moose                          - Not in bip39 dictionary
zoo                            - OK

Source: https://github.com/redgrittybrick/wordcheck

Compiler: https://golang.org/


View backed up wallet.dat using sqlite browser I backed up my wallet.dat using the command as mentioned in the api ref:
bitcoin-cli -rpcport=18332 -rpcuser=user -rpcpassword=password backupwallet "/bitcoin/backup.dat"
I would like to view the backed-up db file using 'DB browser for sqlite' (or any other sqlite browser). However when opening the db file it prompts for the password / key to decrypt the wallet file.
Which password / key is it referring to? When creating the backup I didnt specify any password or key..

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

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

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

...

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

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

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

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

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

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


How to detect a race attack and re-spend the already-spent outputs? My service automatically accepts, processes and sends payments to its users. It connects to bitcoind through its JSON-RPC API and makes use of the raw transactions interface.

What is going to happen in this case:

The service receives 3 payments by 3 different users.
All payments are included into the next block so they now have one confirmation.
Upon one confirmation, the service forms a new TX that spends these 3 outputs. The appropriate fee is attached. The TX is now valid but unconfirmed.
A few seconds later a double-spend attack in one of the TX's (now-spent) outputs comes in place.

As I find it hard to reproduce the scenario above, my question is:

What is the best way for the service to detect this double-spending attack through the RPC API?
Once it detects the double-spending and realizes that the TX will never get confirmed, can it re-spend the same outputs (not including the one that has been double-spent) right away in the case of a race-attack?

As Doug said in the question comments (posted here as an answer by his request):

  If there is at least 1 conf by the network, a race-based double-spending attack is not possible.

Therefore the attack he describes is a fork-based double spend similar to his questions here and here.


What is a mnemonic frequency analysis and why do I only need 4 letters of my seed words? Cryptosteel only allows to store the first 4 letters of each word of my mnemonic seed, the FAQ tells me why:

  [...] you only need to assemble the first 4 letters of each word. Those 4 letters are unique and sufficient to recover the sentence and the entire bitcoin wallet. We did a frequency analysis and determined the minimum set of letters that are needed to create the Cryptosteel.

What is a mnemonic frequency analysis? Why do I only need the first 4 letters?

I am only using a mnemonic seed in the Greenbits Android wallet by GreenAddress. However, it uses 24 or 27 word phases and not 12. I tried to recover my seed from only the first 4 letters, but the wallet complains that some of them are no real words.

I'm assuming GreenAddress is using something different to BIP39 seeds and the first 4 letter rule does not apply to all seeds, is that correct?

There are multiple questions being asked here.

Firstly, some background info. BIP39 is a standard that includes word lists.

The English one can be found at https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt

  What is a mnemonic frequency analysis?

This is a fancy way of them saying that they figured out the minimum number of letters they need to store to uniquely identify what word from the word list you meant.

I'll do an analysis of a tiny word list (these words are in BIP39) right here as an example.

Imagine this is my word list:

abandon, ability, crane, crash.

It only has 4 words in the whole list, so the analysis is pretty simple.

Now, the longest words are "abandon" and "ability" at 7 each.

Noticing this, I could say at this point, that as long as I know up to the first 7 letters of any word in the word list, I can tell you what word it is in the list. This isn't very impressive though as I'm handing you back the same words you give me.

Alternatively, I could start from the lower end and see that simply knowing whether the first letter is a or c, I can already tell you which half of the word list your word is in.

The 2nd letter gives me no extra information as it will either be ab or cr - these are the only options.

The 3rd letter allows me to distinguish between abandon and ability but tells me nothing about words starting with cra.

The 4th letter, however, allows me to fully and uniquely differentiate every word in my word list.

1-letter frequencies

a = 2
c = 2

2-letter frequencies

ab = 2
cr = 2

3-letter frequencies

aba = 1
abi = 1
cra = 2

4-letter frequencies

aban = 1
abil = 1
cran = 1
cras = 1

Related xkcd: https://what-if.xkcd.com/34/

  Why do I only need the first 4 letters?

Because the analysis that cryptosteel did on the full BIP39 wordlist (not just my toy 4-word-long list) also had the same result - no more than 4 letters were needed to retrieve any unique word from the list.

  I am only using a mnemonic seed in the Greenbits Android wallet by GreenAddress. However, it uses 24 or 27 word phases and not 12. I tried to recover my seed from only the first 4 letters, but the wallet complains that some of them are no real words. I'm assuming GreenAddress is using something different to BIP39 seeds and the first 4 letter rule does not apply to all seeds, is that correct?

It is correct that the "first 4 letter" rule does not apply to all seeds. It is specific to the word list used in BIP39, so it would apply to seeds using the same word list, and likely seeds using a very similar list, but not at all to totally different lists. Additionally, not all the BIP39 word lists are in English so the "first 4 letter" rule may not apply to other languages in BIP39 (could be interesting to research).

Without having prior knowledge of the details of GreenAddress, you haven't provided enough information for us to know what GreenAddress is doing with its seed.

We can't know just from the length of the word phrase (12, 24 or 27) whether GreenAddress implements BIP39. Their FAQ mentions BIP32 (HD wallets) but not BIP39 (the specific wordlist for the seed), so that's also inconclusive.

Assuming that they do support BIP39, the error message you are seeing is still reasonable. It would just mean the software is programmed to only accept a 100% match against a word from the word list, not partial matches, even if that partial match would be unique.

Some wallets will autocomplete the BIP39 word for you as you type to work around this problem (or accept the 4 letter version of the word), but you can always do the lookup by hand for any BIP39 compatible wallet that doesn't make it easy for you.

For example, if your cryptosteel has the letters enve stored in it, you can refer to the word list I linked above to find the word envelope.


Faster way to sync my new Bitcoin wallet? I'm very new to Bitcoin so I apologize if this question is naive. I just downloaded the Bitcoin, Litecoin, and Dogecoin Qt clients and opened each of these apps. Consistent with their coin's valuation, the Dogecoin client syncing was fastest, taking 3 hours, Litecoin took 20hrs, and Bitcoin is still trying to sync for 3 days now (progress bar shows only 25% synced).

I'm using a 2012 MacBook Pro (10.7.5) and have a good internet connection in a major city.  Some questions:

Is there a faster way to sync my Bitcoin wallet than what I described or is the Bitcoin Network just too popular now and one should expect a new wallet to take +10 days to establish?
To begin with, is putting your own wallet on your computer not advised?

The blockchain is available via Torrent now. You can download bootstrap.dat (14GB) this way and then process it locally, which in my case was much faster than syncing with network using Bitcoin-Qt.

Have a look at the announcement and you can grab torrent file from sourceforge.


Can you add more Dash to a masternode that already has 1000 Dash allocated for a masternode? If I had 2000 dash and made a master node with it. Do I get double the rewards vs a masternode with 1000 dash? Or do I have to separate the 2000 dash into 2 separate 1000 dash masternodes, hence running two nodes on the same computer or separate? How would one take advantage of this if they have more than 1000 dash?

You would have to create 2 masternodes and you would earn double the amount of Dash, and run separate nodes, probably on different computers as Dash requirements are sort of high.

Also you would need a server running 24/7 with 2 different IPs for the nodes.


Security risk(s) in running bitcoin core full node What are the security risks posed by running a full node bitcoin core client? On a typical system, port 8333 is open and all other nodes can actually 'see' my machine and sites like https://bitnodes.earn.com/ can verify the connection.

How can the risks be mitigated? (I'm on Windows)

1) None. Don't open the port (default).

2) None required.
Obviously you don't want to download Bitcoin Core binary from random sites, you want validate it, etc. as per bitcoincore.org's instructions.


Completely confused with mutisig address and scripts I used the guide, how to make escrow from bitcoin console.

Here are my transactions in testnet: tx1 tx2

I am confused about ScriptPublicKey in tx1:

OP_HASH160 a7a62637430b44c922cbce4fc8bd53d11b7c4c25 OP_EQUAL

So it is just calculate Hash160 of top stack value, and compare it with a7a6...25.
In the ScriptSig of tx2 we can see 4 values, which will be pushed to stack for validation. But vout script uses only the top stack value:

5221020678adff50855b6748e93ab03667968817363fff84306d7ffc13276191fd7f542102bff39dce7ae4c6a06104ac4e49948eb7bac9d4a82e9e16df41b1436d31b76f0052ae

Other 2 values are signatures:

304402205fdee0b00f5e2fa07324458fe06b47a41bb2ef4e73892343796e9f6456e378940220630b423ce14b0d5ed487da751c368d7fc0122efa21cac1a4afce7c3c017bf29f01
304502205edb6ce77a772346b21d60a775c81f52bec9e8957f795fce7ea4fab862bc656c022100fc1376399134348fae516d6e627b1f72c094affd3ba2f458685bdbe9b6a51f5e01

As we can see, this signatures are not validating by vout script.

And why this functionallity does not work with OP_CHECKMULTISIG?

Take a look at BIP0016.

  This new transaction type is redeemed by a standard scriptSig:

  ...signatures... {serialized script}

And...

  {serialized script} is popped off the initial stack, and the transaction is validated again using the popped stack and the deserialized script as the scriptPubKey.

In this case, {serialized script} is {m [pubkey1] [pubkey2] ... [pubkeyn] n OP_CHECKMULTISIG} for a m-of-n transaction. When Bitcoin detects one of these special transactions, the serialized script is popped of the stack as soon as its hash is validated (you're validating the script hash! not an actual public key!) and then executed with the remaining stack intact.

Your payment script looks like this:

0 /* null element because a bug pops one-too-many items */
304402205fdee0b00f5e2fa07324458fe06b47a41bb2ef4e73892343796e9f6456e378940220630b423ce14b0d5ed487da751c368d7fc0122efa21cac1a4afce7c3c017bf29f01
304502205edb6ce77a772346b21d60a775c81f52bec9e8957f795fce7ea4fab862bc656c022100fc1376399134348fae516d6e627b1f72c094affd3ba2f458685bdbe9b6a51f5e01
5221020678adff50855b6748e93ab03667968817363fff84306d7ffc13276191fd7f542102bff39dce7ae4c6a06104ac4e49948eb7bac9d4a82e9e16df41b1436d31b76f0052ae

The last part (5221020678...52ae) is actually your serialized script. If you decode it you get:

2 020678adff50855b6748e93ab03667968817363fff84306d7ffc13276191fd7f54 02bff39dce7ae4c6a06104ac4e49948eb7bac9d4a82e9e16df41b1436d31b76f00 2 OP_CHECKMULTISIG

Which is a 2-of-2 transaction!

The first two parts not including the null element (the ones that look like 304...01) are just your provided signatures which are going to validate against the serialized public keys when OP_CHECKMULTISIG is executed.


Recover keys from legacy blockchain wallet's mnemonic? I have an old blockchain wallet that is worth trying to salvage

It seems the old password that the 18 word mnemonic originally had isn't working and another password I had listed also doesn't work.

I used their tool and it shows the original password.
I also have the wallet backup json file.
I have the email address for this account (I see all the notifications)

Can I derive the keys from either the mnemonic or json with the original password or perhaps with no password?

And has anyone be able to get blockchain to 'backup restore from an earlier date' like it says they can on their legacy mnemonic page?

The legacy blockchain.info mnemonic does not correspond to any private keys. Private keys are not derived from that as blockchain.info did not use HD wallets when they had those mnemonics. Rather the mnemonic is an encoding of your blockchain.info password.

In order to get your private keys, you will need the JSON file as that is what contains the private keys. If you know your password, the mnemonic is useless. If you don't know your password, get it using your mnemonic.

Unfortunately I don't think you can use blockchain.info JSON files outside of blockchain.info (at least not easily). You can try importing it to a new blockchain.info wallet using this: https://blockchain.info/wallet/import-wallet


I created a ripple account ... what next? (how do I start?) I have a ripple client set up, but I can't do anything useful such as viewing the order book etc.  Since the site is in beta, BTC and other currencies are not supported... only ripples.

Basically I know I need to give people my address of rPZhwqx7kQdssJD6i3cnEpd9kQ1Tofzjkx to get ripples, but I don't know who to contact or how to get started.

The teaser website and hype around the Ripple technology hasn't gotten me to pour over every detail of the Ripple wiki, so please forgive me if I missed it.

So how do I get started?

To see an active Bitstamp BTC IOUs vs. XRP market do the following:

Advanced -> Trade -> change issuer

Enter rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B which should then fill in BTC Bitstamp.net

Click on "Order Book" to see BTC/XRP offers.


Where is the code that receives blocks that miners have just solved I was just looking through the Bitcoin code but since I am relatively new to C++ I was wondering, if anybody could tell me where the code responsible for receiving blocks that have just been mined by someone else is located.

My understanding is that when a miner successfully solves a block, it is broadcasted to the entire system. What I am looking for is the code responsible for how that broadcast is intercepted by other nodes if that makes more sense.

Thanks.

Look in main.cpp at the ProcessBlock function. The meat is in the AcceptBlock function in the same file.


Unomp does not support asic boost I setup my unomp server and connect a cpuminer/minerd to it to mine bitcoin. Everything works like a charm. Then I connect my INNOSILICON T2 to it to mine bitcoin, it gives the following error:

[2018-12-24 20:00:33.857] [DEBUG] [default] - Pool bitcoin Thread 3 Unknown stratum method from (unauthorized) [ip]: mining.configure.

Does anyone know why? Maybe unomp does not support new "mining.configure" extension introduced in stratum protocol to enable asic boost? If so, what are unomp alternatives that support asic boost?

UNOMP is no longer maintained and development of it stopped before the introduction of Asicboost into stratum. Thus it does not support using Asicboost.

CKPool is a mining pool software that that does support Asicboost.


How does Bitcoin decide which Alert messages to forward? The Bitcoin protocol lists an Alert message that in the Standard Client is displayed to all users. How does the Standard Client decide which messages to forward and display, and which to ignore? Does it respond only to predefined signatures of the developers, or can anyone send their own alert messages to the Network?

As described in the Alerts article on the Bitcoin wiki:

  Only alerts that are signed by a specific ECDSA public key are
  considered valid. A copy of the private key is held by at least
  Satoshi, Gavin, and theymos.

All alerts that have not expired are relayed but the client displays only the highest priority alert that hasn't yet expired and wasn't cancelled, I believe.


Why doesn't my balance bought on Coinbase show up on Blockchain.info? I've been trying out different Bitcoin services and I've run into a bit of a conundrum with Coinbase. I purchased a small amount of Bitcoin several days ago and this morning, the transaction was marked as complete and showed up in my balance. However, the listed address under Account Settings > Bitcoin Addresses has no history and no BTC associated with it when viewed on blockchain.info.

Is this expected behaviour? The initial purchase stated that the bitcoins would arrive by the end of the day today. Does this mean that the "completed" transaction is not in fact complete yet and I'm still waiting on Coinbase? I've emailed Coinbase about this matter as well and will update this post in any case. Just figured I might get a faster response from more experienced users here.

EDIT: Just found this post and I suspect that it serves as a sufficient answer to my question. If anyone else has any comments to add, please do :)

Yes this is expected behavior, Coinbase is not a full wallet and that means the funds under addresses it shows you are completely irrelevant. When you withdraw to an address, Coinbase will send the amount specified.


PayJoin privacy only works with specific output sizes? In the specific example of PayJoin here: https://en.bitcoin.it/wiki/PayJoin the wiki equates a PayJoin transaction as indistinguishable from a regular transaction.

However the transaction example itself seems a little weird and potentially misleading.  In a regular transaction, if I have a UTXO of 2 btc and another UTXO of 5 btc, an attempt to send that results in an output of either 3 or 4 btc would be best served by using the 5 btc input only, as this would create a smaller transaction than needlessly using inputs of 2 and 5 btc (it would also needlessly link two addresses); we can postulate a rational coin-holder would never construct a transaction with more inputs than required.

So it would seem that to make a PayJoin transaction genuinely indistinguishable from a regular transaction, one of the PayJoin outputs must be larger than any single input.  If in the example the merchant and customer wished to exchange 5 btc, then outputs of 6 btc and 1 btc could be created, which would absolutely justify combining a 5 btc and another input of at least 1 btc.

Am I correct, or have I made some oversight?

we can postulate a rational coin-holder would never construct a transaction with more inputs than required."

I don't think this is necessarily true, a user may create transactions with unnecessary inputs in order to confuse such privacy-attacking heuristics. It is in the user's interest to retain some privacy, after all.

Privacy is complicated, but if payjoin transactions became more common-place, and wallets also created pseudo-payjoin transactions some fraction of the time, then the general idea is that some of the heuristics used to group addresses would become much less effective.


Input script is very simple which returns 1.

You can not spend from 2Muf8gJV81wa93smDeiy7X777BJcppBR5uP with this scriptSig. Do not pay attention on the error message. Your transaction IS invalid

https://testnet.smartbit.com.au/address/2Muf8gJV81wa93smDeiy7X777BJcppBR5uP


Would it be possible to make Trophys / Achievements from bitcoin experience One Trophy could be: "First output signed"
And many more milestones on the road to the more advanced usages of the network: "First multisign/multispend", "First completed ANYONECANPAY transaction"

Would that be possible?

So the user would sign a message with the address used to do these actions, and send it to a "bitcoin trophy" website. Then parsing of the blockchain would pick out the events that awards a Trophy for that user.

How can anonymity be conserved, so that a user would feel safe to collect more Trophys?

Yes, that could be done, if you use Tor to connect to the website and if you don't spend the coins from those addresses at places where your identity could be tracked (i.e. tumble them first).


Where is data stored in paper wallet? I have a question about paper wallet. I can print paper wallet using walletgenerator.net. But I am confused about how the things works, where is the data about wallet coins stored? Is there global database of all wallet addresses and transactions? How my public key is paired with my wallet when somebody tries to send me coins?

Is there global database of all wallet addresses and transactions?

Yes, it is called the blockchain.  You can browse it through various websites, called block explorers: e.g. http://blockchain.info, http://blockr.io, http://blockexplorer.com.  If you use full node software such as Bitcoin Core, you will download a complete copy of this database (currently over 120 GB).

  How my public key is paired with my wallet when somebody tries to send me coins?

The paper wallet contains a private key and an address.  From the private key one can compute the corresponding public key, and the address is a hash of the public key.  You can give your address to anyone, and they can send coins to that address; this means that a transaction is recorded in the blockchain showing a credit of coins to your address.  Other than your address, this doesn't need any further information or involvement from you.

You only need the private key when you want to spend those coins.  Importing that private key into wallet software, you can make a new transaction to spend the coins that were sent to you.  The private key is needed in order to sign the transaction and prove that it is authorized by you, the rightful owner of the coins; but this process does not reveal the private key to anyone else.  (As part of this process, the public key will be recomputed from the private key and included in the signature.  That is easier than including the public key on the paper wallet.)


Are there alternatives to ButterflyLabs? there's something I want to address... I want to get into mining business, but the problem is that BFLabs has that problem of delays and uncertainty for the shipping date. I want to buy 5 rigs of 500 GHash/s each one, but to have nearly $120k USD stuck for how much time who knows...

Is there any alternative to BFLabs? One that that at least have shipping dates estimates. Many thanks to all.

There are USB ASIC mining equipment on ebay from the company ASICMinner called Block Errupter listed under which is in hand and able to ship imediatly however it is $150 per 333MH/sec which means it would take 2k to reach 5GH/sec. You can order a 5GH/sec BFL for 2.6k and have it shipped today on ebay. However with the price of Bitcoins droping it would be wise to consider profitability using bitcoinx before making a purchase. Also you can contract out your mining http://coinminer.biz/ offer a reasonable rate for a single year.


Cancelled: You need some ETH in the same address as your token to pay the gas to send it I have a problem in exchanging my altcoins, when i tried to convert TokenCard to Ethereum it is showing the following message:

Cancelled: You need some ETH in the same address as your token to pay the gas to send it!

I'm using shapeshift.io for the conversion.

What could be the reason for this?

TokenCard is an ERC20 token issued on the Ethereum platform.
In order to transact on the Ethereum blockchain, you must have some Ether in your account to pay for the transaction. Once you have a small amount of Ether in your account, the transaction will go through.

Check the latest transactions using Etherscan here:
https://etherscan.io/txs

In the TxFee column, you will see the fees for the latest transactions.
The fee goes to miners. Transactions are sent to the Ethereum blockchain and miners gather the transactions into blocks. The fee is the reward they get for doing this work. The Ether will be deducted from your account.

Ether is the name of the currency used within Ethereum.
It is used to pay for transactions on the Ethereum blockchain.
This is done indirectly by purchasing gas for ether as explained in gas here:
http://www.ethdocs.org/en/latest/ether.html#gas-and-ether


blockchain.info multi address lookup https://blockchain.info/api/blockchain_api

multi address

I know I must be an idiot but I cannot for the life of me find out how to pass in the &limit param.

I am looking to pass in a limit of 0 because I am not interested in tx, just in balance on multiple addresses.

For example in their single address lookup:
https://blockchain.info/rawaddr/1NiNja1bUmhSoTXozBRBEtR8LeF9TGbZBN?limit=0
works exactly as expected.

If you are only interested in the balance of multiple addresses I would suggest you use the following call in stead:

https://blockchain.info/balance?active=1NiNja1bUmhSoTXozBRBEtR8LeF9TGbZBN|1MrkWMnWLW53SQVQ5Pd2BsugY1F8H1oKio

But if you need to use multi address the limit flag seems to be wrong in the documentation, it should be 'n' and the minimum limit allowed seems to be 1. 0 will just return all transactions anyway.

https://blockchain.info/multiaddr?active=1NiNja1bUmhSoTXozBRBEtR8LeF9TGbZBN|1MrkWMnWLW53SQVQ5Pd2BsugY1F8H1oKio&n=1


How can Bitcoin solve societal problems caused by capitalism? While trying to explain Bitcoin to a friend, her response was:

  To me this sounds like just an other monetary system which can be
  speculated on while making some people rich and keeping others poor. How
  does it attempt to solve deep rooted problems in our society caused by
  globalisation and capitalism?

She was of course referring to geographic and social inequalities, exploitation of workers, political oppression, depletion of natural resources, etc.

What are some of the ways decentralised proof-of-work currencies (and their underlying protocols) can work to improve these aspects of our society?

Bitcoin itself, although conceived from an ideological background doesn't have an agenda. It is a tool. It will not solve societal problems by itself, but might help alleviate some issues, by providing competition to current solutions. Especially, wealth distribution in Bitcoin itself isn't better than in other currencies (see e.g. Business Insider on Wealth Distribution in Bitcoin, BitcoinTalk on Distribution of Bitcoin Wealth).

International Remittances

Bitcoin enables its users to send money for minuscule fees around the globe. This could be especially beneficial to foreign workers that want to send remittances to their families in developing countries.

Currently, they are dependent on expensive services such as Moneygram or Western Union and lose up to 15% of the sent money in fees. Additionally, the recipient needs to go to the next money transmitter shop to pick-up the money. In many instances this is a trip of hours.

The Unbanked

Bitcoin doesn't require its users to have a bank account, as any form of internet access is sufficient to send and receive Bitcoin. Today, there is an enormous number of people without bank accounts. For example there are about 10 million unbanked or underbanked households in the US. In developing countries more than 50% of the populations are unbanked, women more so than men.

Without a bank account, you are either unable to use or significantly disadvantaged regarding a wide-range of services, such as credits, saving, insurance, payment for contracts, and internet commerce. See for example: Guardian on mobile banking for the unbanked.

Bitcoin could provide an easy access and cheap payment system for many of these services. It could be significantly cheaper than current payment systems such as M-Pesa, and have additional advantages by not being centrally run.

Censorship

No user can be locked-out of Bitcoin. On the other hand, it is well known for such things to happen in centralized payment systems for various reasons: eBay and Paypal exports Embargo, Paypal blocks donations to Diaspora. This is especially important for protest movements that might be shut-down by their government, think Wikileaks, Occupy Wallstreet, or Social equality movements in repressive states.


Bitcoin Blockchain - Verification process As the title states, basically my question is about the blockchain verification. I know whats a block chain and basically understood how mining is working, except once simple thing.

Let's say we have 2 guys, Bob and Adam.

Blockchain:

    |1|-|2|-|3|-{4}   - Bob Chain
    |1|-|2|-|3|-{4}   - Adam Chain

Assume both Bob and Adam found a new block, but it will not be verified until someone finds a next block. So my questions is whats is happening in a situation if Adam will find a block |5| first. Will Bob get his reward for finding a block? Or it means if Adam found one block, he has to find the next one which is extremely difficult without a huge network of computational resources in order to verify his previous block |4| and get reward for block 4 of 12.5 bitcoins, because the nodes will only accept the longest blockchain? I hope I clearly illustrated the picture. I've tried to find the answer in different videos and materials but somehow this aspect was put aside. If my assumption is true, it means there is no way how can a single person to earn anything from mining without a huge network ?

Assume both Bob and Adam found a new block, but it will not be verified until someone finds a next block. So my questions is whats is happening in a situation if Adam will find a block |5| first. Will Bob get his reward for finding a block?

No. If Adam finds block |5| first and it is a valid block, Adam will quickly broadcast this to the bitcoin network and the proliferation of said block will take place very quickly across the entire bitcoin network. Nodes that receive Adam's block 5 will also start to orphan Bob's block 4 since Adam's block 5 is now the tip of the longest, valid chain. Other miners will also quickly switch to mine on this block tip to avoid mining on an orphaned block.

  Or it means if Adam found one block, he has to find the next one which is extremely difficult without a huge network of computational resources in order to verify his previous block |4| and get reward for block 4 of 12.5 bitcoins, because the nodes will only accept the longest blockchain?

Not necessarily. Once Adam's block (i.e. block 5) is broadcasted, another miner might be lucky and they could extend block 5 to block 6. Adam's block will remain as part of the canonical chain.

  If my assumption is true, it means there is no way how can a single person to earn anything from mining without a huge network ?

More or less true. Your chances of finding a block is based on your hash rate proportional to the network hash rate. Under today's conditions, the probability of a solo miner finding a bitcoin block is very small, but still a remote possibility. Therefore, we have mining pools in bitcoin.


How can I determine the number of confirmations of a transaction and its fee using the Blockchain.info DATA API? How can I know if any given transaction has confirmations and has paid the miner's fee, using the BlockChain.info DATA API?

If a transaction returned from the http://blockchain.info/rawtx/$tx_hash endpoint has a confirmation, it will have a block_height member. You can then calculate roughly its number of confirmations by subtracting that value from the latest height retrieved from the http://blockchain.info/latestblock endpoint.

Code example, in Ruby:

#!/usr/bin/env ruby
require "open-uri"
require "json"
# call this script with `ruby block_height.rb <tx_hash>`
tx = ARGV.shift
puts "Getting info for #{tx}..."
j = JSON.parse open("http://blockchain.info/rawtx/#{tx}").read
if j["block_height"]
  b = JSON.parse open("http://blockchain.info/latestblock").read
  puts "%d confirmations" % (b["height"] - j["block_height"] + 1)
else
  time_since = Time.now.gmtime.to_i - j["time"]
  puts "It's been #{time_since} seconds since the transaction was created."
  puts "It's not been ten minutes yet!" if time_since < 600
  puts "It's due any time now." if time_since >= 600
end

Calculating the transaction fee is best done by summing the inputs and outputs of a transaction, then subtracting the inputs from the outputs. Difference is the transaction fee.


Unconfirmed transaction for 17 days https://blockchain.info/tx/e50d760324d5ef982f8566a0a3cd9e1233c8b77aeea53ee72af77c12328b1374

I sent this transaction 17 days ago through the Blockchain Online Wallet and it's still unconfirmed.

I tried ViaBTC accelerator but it always says "Submission are beyond limit."
I've also read about some other solutions but they seem very technically complex and potentially dangerous if you don't know what you're doing.

Please help.

Research how to construct replace by fee transactions. E.g. Samurai wallet has it integrated.  Or wait for a month and your transaction will be dropped from the memory pool.


Is it possible to trigger a contract with a not prunable public trigger message? In the current state pruning is not implemented. Therefore an attached public trigger message should stay in the blockchain until pruning is enabled. When this is the case, will it be possible to make the trigger message unprunable? This could be useful for contract params validation. For example:

If I trigger a contract with the following attached message: {"contract":"ExampleContract","params":{"veryImportantParameter":"42"}}

I would like to make this message public (so everybody can validate that I've triggered the contract ExampleContract with the parameter veryImportantParameter and it's value 42) and not prunable (so that everybody can validate the message at any time in the future).

Is this going to be possible?

Ardor has two levels of pruning. Pruning of messages (like the contract trigger message), data cloud items and shuffling artifacts are already implemented on each child chain. Child chain transaction pruning is scheduled for release later this year.

Only prunable trigger message are supported at the moment to reduce blockchain bloat.

Send your trigger message in plain text and setup an archival node to save it locally even after it is pruned. This will provide you unreputable proof that this message existed at the time when the contract was triggered and other nodes will be load this message automatically from your archival node at a later time.


What is the 'tlv_payload' in lnd route? When creating a custom route, if you use the queryroutes from lnd it sometimes  with tlv_payload set to either True or False. How does the node figure whether to set this flag?

I cant seem to find it in the source code. Clearly when using RPC calls such as 'getnodeinfo' the feature bit set from the node does not come through. So is this possible that the feature set per node is not exposed via RPC?

The tlv_payload is a modification to the way onion packets are created between the 1.0 version and the 1.1 version (current working version) of the BOLT specs. The (optional) feature is named var_onion_optin in BOLT#9.

In V1.0 of the spec, there was a fixed structure for sending onion payloads to hops along a route, which contained a short_channel_id, a cltv_expiry and an amount_to_forward. In the latest version, implementations can add custom data to be forwarded in addition to the previously required ones. These contain a type and length encoded as a compact size integer, and the value of length bytes is serialized afterwards. Hence Type-Length-Value, or TLV.

Nodes which support the newer format advertise the var_onion_optin feature when they broadcast a node_announcement message, by setting bit #9 in the features field of this message.

In the lnd codebase, the feature folder contains the logic for feature bit vectors. It appears from manager.go that LND now treats the tlv_payload as enabled by default unless it is disabled as part of the config. Older versions of LND will obviously not support the feature and will use the legacy hop_data payload format.


What if all the 8 peers of the node are malicious? I looked at the question on how transactions are broadcast to the rest of the network in the blockchain network.
In this stack exchange post, the author @morsecoder in the accepted answer mentions that :

  Think of it like how gossip would spread. There are a bunch of people (nodes), and when one of them knows something, they tell it to the few (8 or so) people they are near (connected with), and then those people tell a few more people the message that was told to them, and then... Eventually everyone knows about the original information (transaction).

But what if all the eight nodes to whom a given node send the transaction are malicious/faulty? And all of them change the message in the original transaction. Wouldn't it allow for wrong transaction to get merged in the blockchain network?

Also, once any given node sends the transaction it received to its peers, how does the network know that majority of peers have received the correct transaction and it's ready to get merged in the main chain. I'm not talking about the bitcoin network here. So, I'm not worried about the PoW for now. I just want to know that when a node sends the transaction it received to its peers, the peers send it to their peers, how does the network keep the count of which transaction has been accepted by how many nodes?

But what if all the eight nodes to whom a given node send the transaction are malicious/faulty? And all of them change the message in the original transaction. Wouldn't it allow for wrong transaction to get merged in the blockchain network?

Transactions have signatures that sign the whole transaction (except signatures. Signatures are added after the transaction is signed). Signatures prove authenticity so it's impossible to change the transaction without invalidating the signature check.

  I just want to know that when a node sends the transaction it received to its peers, the peers send it to their peers, how does the network keep the count of which transaction has been accepted by how many nodes?

There's no count of acceptance. Every node keeps its own mempool which is a list of transactions that could be included in the next block.

PoW is about making blocks. When a block is broadcast, the transaction becomes the part of the immutable blockchain (unless that block is orphaned (replaced by another block.))

If the only nodes you're connected to are malicious, the worst thing they can do to you is to isolate you and log your IP-address and transactions.


Block hashing algorithm The block header contains a number of things, among them the Merkle root hash. Wouldn't this mean that every time a new transaction is added to the block (before its mined), that all nonces previously attempted need to be tried yet again?

Wouldn't this discourage miners from adding transactions to the block if they have to hash everything with nonces again?

Also, is it possible that no nonces could produce a valid successful/winning hash?

Wouldn't this mean that every time a new transaction is added to the block (before its mined), that all nonces previously attempted need to be tried yet again?

Yes, but "need" is a bit too strong of a word in this context.  Because you can't predict the outcome of a hash without performing the hash, each new hash attempt is just as likely to meet the target as the previous one.  As such, yes, it is possible that a nonce that has already been attempted will now succeed given that the merkle root has changed...but it is no more likely than the nonce you were about to attempt before adding the new transaction.  There's no real reason to re-try nonces.  The odds aren't any better.

  Wouldn't this discourage miners from adding transactions to the block if they have to hash everything with nonces again?

No.  Because the odds do not change, there is no negative incentive to adding a new transaction.  However, transactions come with miner fees, so the positive incentive is still in place.

  Also, is it possible that no nonces could produce a valid successful/winning hash?

Yes, it is possible, although not probable.  Remember that a successful hash is one that is less than the target.  These means there are quite a large number of nonces that will be successful, however, as a set they represent a very small proportion of the total possible nonces.  Even if hypothetically there is a block header that is "unmineable", a competing block would not be.  A block will still be found, and it will likely have a very similar set of transactions in it.


What is main.cpp for in bitcoind? What does the main.cpp source-code file do? I know what main.cpp files are for in general, but specifically in the case of bitcoin?

It just contains an apparently random collection of functions used by the program. It also declares some global structures such as the main lock, the transaction pool, orphan block tracking, and so on. It contains high-level block and transaction functions. Ironically, it does not contain the actual main function -- that's in init.cpp.