How can one download the initial Blockchain data files securely? I see several sources for binary downloads of the Bitcoin blockchain.  Can any of these be used securely?

So far as I know, there's no conceivable attack model if you're going to use the block chain to seed the regular Bitcoin client. It won't accept an invalid block. And it understands that the "longest" block chain wins. So a compromised file that was longer than the official block chain cannot exist, and a compromised file that was shorter would just be rejected as soon as the client connected to the network.

On startup, the client checks to make sure the chain is basically valid and contains the most recent checkpoint.

If there is any attack that works in this way, it's a defect in the client. Because someone could send you the same "broken" blockchain over the network too.


What would happen if 90% of the Bitcoin miners suddenly stopped mining? What would happen if 90% of the Bitcoin miners were to suddenly stop mining Bitcoin, i.e. the Bitcoin network's hashing power would drop to 10% of the previous amount.

Would it become more difficult for the rest of miners to mine? Would transactions take longer than usual?

The probability of 90% of miners suddenly stopping mining bitcoin is only slightly more probable than the chance of the sun going dark this afternoon.

Anyway, supposing that 90% of the active bitcoin miners were to suddenly vanish, the first effect would be that blocks would take much more time to be confirmed (10x longer, so 100 minutes per block instead of 10 on average). The next time the difficulty is adjusted (up to 2016 blocks later), the difficulty would be reduced such that blocks again take about 10 minutes to confirm depending on the new speed of the network as a whole. The difficulty is normally adjusted so that 2016 blocks is about two weeks, but if you just lost 90% of your hashing power then the next adjustment could be up to twenty weeks later.

The last time the difficulty was 10x less than it is now was around October 2013. You can see the difficulty history here .


Safety of wallet setup I just set up my Electrum wallet using live instance of Tails Linux distribution. I've written down the seed on the paper (and I remember it as well) and restarted laptop.  I plan to do all Bitcoin transactions only via Tails so I plan to recreate the wallet every time I am using it and then wipe everything out with no trace on the computer.

There is just one thing I don't get, can I have any "static" address tied to my private key and seed or do I have to get it through creating wallet every time? Because I would like to send some coins to my wallet without booting to live distro and generating the wallet again (therefore I need to have and store address somewhere), is this possible? Thanks a lot for explanation.

And is this approach reasonably secure (or even possible)?

Your approach sounds secure.

You can use any addresses generated from your deterministic wallet to receive BTC without the need to boot up and recover your wallet first.

For privacy reasons you should generate multiple addresses from your HD wallet and one use each for receiving payments once. As long as you have your mnemonic seed you will be able to recover your wallet and all of its addresses at any time.


Does the synced blockchain always grow in size? Every time the Bitcoin-Qt is launched, the blockchain syncs to update to its latest state. Does this mean the data stored locally will always grow continously, eating up all available space eventually? Or is there a size-limit so that only the latest info is kept? How does it work?

At the time of writing, my folder is 5.82GB; let's see if this changes..

The Bitcoin.org client v0.7 and lower will continuously increase in size about once every ten minutes, on average.

Blockchain.info provides a chart showing the size of the data (actual disk consumption will be slightly larger even.)

The Bitcoin.org client v0.8, being developed now, dramatically changes how it stores and accesses data that will reduce the amount of disk storage space to some degree but also will provide a dramatic increase in performance.


What happens when bitcoin loans start to appear? What happens when bitcoins loans start to appear?

Loans have interest rates that "create additional value". Given the limited amount of bitcoins, couldn't we realistically run out of them?

BitBanker loans 1000BTC to the user with a 5% interest. The loan could be backed up with, say, a house.

The user then has to pay back 1050BTC, somehow acquiring the 50BTC deficit.

Given how quickly interest on top of interest grows, won't the bankers get to 21 million BTC quite quickly?

Given how quickly intrest on top of intrest grows, won't the bankers get to 21 million BTC quite quickly?

Sure, but is that really meaningful? Let's say that I loan you 1 BTC, with the terms that I get 10% interest per day. Before the year is out, you owe me more bitcoins that actually exist. The face value is the amount that the loan is supposed to be worth, if everybody keeps their word.

However, the real value is much lower - you're a random stranger on the internet, and you're unlikely to come up with quadrillions of dollars.

Bitcoin can't save you from untrustworthy borrowers.


Defeating email spam with Bitcoin There was a paper somewhere proposing a scheme for filtering email spam with the use of Bitcoin micropayments. I can't remember where I saw it and can't find it now. Anybody knows about it?

Hashcash is one of the many anti-spam techniques used today, which is essentially a proof-of-work system designed to limit not only email spam but also denial-of-service attacks. A similar proof-of-work methodology is being used in bitcoin for block generation.

With an average of 150 billion e-mails sent out on a daily basis I cannot see how this could be deployed in the blockchain, which would then have to be adjusted to facilitate 1,7 million TPS while now it only serves 7 TPS (artificial limit).

Also, bitcoin is not really made for such small payments which would result in tons of useless and unspendable dust outputs.


Incentives against selfish miners with 51% power To me the situation of a '51% miner' is much like a government printing money - when they do, they get to finance their budget deficits as they get to spend the money first (when prices haven't changed yet). However, when that money gets into the system and people realize there's more money in the system, it leads to inflation that reduces the value of the currency (much like the reduction in the price of BTC). What stops a selfish miner with 51% mining power from double-spending like crazy in the short term before the price of BTC has had time to react, then pull out of BTC altogether? Then there would be no loss of wealth that the whitepaper says disincentivizes greedy attackers?

Thanks for your response in advance!

The minting of bitcoins is constant and a 51% miner can't change the supply of it and cause inflation. Changing the supply can only be done by developers, resulting in a chain split, which wouldn't be called Bitcoin (unless it gains the support of various companies and users)
You can't just mine loads of coins, double spend them and cash out. To spent the reward of a block, its miner has to wait 100 blocks (144 blocks = 1 day) If you're double-spending coins that aren't newly minted, you can do that, but economics says while you own 51% of the network, you would be devoting lots of hashpower (=electricity) and would earn lots of block reward, so you wouldn't want to forget to cash out the block reward. On the other hand, to cash out the block reward, you'll wait 100 blocks, by when the price of bitcoins will drop, and you'll be at a massive loss. In addition, if you have that much of a hashpower you'd want to continue mining for a long time. That means even more loss due to the change in the value of bitcoins.


Does solo mining with multiple computers require different generation transaction addresses? I've heard that what prevents the fastest computers from almost always dominating pools is that each miner is hashing different data because of the generation transaction. However, if I solo mine with many of my own computers running miners connecting to a bitcoind I'm running, it seems like I'm going to redo the same work across all miners because the generation transaction address would be the same. Or should each miner have its own address? Or should bitcoind generate a new address for each getwork request?

Bitcoind will of course give different data to each of the miners connecting to it. Otherwise using multiple miners would be pointless.

It needn't necessarily give a different address (though normally it does) - it's enough to change the extraNonce field.


Documenting bitcoin cash buys I've been trading BTC in the UK via bank transfer for a while now and may begin doing cash purchases soon. I've realised that it is critical I document the cash withdrawal as an expense so that I get taxed only on the profit and not the entire turnover of the bitcoin sale. Usually this is done via the means of keeping receipts - so I guess I could have some sort of receipt that documents the exchange but I'm not sure where to begin.

What kind of information do I put on it?
What is the bare minimum information I need on the seller?
Considering it is me issuing this document it's not exactly an invoice or a receipt, is there a word for it?

Begin by asking your local tax authority.
They would be the ones able to give you a proper definitive answer.


CPU Mining: Optimal Number of Threads (I guess this question in principle applies likewise to Bitcoin, but given how un-profitable CPU mining of Bitcoin seems to be, this question actually arose with regards to Yacoin mining).

I am currently using the AVX version of the 64-bit Windows miner whose link can be found on Yacoin's homepage.  As with all forks of minerd, you can specify how many threats minerd should use for mining.  It seems as if the default number it uses is the number of logical processors, which in my case happens to be 8.  I've tried playing around with this value, however, and it seems that playing around with the number of threads can significantly increase my hash-rate (of course it can also decrease it).  I guess this came as a bit of a surprise as I just assumed that the default thread count would have been the most efficient.

There is also the variable of how many workers I have running on the pool (in my case, yac.coinmine.pl) and how many processes of minerd I am running.

This means that there are various combinations of process count / thread count I could play around with to try to find the most efficient combination, but before I figured I'd spend the time playing with these various possibilities, it would be easier to just ask someone who has a better idea of how this actually works:  Is there any reason it would be beneficial to run 8 instances of minerd with 1 thread each vs 1 instance of minerd with 8 threads each?  Perhaps in principle there shouldn't be, but because I'm mining in a pool the fact that separate instances require separate workers makes a difference?  What should be an ideal thread count and why should this actually be an efficient thread count to use?  For example, using 16 threads seems to improve my hash-rate over that of just using 8, but doubling again to 32 threads seems to lower the hash-rate again.  Why would this be the case?

As a separate but related question, why does my hash-rate seem to slow the longer the miner runs?

One instance of minerd is all you're going to need. The application also synchronizes with the pool. So opening more than 1 instance of minerd is just going to cause your network to be used twice for the same information. Also, the operating system has some overhead for running the application. Opening another instance will mean more overhead and thus less hashes!

You have a CPU with hyper-threading, so you have 8 logical cores, this is not the same as having 8 physical cores. Have you tried running it with 4 threads (just for fun)?

Also, imagine having a racetrack with 4 lanes. You can drive 8 or 16 cars on it. But you'll still have to let 4 cars drive side-by-side at a time. You can throw any amount of cars at it as you want, but someone is going to have to synchronise those cars, so that'll just mean the racetrack is used less.

Ideally you should have 8 cars on a 4 lane racetrack. This way the cars that have exited the racetrack have some time to exchange their lap times while the other 4 cars use the racetrack. They can then almost perfectly relieve each other, like a relay race.

Having less than 4 cars on this racetrack means the racetrack will not be used all the time, since the racers in the cars want to exchange their lap times with each other after exiting the racetrack (the processes want to give back a result to the minerd thread).

Having more than 8 cars means there will always be cars waiting to enter the racetrack, so you'll just have cars waiting a lot of time before they can race on the racetrack.


How could an LN node acquire inbound liquidity? Is there any systemic risk? I once heard that LN could support dual-funded channels. It doesn't seem so complicated, but currently, I don't know any LN wallet which supports creating dual-funded channels.

By the way, I'm also concerned about security: will dual-funded channels introduce systemic risks/attack vectors? For example, if an attacker is already able to do a 51% double-spending attack, could he leverage the inbound liquidity to multiply his profit?

Dual funded channels are theoretically easy but there is a little bit of implementation overhead. Also they are not fully spect out yet in the BOLT standard which is the reason why they are not implemented yet. They will be part of the next update to BOLT 1.1 and people are working on the specification.

While studying the Lightning Network white paper last year I discovered a potential 51% attack vector which I described on the Mailinglist. The attack can steel all the capacity that is in all your channels. With dual funded channels you could in fact increase the capacity that is attached to you. However the described 51% attack is rather unlikely to happen and in particular would yield many other problems.


I have the identifiers for my wallet, but I don't know how to access it I am a cryptocurrency novice, so I apologize in advance if this question is too basic. About a year or so ago I created 2 bitcoin wallets and put a small amount of money in them. I forgot about them until recently when I found the sheet of paper where I wrote down the identifiers for them.

In addition, there is a long list of random words associated with each wallet. My question is, I know this should be enough information to access my wallet, but I don't know what to do with the information. Any help would be greatly appreciated.

If your list of words is 12, 18, or 24 words long, it is likely a BIP 39 seed. This means that you should be able to access your Bitcoin by using any software that supports BIP 39 seeds (such as Electrum) and restoring your wallet from those words. Note that not all wallets that support BIP 39 will derive addresses in the same way; some derive them with a different derivation path so you may not necessarily see your Bitcoin and may have to use a different wallet. For most wallets though, it should work.

The exception is MultiBit HD. If you think you used MultiBit HD, you can only use MultiBit HD to restore the wallet. MultiBit HD will not be able to restore your Bitcoin if you a different wallet generated the seed (well technically it will restore, you just won't see any balance).


Retrieving all the funds from BIP32 derived wallets An ecommerce site is using BIP32 wallets for receiving order payments from a tree of child keys where each leaf node is unique to one purchase transaction.

Is it common for the site to immediately send the received coins to its superwallet (master node) upon X confirmations? If so, how would you go about sending all the coins in the entire tree of child keys (which can be tons of nodes depending on the number of transactions) to the super wallet?

And how would u know when a payment is sent to one of the derived addresses?

Let's assume the case with a derivation path of m/k'/0/i, where m is the master node, ever user has a k node and i is his i'th purchase transaction.

Is it common for the site to immediately send the received coins to its superwallet (master node) upon X confirmations?

No. Not at all and would normally be considered very bad practice as in bitcoin you don't spend from addresses but from transactions, so "accumulating" in one address doesn't really work. Sending from that address would again have to reference all the forwarded transactions. (There are special cases like green address in its original implementation but no, that's a thing of the past.)

  And how would u know when a payment is sent to one of the derived addresses?

You watch the bitcoin network? Either through proxies or with a full node. Check out the insight.bitpay.com API.

  Let's assume the case with a derivation path of m/k'/0/i, where m is the master node, ever user has a k node and i is his i'th purchase transaction.

I would strongly advise to hold that logic in the server, only.

eCommerce sounds like one central server, so there is really no big need to fan out too much in the HD wallet structure. You should also look into BIP44 on transaction discovery.

Your business logic has to keep track what purpose an address has but if that website never has to send refunds, it would typically only have an extended public key. Now if it receives to

m / 44' / 0' / i' / 0 / j

any bip44 compatible wallet would find and be able to spend the funds if you provided it with at least the xpriv key for

m / 44' / 0' / i' / 0

but typically

m / 44' / 0' / i'

One minor thing you have to keep track of, is the gap between addresses that don't receive a payment. If your server observes a gap of more than 20, you would have to help your wallet to find those funds if it's strictly bip44 which would only bridge gaps up to 20. If your last transaction is to index 1220 and you don't see transactions to 1255 and 1257, you could send a satoshi to 1239 and your wallet would find the rest.


Help Lost Bitcoin phase I was using a Bitcoin wallet called "Bread" then transfer to another wallet called "Bitcoin".  The Bitcoin app was deleted from my IPhone 7.  The password word phase I wrote down was the same as the "Bread" app.  It that possible? Or did I write down my old password thinking I was in my new "Bitcoin" app.  I have tried download the Bitcoin app again but unable to restore the account.
Thank you, John

Though it is possible that both wallets generated the same mnemonic seed phrase (which is used to derive private keys), it is extremely unlikely. The chance of it being the same is 1 in 2^256, which is a very small number. This is obviously assuming no bugs in the code generating the key.

Restoring the account is only possible if you still have the mnemonic seed phrase. If you don't, then I'm afraid you won't be able to access the bitcoin until you find the seed.

Note that the mnemonic seed phrase is different than a user-supplied password. A mnemonic seed phrase will derive addresses, whereas a password will encrypt (lock) the wallet. So if you use the seed phrase to recreate the wallet on another device, you will not need the password to access the funds on the second device. That said, in some cases, a user-supplied password may also be used as part of the seed phrase (a '13th word or '25th word'). So you'll need to determine the nature of your password in order to recreate your wallet.


Installed 2nd Bitcoin client and invalidated blockchain progress over the last couple of days I synchronized the block chain on an old version of Bitcoin QT where I still had funds in my wallet. It started out 90 weeks behind, then over the course of 4 days updated until it had 23 more weeks to go. At this point any progress stopped, seemingly getting stuck for 24 hours or longer and I couldn't find a solution to make it continue its synchronization.

I then installed Unlimited Bitcoin since I heard that new clients would synchronize much faster. I assumed that both clients would build their block chain separately from each other but the Unlimited Bitcoin installation corrupted any progress that Bitcoin QT had made and upon starting it the next time, it had to re-synchronize now being more than 200 weeks behind.

Unlimited Bitcoin however seems to refer to QT's progress status, also being 200+ weeks behind and not updating any quicker.

What would be the fastest way to get the blockchain up to date on my hard drive in a way that the funds on my QT wallet can be used?

Thanks in advance.

BU might have changed their default installation directory, but I doubt it. Then it sounds to me that you were running two copies of Bitcoin software working with the same blockchain data. Even when not running them at the same time, I'm not surprised that this might corrupt the block data. (If you've run them at the same time, no wonder at all, although I thought there was a lock in place to prohibit that.)

Don't run more than one Bitcoin software from the same directory.
Pick whatever flavor you may choose to run, install a current version of that.
Wait until synchronization is finished. Later blocks take longer than earlier blocks due to more content.


How exactly do I decode the block file info in leveldb? Base on the links
https://github.com/bitcoin/bitcoin/blob/fcbc8bfa6d10cac4f16699d6e6e68fb6eb98acd0/src/main.h#L392 and
What are the keys used in the blockchain levelDB (ie what are the key:value pairs)?
I should simply read in the results as varints. So I wrote some Python code shown below. But I did not get the results I expected.

Below is my code to decode the file information with file number 0.
I parse through my blk00000.dat and found that the first block was the genesis block and the last block was block 177 with blockhash 00000000480c9799dd2b35009ff1833f69690f76c26a9bea7e00cd0042f67db1.

nBlocks looks to be correct with 134 blocks which was how many blocks I found in blk00000.dat.
nHeightFirst looks right with the value being 0, but I nHeightLast is not 177. nSize and nUndoSize dont look right since it doesn't match the file size with I found on the terminal doing

ls -l  ~/.bitcoin/blocks/blk00000.dat

and

ls -l  ~/.bitcoin/blocks/rev00000.dat

Also the nTimeFirst does not match the timestamp of the genesis block.
And nTimeLast does not match the timestamp of block 177, which I found to be the block with the highest timestamp in blk00000.dat.
What am doing wrong?

import plyvel
blockIndexDB = plyvel.DB('/home/chris/.bitcoin/blocks/index')
result = blockIndexDB.get(b'f\x00\x00\x00\x00')

# result value from leveldb
# result = b'\x86\xa8%\xbe\xfe\xf4E\x88\xa5\xa7}\x00\x86\xa8r\x83\xc9\xfd\xd5)\x83\xec\xd3\xa1N'
# hexString = b'86a825befef44588a5a77d0086a87283c9fdd52983ecd3a14e'

nBlocks = int.from_bytes(result[0:1], byteorder='little')
print('nBlocks', nBlocks)
print(nBlocks == 134)

s = int.from_bytes(result[1:2], byteorder='little')
# print('s', s)
nSize = int.from_bytes(result[2:6], byteorder='little')
print('nSize', nSize)
print(nSize == 134216389) # blk00000.dat file size

s = int.from_bytes(result[6:7], byteorder='little')
# print('s', s)
nUndoSize = int.from_bytes(result[7:11], byteorder='little')
print('nUndoSize', nUndoSize)
print(nUndoSize == 19502205) # rev00000.dat file size

nHeightFirst = int.from_bytes(result[11:12], byteorder='little')
print('nHeightFirst', nHeightFirst)
print(nHeightFirst == 0)
nHeightLast = int.from_bytes(result[12:13], byteorder='little')
print('nHeightLast', nHeightLast)
print(nHeightLast == 177)

s = int.from_bytes(result[15:16], byteorder='little')
# print('s', s)
nTimeFirst = int.from_bytes(result[16:20], byteorder='little')
print('nTimeFirst', nTimeFirst)
print(nTimeFirst == 1231006505) # block 0 timestamp

s = int.from_bytes(result[20:21], byteorder='little')
# print('s', s)
nTimeLast = int.from_bytes(result[21:], byteorder='little')
print('nTimeLast', nTimeLast)
# block 177 is the last block in blk00000.dat file
print(nTimeLast == 1231736557) # block 177 timestamp

You are deserializing every value as an integer but that is incorrect. The values are serialized as variable length integers with high bits signalling the length of the integer which are dropped for the actual integer value itself. So you need to fix your code to deserialize the bytes as varints instead of just integers with fixed lengths.

The following code was able to deserialize the entry correctly.

#! /usr/bin/env python3

import binascii

def get_max(long=False):
    if long:
        return 18446744073709551615
    else:
        return 4294967295

def read_var_int(s, pos, long=False):
    n = 0
    while True:
        chData = s[pos]
        pos += 1
        if n > (get_max(long) >> 7):
            raise IOError("ReadVarInt(): size too large");
        n = (n << 7) | (chData & 0x7F)
        if chData & 0x80:
            if n == get_max(long):
                raise IOError("ReadVarInt(): size too large");
            n += 1
        else:
            return n, pos

entry = binascii.unhexlify(b'86a825befef44588a5a77d0086a87283c9fdd52983ecd3a14e')
pos = 0

nBlocks, pos = read_var_int(entry, pos)
print('nBlocks: {}'.format(nBlocks))
nSize, pos = read_var_int(entry, pos)
print('nSize: {}'.format(nSize))
nUndoSize, pos = read_var_int(entry, pos)
print('nUndoSize: {}'.format(nUndoSize))
nHeightFirst, pos = read_var_int(entry, pos)
print('nHeightFirst: {}'.format(nHeightFirst))
nHeightLast, pos = read_var_int(entry, pos)
print('nHeightLast: {}'.format(nHeightLast))
nTimeFirst, pos = read_var_int(entry, pos)
print('nTimeFirst: {}'.format(nTimeFirst))
nTimeLast, pos = read_var_int(entry, pos)
print('nTimeLast: {}'.format(nTimeLast))

The result was:

nBlocks: 119973
nSize: 134216389
nUndoSize: 19502205
nHeightFirst: 0
nHeightLast: 120050
nTimeFirst: 1231006505
nTimeLast: 1303712078

The nBlocks and nHeightLast are expected because early blocks were extremely small yet the block file is fairly large. I think that your calculation of 134 blocks in the block file is wrong. With 134 blocks, the blocks would have to be more than 1 MB in size which is simply untrue for early blocks.


Recover a bitcoin wallet in Hive I've recently reformatted my Mac, and reinstalled Hive. I have a back up to Dropbox option enabled in Hive, and my old bitcoin wallet file is there. But I cannot find any way to recover my old bitcoin wallet to my new installation. Being able to back up but not recover doesn't make much sense to me right now, can anyone help me with this process?

Dropbox stores all previous versions of hive files for at least a month. You can open the backup folder in Finder and find the bitcoinkit.wallet file. Right-click this and select "View Previous Versions". This should open your Dropbox account and show you the previous versions of the wallet file.

Check the backup at ~/Library/Application Support if the backup files are there. If not, copy the backup files to that folder. Then start Hive, and it should detect the existing wallet and send you straight to the main window without going through the welcome wizard (note: you'll have to wait a bit for it to resynchronize with the Bitcoin network again).

Hope this works!


Could a transaction hex on testnet theoretically be valid on mainnet? For all practical intents and purposes it seems a testnet tx hex could never be valid on mainnet because of the prev tx hex present for all inputs used in the tx. However, let's say that by some miracle you had identical unspents on both testnet and mainnet. If you signed the tx and broadcast it to testnet, could you then broadcast the same tx hex to the mainnet? In other words, is there anything network specific in the tx hex? I thought there was some network magic that might go into either the signature hash or the script hash but it does not seem to be the case as far as I can tell.

Yes, it is theoretically possible for a transaction to be valid on both mainnet and testnet. Transactions don't contain any network specific information other than the previous txid and output index.


Is there any way to measure relative occurrences of wallet theft over time? Soon after Bitcoins became valuable enough to be worth stealing, I started seeing news about viruses/malware that steal Bitcoin wallets. Presumably, wallet encryption has reduced the level of this, but is there any way of measuring it?

Given that there is probably growth in the number of users, I guess you'd have to compare it with that figure to get a comparative figure over time for the chance of having a wallet stolen. Is that figure measurable?

The only way you can measure something like that, is if users would first of all know if their wallets get stolen, and second of all, if they reported that problem. Besides that there is no real way to know if a wallet actually got stolen, nor are there any means of verifying that it did.

On the other hand, if one was to steal a wallet from some big Bitcoin website (say, a pool, an exchange, or an eWallet), one probably could notice a change of pattern of transactions, and we might hear some official statements from website owners about the theft. In this case though, it would probably be more of "quality over quantity" theft, as in we wouldn't see many cases like this appear.


How can channel policy be missing? I randomly stumbled upon an example of a channel for which one of the two sides does not have a channel policy. What could be the reason for that? For example, lncli getchaninfo 620048691895336960 returns this (and node1_policy here is null):

{
    "channel_id": "620048691895336960",
    "chan_point": "4857421490e50d3ffed1e31346c8cc56f229f70ad93d800d647db794cc09bb59:0",
    "last_update": 1550695804,
    "node1_pub": "03b9c09d8522d6d6ca3c4fe3e635b65e962fade78437ef2ac46f37df4c0119aa03",
    "node2_pub": "03bb88ccc444534da7b5b64b4f7b15e1eccb18e102db0e400d4b9cfe93763aa26d",
    "capacity": "2000000",
    "node1_policy": null,
    "node2_policy": {
        "time_lock_delta": 144,
        "min_htlc": "1",
        "fee_base_msat": "0",
        "fee_rate_milli_msat": "1",
        "disabled": false
    }
}

If that is relevant, node1 here runs eclair, and node2 runs lnd.

Each channel participant sets their own policy for forwarding HTLCs through the channel. They broadcast a channel_update message containing the policy, which is received and forwarded over the gossip network, and also received by the channel's counter party. The channel_update has a bit flag indicating whether the update belongs to node1 or node2.

A missing policy could mean that one party has not yet broadcast any policy, or that you've missed the broadcast message if you went offline at some point. In the latter case, your node should be able to query the policy over the gossip network with a query_short_channel_ids message.

If it is one of your own channels, it may just be that the channel is private and your node sets a policy regardless of whether or not the node is announced. I'm not sure about the specifics of any implementation in that regard.


Recovering my old bitcoin wallet As far as I can tell, my old bitcoin wallet got corrupted. It was created in Bitcoin Core in the 2014/2015s, and I'm trying to recover it. Bitcoin Core doesn't accept it anymore (and doesn't give an error message), so I'm trying another way.
I managed to read the contents using walletools (https://github.com/akx/walletool), and here is what I have :

a long list of "tx" items, containing mostly binary data
quite a few (probably 50 ish) "ckey" items, with the public key and encrypted private keys
a single "mkey" item, with the 'nID', 'encrypted_key', 'salt', 'derivationMethod', 'nDerivationIterations' and 'otherParams' fields containing data
two "name" items containing 'hash' and 'name' fields
a number of "pool" items with 'n', 'nVersion', 'nTime', and the 'public_key'
lots of empty "keymeta" items
a "version" item : 150001
a "bestblock" item, with a "key" field
a "minversion" item : 130000
a "orderposnext" item (empty)
a "bestblock_nomerkle" item (empty)

From there, I imagine the important data is the mkey. What is its encryption algorithm and what Python lib could I use to decrypt it (assuming I remember the password ! ) ?

I think the least "intense" option here would be to look up each of the wallet addresses from your ckey items on a node (i.e. blockchain.info blockchair.com btc.com etc) to see which ones have any value in them.
Once you have a list of the wallet addresses that are "worth recovering," you will need to take those ckey items' encrypted private keys (possibly along with data from the mkey item) to attempt to manually decrypt/recover your private keys to those wallets.
If you're experienced with programming, you could read through the code from the version of bitcoin core you used in 2014/2015 to figure out how it was encoded. Otherwise, you may need to find an experienced programmer you can trust, to help here.
As a post-note:
Have you tried re-compiling a copy of that older version of bitcoin core on a sandbox system? It's just a try, but maybe the file just got caught by a reverse-compatibility issue!


Bitcoin Core Address Hi how can I look up my bitcoin-core address. I have generated multiple addresses to received bitcoins but when I look them up in a bitcoin explorer they do not show the balance I see in bitcoin core.
Thanks guys.

Running the bitcoin-core software creates a 'full node', it does this by fully validating the current state of the network. Once in sync with the network, the BTC balance shown by the software can be assumed correct.
Looking up the balance on a blockchain explorer service's website can provide some assurance that what you're seeing on your node is indeed correct, but its also kind of like asking someone else to do some math for you, when in fact you've already computed the answer yourself. Why trust the other person, you've already independently arrived at the answer.
Note that each address in a wallet is unrelated to any other address in that wallet. So if you receive funds to address X, then you'll have to look up address X to see the balance of address X. If you're also received funds to address Y, they won't be shown if you look up address X. Likewise, if you haven't received funds to address Z, then looking up address Z will not give any information about any other addresses in the wallet (you won't see the balance of address X or address Y).
To see a list of unspent UTXOs and their associated addresses, you can run the following command: bitcoin-cli listunspent. If you look up those addresses using a block explorer, the balance of each address should be correctly displayed.
NOTE: using a block explorer is very bad for your privacy. The block explorer service will learn which addresses you are interested in, as will every other service involved in serving you that data (your ISP, local network admin, etc). Using the tor network to look up addresses with a block explorer would be preferable, to help preserve privacy. Some block explorers even offer a .onion hidden-service site mirror, to allow users to retain privacy.


How do I know one transaction has confirmed? I am running my bitcoind with -zmqpubhashtx optional, and I receive notification once a new transaction has broadcast to public chain! I can also parser it by getrawtransaction and decoderawtransaction. But I couldn't validated if a transaction is confirmed.

Additionally, there are also exists an optional name as -zmqpubhashblock, I can also parser it by getblock and read its all transactions, compare it all with my MySQL data, if it's exists with the same txid, I'll update my column (confirmations to plus one), but it's a little bit ineffective.

Let's say, After I ran getblock <hash>, and then give me a tons of transaction. and I have to check each something like:

UPDATE t_unspent_tx
SET confirmations = confirmations + 1
WHERE addr in (addresses)

BTW, Can I trust the block hash from notification? Is it may not be the longest on the chain?

PS, I don't want to check confirmation from the blockchain.info or some other site else.

If you have txindex=1, you can call getrawtransaction <txid> 1 to receive a decoded tx object, which will include the number of confirmations and the blockhash.


How do I add a multi-sig address to account to watch balance in Bitcoin CLI I have already created a multi-sig address with funds, and I have already made transactions (2 of 4 Signatures needed). No problem.

But I want to add it to one of my accounts, or a new account, so I can watch the balance. Currently I have to use the Block Explorer to find balance and tx-information.

Do I use: importpubkey or importaddress or something else? I cannot figure out how.

The command setaccount gives me the "this address does not belong to you".

I believe importaddress is the command you're looking for: Bitcoin RPC Documentation

importaddress "address" ( "label" rescan p2sh )

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

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

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

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

Examples:

Import a script with rescan
> bitcoin-cli importaddress "myscript"

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

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


Pending transaction, what can i do Pending transaction and it been 8 day, anyone can help me here and here 3MPTn2ZwQiydkvKZKRgAVUQawA9ShjLJVh , need help

It's because you've used a very small fees  96.339 sat/B for this transaction.

You can see the current bitcoin fees here : https://bitcoinfees.21.co/ which is recommended. Your transaction will likely drop out of blockchain and you will get your coins back soon.

Solutions :

1) You can contact bitcoin pools and push your transaction in there blocks.

2) You can double spend your bitcoins ( Not easy for beginners/non-technical persons )

3) You can just wait it out.

Please use a higher fees from next time to avoid using these issues.


Do some Bitcoin wallets fail to support sending to multi-signature addresses? The Satoshi client has support for multi-signature transactions through the JSON-RPC API since version 0.6.1rc2.

My understanding is that a multi-signature transaction creates an address which is special only in that spending from it requires multiple signatures, and its prefix is '3' instead of '1'.

As Gavin said on bitcointalk.org, "you can then send funds into that 2-of-3 transaction using the normal sendtoaddress/sendmany RPC commands, or the GUI (or anything that's been updated to recognize multisig addresses)."

What I read from that is that all wallet clients and web wallets might not yet support sending to addresses with a '3' prefix. How wide is that support currently?

Sending to P2SH addresses (addresses starting with '3') seems to be directly supported by only Bitcoin-Qt/bitcoind and Electrum at the moment. EWallets using those clients might allow sending to P2SH addresses. It's not directly supported by BitcoinJ, so BitcoinJ-based clients like MultiBit and Bitcoin Wallet for Android probably won't support it until BitcoinJ does. It's also not directly supported by blockchain.info or Armory. Some clients allow you to create raw transactions, which could be used to send to P2SH addresses manually.


Unable to receive/preview funds due to un-synced wallet I bought bitcoins and sent them to the wallet, however the wallet is not synchronized and as a result I cannot see my bitcoins.

Will I be able to see them as soon as the synchronization process finishes or have I lost them?

If I did, is there any way I can recover them?

You will be able to see them as soon as you synch the block that contains the payment.


Is there any central management of public and private key pairs in blockchain? Is there any entity in the blockchain that maintains record and manages public/private key pairs of all the users?

No, there isn't.  Bitcoin has no central management of anything at all.

Public keys are pseudonymous and in general it may not be possible to identify the user to whom a public key belongs.  A private key is kept by the user who generated it, and typically is never revealed to anybody else.


Sold BC but funds not received into Bank I'm new to BC. I've bought using Blockchain.info, linked to a Coinify account which I've had verified with ID etc.

Buying is fine - got that sorted, but it seemed sensible to try selling a small amount in case I ever want to do this quickly, so I used Blockchain.info to set up a sell order for £10. I entered my Bank details (IBAN etc) as requested. In my wallet I can see the Coinify Sell order, and that the transaction has been 'confirmed'. I can view this on the Blockchain too. But no funds have reached my bank account. Blockchain.info refer me to Coinify, Coinify have asked if I received confirmation from them, which I did not, but now appear not to answer my emails.

It's entirely possible I messed up the transaction as I'm new to it, but I'd be interested to hear any comments about what I've described so far. It's only 10GBP, but the principle will be the same whether I sell this or a larger amount. Have I gone about this the wrong way?

this is Coinify representative writing. We are sorry to hear that you have experienced issues using our sell service and would like to ensure that everything is in order. Unfortunately, based on this post, we cannot identify your specific case. Could you please submit a ticket to support@coinify.com with identifying info from the email address associated with your account? If you have submitted a ticket already, please refer to the ticket id in your email. At the moment we are experiencing longer response times (https://support.coinify.com/Knowledgebase/Article/View/197/0/why-are-bitcoin-transactions-taking-longer-than-usual) but we want to assure you that every order and support request will be taken care of. Thank you for your understanding.

Best regards, Coinify team


Why does the age of the coin in my wallet matter? When a new transaction is made, the client seems to prefer older coins in the wallet.

What is the rationale for this?   Are there any cases where it doesn't make sense to strictly collect coins by age?

The Bitcoin.org client only cares about age when a coin is real recent (like in the last day).  Any coins older than about a day are all treated equally.

The reason recent coins matter is because the client wants to lessen the chance that legitimate spending would be considered as being spam or a denial of service attack.

If coins were recently received and then are being spent fairly quickly right after the network can't know if that is someone trying to grief the network or if that is a legitimate transaction.   But a transaction made with older coins is almost certainly not being used for the purpose of griefing the Bitcoin network.

So then by requiring fees for "spam-like" transactions, if an attacker is griefing the Bitcoin network it is going to have a cost.

That's the extent of it -- a way to make attacking bitcoin expensive while allowing normal, legitimate use to remain low cost or free.


Are NXT messages stored on the blockchain and are they encrypted or publicly viewable? Are nxt messages stored on the blockchain?

What is the character limit on these messages?

And are the messages encrypted or publically viewable? If they are public, is there a site to just view all the messages sent?

Yes they are stored in the blockchain.

They are limited to 1000 characters.

They do not have encryption built in, but encryption can be built on top. You can view the last 300 messages here. You can also use that site to browse through blocks and see the messages embedded in each one.


Possible to create 5+0$ founding transaction in Ligthning Network? Watching a tutorial on how the Lightning Network works. Is it possible that only one party puts in money in the founding address / transaction?

The current protocol implementations only allow one party to fund a channel.

If only one party funds the channel, then the first payments can only be sent from the funding party to the counterparty. After that, subsequent payments could go both directions (until the entire channel balance rests with one party, at that point transactions could again only flow in one direction. It is not possible to have 'debt' in a channel).


Handling fees and setting them Im trying to get the estimation of how much the fees will be when a final amount is decided on. I would say im getting familiar with bitcoinj but not completely with java so im still learning how to code and exploring how to get information.

this is my present code. I put everything inside a method.

public static String SendFund(String amount, String receiver){
        String text;
        Coin value = Coin.parseCoin(amount);
        LegacyAddress to = LegacyAddress.fromBase58(MainPage.params, receiver);
        try {
            System.out.println(gbal()+" - "+gaddress());
            Wallet.SendResult result = kit.wallet().sendCoins(kit.peerGroup(), to, value);
            text = ""+amount+" BTC sent to address

"+receiver+".";
            System.out.println("Check transaction : https://testnet.blockchain.info/tx/"+result.tx.getHashAsString());
        }catch(InsufficientMoneyException e){
            text = "Insufficient Funds.";
        }
        return text;
    }

Currently it doesnt deal with fees. But when i view a transaction such as this ==> https://testnet.blockchain.info/tx/194b2a7505a537307abe9443b048bc7ddce6ca0d833d5758c3be3c03a9c7b838 you can clearly see the fee.

Also when i purposely tried to send coins when i know the wallet doesnt have enough it doesnt tell me that it failed

0.8625106 - n2uEm2QXqe2PCSsbHTdAJN9aDm2mDjz6iZ
May 02, 2018 5:08:58 PM org.bitcoinj.wallet.Wallet completeTx
INFO: Completing send tx with 1 outputs totalling 1.00 BTC and a fee of 0.001 BTC/kB

What am i doing wrong for failing to check? do i have to actually perform an if statement just to check? And also how can i calculate reliably on what the final amount would be?

I was able to resolve the issue.

public static String estFee(String amount, String receiver, WalletAppKit kit, NetworkParameters params){
        try {
            String value2 = String.format("%.8f",Double.parseDouble(amount) * MainPage.handleFee);
            //String value1 = String.format("%.8f",Double.parseDouble(amount) - Double.parseDouble(value2));
            String value1 = String.format("%.8f",Double.parseDouble(amount));
            Coin val1 = Coin.parseCoin(value1);
            //Coin val2 = Coin.parseCoin(value2);
            System.out.println(receiver);
            Address target1 = Address.fromBase58(params, receiver);
            //Address target2 = Address.fromBase58(params, MainPage.handleAddress);
            Transaction tx = new Transaction(params);
            tx.addOutput(val1, target1);
            //tx.addOutput(val2, target2);
            SendRequest req = SendRequest.forTx(tx);
            req.feePerKb = Coin.parseCoin("0.0001");
            kit.wallet().completeTx(req);
            String[] temp = req.tx.getFee().toFriendlyString().split(" ");
            return String.format("%.8f",Double.parseDouble(temp[0]));
        }catch(InsufficientMoneyException e){
            Double mis = (double)e.missing.getValue()/100000000;
            System.out.println(BackEnd.strFormat("ERROR","NSF","INFO","Not enough money. You are missing "+mis+". This was to retrieve an estimated fee."));
            return "0";
        }
    }

The library wasnt so forth coming so i had to improvise for the solution.


how to calculate hash rate of your rig? First going the easy way, I would use any online calculator but most of these mining calculators require the hash rate of my device. I am unable to find a suitable answer or a guide to easily compute this value for any device given its configurations. Will that be possible?

Scenario:

When I go to these online calculator sites, they again cross question me about the hash rate/ hashing power. I need to determine this value and feed in to these sites so that I can get the desired result. (e.g. cryptocompare.com). I want to know whether it is easy to calculate these values with some information about your machine like the processor, GPUs and all, how much time I am gonna run it. I know the calculator sites need the power input of the device.

This website allows you to select your GPU / ASIC / etc, and it will tell you the expected hashrate of that hardware for different algorithms.

I can offer no guarantees about the validity of the data they provide though, in general the best way to figure out your hashrate would be to actually run the hardware and see what happens.


Is it any open source Bitcoin exchange available Is it any open source Bitcoin exchange code is available

Justcoin uses snow which is open sorce. I don't know if you are asking about Justcoin or Snow, either way, any of those two should be the answer to your question.


I run bitcoind in linux centos server. but it give me error "sendto: Operation not permitted". why? root@srv [~/public_html/server/bin]# ./bitcoind -daemon

Bitcoin server starting

root@srv [~/public_html/server/bin]# sendto: Operation not permitted

What is the problem?

Also, bitcoind didn't download the blockchain in my linux centos server.

What is the reason?

Most likely SELinux.

~/public_html is not the correct place to store binaries or even the bitcoin data directory.

Put the binaries in ~/bin/

The data files should end up in ~/.bitcoin/ if you haven't changed the configuration. That should be okay.

If it still doesn't work you might need to run restorecon -R ~/bin to fix SELinux attributes.


How can I watch an address on Windows and Android? I want to be informed of transactions of my Bitcoin address on the Windows and the Android app. Can I use the same Bitcoin address on both? If yes, how can I backup the address on Windows and restore it on Android?

Just use bitcoind
-walletnotify=    Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)

in a script or for more details, access the bitcoind API via RPC  https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list


What happens when two txid's collide? Let's suppose that I can create SHA256d collisions, and I use this ability to create two transactions that have the same hash, A and B. These transactions are not the same, but they hash to the same value.

I submit transaction A to the network, and wait until it has a few confirmations. Then, I submit transaction B. Will it get included into the chain? Will it overwrite transaction A?

If the answer to the previous two questions is yes, then what will happen if the block containing transaction B is reorganized out of the chain? Will transaction A be un-overwritten?

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

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

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


What is the simplest command I could use to test that my wallet unlocking process works properly? I simply want to unit test that my lock/unlock process works well on an encrypted wallet.

What would be the easiest command I could send (that doesn't involve sending coins) to actually validate if my wallet is locked or unlocked? Can I try to sign a dummy transaction for example?

You can sign a message using the signmessage command. Note that this only works if you are using legacy addresses (Bitcoin Core currently defaults to p2sh-segwit addresses which cannot be used to sign a message). You an get a legacy address using:

bitcoin-cli getnewaddres "" legacy

If the wallet is locked, you won't be able to sign a message.


Is bitcoin.org or bitcoincore.org the one to trust? "Download Bitcoin Core": https://bitcoin.org/en/download
"Download Bitcoin Core": https://bitcoincore.org/en/download/
I've been alternating between the two sites for years. I have no clue who to trust the most.
Why are there two? I mean, I get it, it's "decentralized", but we all know that in practice, we must trust some kind of central source to get the actual "reference implementation", which most of us do consider the official "and only" (for us) Bitcoin client.
There's something which psychologically prevents me from ever trusting one of the other Bitcoin wallets/clients. It seems to me that Bitcoin is so absurdly complicated that only one team can really get it right. I've spent endless hours over so many years just trying to understand it on a "user" level, but it's just an Enigma still in so many ways. I'm even nervous for the main Bitcoin Core team to make a mistake, by accident or through evil intentions.

It looks like https://bitcoincore.org/ is the one run by the people who run the Github bitcoin/bitcoin project (the actual core developers) since it is the one listed on their Github page: https://github.com/bitcoin/bitcoin
If you want the absolute best source for the client directly from Bitcoin Core devs then I would use that site or their Github page for downloads.
https://bitcoin.org is still, however, a reliable source for information on Bitcoin Core, and maintained by the community. However, it is owned by someone who isn't tied to the Bitcoin Core project itself (as far as I'm aware): https://github.com/cobra-bitcoin


How to create multi-user wallet or wallets supporting off-chain transactions I want to implement the wallet to create bitcoin and altcoins exchange and store system.

Somehow create random or HD wallet that holds and store upto 50 user public keys.But users will not have access to private keys so the user cannot sell coins directly. User A should be able to transfer coins to user B without paying transaction fee using our system.
(Thinking of some kind of HD wallet on which I control all the private keys and only provide users with public address within this wallet for receiving the coins)
Users hold the private keys themselves on mobile/pc using our system. User A should be able to transfer coins to user B without paying transaction fee using our system.(I think its not possible without private key in this case)

How to create wallet for case 1 and different wallet for case 2 ?

The case 1 is easy from a technical perspective: you create a single hierarchical deterministic wallet and take full custody of your users' balances. To do so, you provide distinct addresses to each user whenever they want to deposits or receive coins. You keep track which addresses are associated with which account, but only show them their balance aggregated from what they received and sent. When they send to another user on your service, you only update your database and do not move any coins. To create withdrawals or send transactions, you use whatever coins are convenient to do so. Note that this is simple only from a technical perspective, it is difficult from a legal and regulatory perspective.

Case 2 is impossible: The two requirements of the users holding their own private keys and being able to transfer coins without paying transaction fees are not compatible.
If you want users to hold their own keys, to sign over bitcoins, they need to be transferred to the control of another key. This requires an on-chain transaction and thus requires fees. On the other hand, to transfer balances without a fee, the coins must be under your service's control so that you can unilaterally amend the balances in your database.


How do I legally set up an exchange? I'm asking about legal concerns, not technological ones. If I'm based in the USA, should the exchange be a US company? If not, where should it be based?

How is banking set up?

I don't think StackExchange is the best place to ask for legal advice.

Logically, one would set up a company, get a business bank account and start their operations. However, it is very advisable to consult a lawyer first, as there are some legal concerns one should keep in mind, like the money laundering regulations that one should adhere to.


Where does the mining reward in regtest go? After using the bitcoind -regtest generate 1 command, where does the mining reward go? I tried list accounts and check balance for account "", but the balance always showed 0.000000.

To you, but with a delay.

What you're observing is the maturity period: the coins generated by a block can only be moved after there are another 100 blocks on top.

If you generate another 100, your balance will start increasing.


How do I get testnet block height? Like I would do wget -O - http://blockchain.info/q/getblockcount 2>/dev/null for the main net.

Blockchain.info does not track the testnet, but blockexplorer.com does. In fact the API you're using was originally from blockexplorer.com, and blockchain.info simply adopted it.

wget -O - http://blockexplorer.com/testnet/q/getblockcount 2> /dev/null

or shorter

curl http://blockexplorer.com/testnet/q/getblockcount


C++ error building a fork of Bitcoin-ABC I'm creating a Bitcoin-ABC based altcoin, everything was fine when I compiled dynamically for my Ubuntu machine, but when I try making a static release build I get:

  CXXLD    libbitcoinconsensus.la
.libs/libbitcoinconsensus_la-arith_uint256.o: In function `base_uint<256u>::GetHex() const':
/root/xeroxcoin/src/arith_uint256.cpp:135: undefined reference to `base_blob<256u>::GetHex() const'
.libs/libbitcoinconsensus_la-arith_uint256.o: In function `uint256S(char const*)':
/root/xeroxcoin/src/uint256.h:123: undefined reference to `base_blob<256u>::SetHex(char const*)'
primitives/.libs/libbitcoinconsensus_la-block.o: In function `CBlock::ToString[abi:cxx11]() const':
/root/xeroxcoin/src/primitives/block.cpp:23: undefined reference to `base_blob<256u>::ToString() const'
/root/xeroxcoin/src/primitives/block.cpp:22: undefined reference to `base_blob<256u>::ToString() const'
/root/xeroxcoin/src/primitives/block.cpp:22: undefined reference to `base_blob<256u>::ToString() const'
primitives/.libs/libbitcoinconsensus_la-transaction.o: In function `COutPoint::ToString[abi:cxx11]() const':
/root/xeroxcoin/src/primitives/transaction.cpp:13: undefined reference to `base_blob<256u>::ToString() const'
primitives/.libs/libbitcoinconsensus_la-transaction.o: In function `CTransaction::ToString[abi:cxx11]() const':
/root/xeroxcoin/src/primitives/transaction.cpp:132: undefined reference to `base_blob<256u>::ToString() const'
script/.libs/libbitcoinconsensus_la-interpreter.o: In function `uint256S(char const*)':
/root/xeroxcoin/src/./uint256.h:123: undefined reference to `base_blob<256u>::SetHex(char const*)'
collect2: error: ld returned 1 exit status
Makefile:3619: recipe for target 'libbitcoinconsensus.la' failed
make[2]: *** [libbitcoinconsensus.la] Error 1
make[2]: Leaving directory '/root/xeroxcoin/src'
Makefile:9581: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/xeroxcoin/src'
Makefile:690: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

This is with nearly vanilla Bitcoin-ABC code, and it looks to me like base_blob DOES exist and DOES have those methods.  Help?

I'm getting the exact same problem having forked Bitcoin to create a new altcoin. I believe the problem is related to a template being defined in a cpp rather than h file, and the different order of compilation due to file name changes. If I'm correct, then this reveals a subtle bug in the Bitcoin and Bitcoin ABC sources which should be fed back up the chain to assist future forkers.


Differences between addresses with the same 20B hash (Hash 160) Why the same Hash 160 has different balance in Bitcoin network?

Hash 160 is B0D5D1FB94B76B39EE82771027BEFD17131042FA.

In the one way it is the address 1H825FgspbkznbiGAnAjFjan7dmYFjpsFe that has zero balance.

By the second way, it is the another address 3Hp2zoBKNW5NsmQhHsqKgMwiGA4FoUj9Q4 that has non-zero balance.

I try to track it on blockchain.info site.

Why there are that differences?

Both P2SH and P2PKH addresses rely on HASH160. The difference is in the script.

In a P2SH address (3Hp2zoBKNW5NsmQhHsqKgMwiGA4FoUj9Q4 in your example), the script is a914 B0D5D1FB94B76B39EE82771027BEFD17131042FA 87 (spaces mine). This amounts to OP_HASH160 OP_PUSH(20) B0D5D1FB94B76B39EE82771027BEFD17131042FA OP_EQUAL. In short, the Bitcoin network will take a provided redeemscript and signature data, and compare the hash160 of that redeem script against what is given in the address outputs.

For 1H825FgspbkznbiGAnAjFjan7dmYFjpsFe, the script is 76a914 B0D5D1FB94B76B39EE82771027BEFD17131042FA 88ac (spaces mine). This amounts to OP_DUP OP_HASH160 OP_PUSH(20) B0D5D1FB94B76B39EE82771027BEFD17131042FA OP_EQUALVERIFY OP_CHECKSIG. This essentially tells the network to take the provided public key when spending an input, duplicate it, hash the duplicate, compare it and verify that it equals B0D5D1FB94B76B39EE82771027BEFD17131042FA, then check the signature against the original public key (the one you duplicated).

Wallets and explorers will decide which address format to display based on the opcodes in the script. A P2SH address will always start with a914 and end with 87. A P2PKH will always start with 76a914 and end with 88ac.

Since Hashing by definition is not a one-to-one function, there is some private key out there for which the pubkey hash would be B0D5D1FB94B76B39EE82771027BEFD17131042FA. However, I'm not aware of any known private key/redeem script pairs that correspond to the same HASH160


Deleting Electrum wallet and setting up new one I set up an Electrum wallet before I learnt that you should verify the signature. While I went straight to the electrum.org website to download it, I would still like to be secure, just in case. So I want to start again (I had no crypto yet in this wallet).
What should I do to be sure that I have eliminated all the files for the old wallet from my PC (Windows 10), so there is no chance of confusion when I download a second time? I downloaded the Windows Installer version.

If you're using Electrum on Windows, in my opinion just checking that it is signed with the correct code-signing certificate is sufficient; if any security beyond that is desired, you should use a hardware wallet with Electrum. When you open it, if the Windows UAC prompt says the file is "from the verified publisher Electrum Technologies GmbH", then that should be assurance that the file is the correct Electrum installer.
However, if you just want to delete the wallet files from the old Electrum installation, they are typically located in %appdata%/Electrum.


Explain Coinomi and Edge fee difference? I was looking at two Bitcoin wallets, Coinomi and Edge.
When setting the same custom fee for both, I see a difference in the final fee reported.
As an example, Edge wallet shows a fee of $3.13 (at 200 sats/Byte), while Coinomi shows $4.85.
I'm using the same destination address and amount for both.

Can someone explain this difference in fee?
Will the higher price Coinomi transaction be confirmed in fewer blocks?
Have you come across this before?

Thanks.

Given that you are looking at two different wallets on two different pieces of software, the transactions that the wallets are proposing are different:

they may be using a different count of inputs
one may be using segwit inputs while the other uses non-segwit
one might be a multisig wallet while the other is single-sig
one of them might be able to avoid a change output, while the other doesn't

This will cause the two transactions to have a differing size. Lastly, the two wallets may be using different price sources to translate it to dollars.

As the transactions' priority is determined by their fee rate, both of these transactions are equivalently prioritized at 200 sat/B. The size difference is unlikely to make a big difference for block inclusion.


LN channel lnd + android wallet problem I am running LN node powered by lnd. Also I have installed on my phone a LN  app - Bitcoin Lightning Wallet. I opened a channel from mobile app to lnd node sucessfully (many confirmations), but I cannot request money from the mobile app with only two 'errors':

Receiving not yet enabled by peer (View channel details screen)
Can't ask for Lightning payments because your peer has not allowed receiving yet, this typically happens once a funding Bitcoin transaction gets
confirmations (Receive funds screen)

In lnd (lncli listchannels) i see the channel as inactive ("active": false) , but the other channels opened from lnd are active.

Could you please advise what can I do before I close the channel ? Or explain what I didn't understand? How to bring the channel to active state? My opinion is that mobile wallet is not working well, because I can't generate invoice (payment request). I don't know.

It's a well known problem described here: https://github.com/lightningnetwork/lnd/issues/1347

LND team works on a fix here: https://github.com/lightningnetwork/lnd/pull/1595

Meanwhile i'd recommend to connect to Eclair based nodes to have receiving ability, such as the recommended ACINQ node.


Help recovering BitPay wallet Reward! I had money sent to my wallet and couldn’t remember my encrypt password.  I had my 12 word recovery phrase written down but it’s abbreviated. I deleted my wallet which I shouldn’t have done because I’m sure I would have figured out the encrypt password by now and I’m going crazy with this recovery phrase. The way I store is 6 rows 2 words per row. 1st problem is I don’t know the order, it could go: left right left right... left right right left.... right left right...right left left right.  6 of the words I’m 100%.  4 words have 3 possible options. 1 has 2 options and the last could be a number of things.  I have the address that I had the money sent to (probably doesn’t help).  I know the name of the wallet (sure that doesn’t mean shit)     At this point I’m sure if I just knew the first and last word(the order) I’d figure it out.  I’d pay someone if I wasn’t certain they would take it plus how would they figure it out.  I’ve seen people that charge 10% but why wouldn’t they take it all? What can I do?   Is there a way to know which of my first two words are first

What can I do?

You could find tools that automate the trying of various combinations of seed-words. Some are mentioned in similar questions here. For example btctools, btcrecover. Use them or adapt them to your needs.

Lost my Bitcoin wallet and have only 11 out of 12 mnemonic seed phrase words. How can I get my Bitcoins?
Need help to recover blpckchain.info wallet, my wife forgot her password and the brute force with btcrecover is not catching the password

I would

Not involve other people in this.
Not use software I can't build from source code I read and understand.
Not use the software on a computer that is connected to any network.

If I had no success after a solid year of trying every day, I'd consider handing the problem over to a third party I had very thoroughly vetted.

Obviously if the wallet contains $3.65 or some other trivial amount - just forget about it, the time is not worth spending on this.


What does the keypoololdest field mean? After reading this question I watched the keypoololdest.

It was 1392447127 (Sat, 15 Feb 2014 06:52:07 GMT)
I created a new address.
Then, it was 1392449568 (Sat, 15 Feb 2014 07:32:48 GMT)

Should the time change to be today at the moment of change? It is too old (like one year ago) . If I took a backup now is it sufficient until the "keypoololdest" changes to be more recent than the date of the backup?

The value 1392447127 is exactly Sat, 15 Feb 2014 06:52:07 GMT in  Unix timestamp
check it here : http://www.onlineconversion.com/unix_time.htm

keypoololdest gives the unix timestamp of the oldest key in the key pool (which stores unused keys). This timestamp can be used to check if a wallet backup still covers all your used keys or a new one needs to be created.

At the latest, if the timestamp retrieved with keypoololdest gives a date younger than your youngest backup, you should create a new backup.


Someone else created a wallet for me to use. Is this a scam? Someone on social media is offering me to mine bitcoin and they take 10% of any profit I make. I started talking and long story short I was told to download blockchain wallet app.

They provided me the login credentials and I was told once I login to change my password etc. Does this sound like a scam or legit? I mean about them giving me a user id for a blockchain wallet app and I gotta buy bitcoins, transfer them to this wallet and they will mine bitcoins.

Variant:
The attacker requests that the user creates a new blockchain wallet and then shares the login credentials instead of creating the wallet for the user.

I was told once I login to change my password

It is important you understand why this is a trick intended to deceive you.
Wallets don't contain bitcoin.
Wallets contain a "private key" - it is this private key that gives you control over an amount of bitcoin.
The person who creates a wallet can copy this private key and use it to make a new wallet that has control over the bitcoin. Including control over bitcoin added by you days months or years later.
You changing the password on a wallet does not keep the private key secret and safe if someone else has previously already seen the contents of the wallet.
If it helps, think of the wallet as one of those keysafes with a user-changeable combination to unlock it. If someone has previously  copied the keys inside, changing the combination that opens the keysafe doesn't keep you safe at all.

Keysafe with resettable combination - like a bitcoin wallet. It doesn't contain money. It contains keys that maybe someone already has copies of. Changing the combination on the keysafe (wallet) doesn't make those copies of the keys disappear.

See also
Mining deceptions

I've been asked to share wallet credentials to participate in mining. Is that a scam?
Am I Being Prodded By A Bitcoin Mining Scammer?
Mining in the wallet
Blockchain Wallet
How can I get a private key for this address

Wallet deceptions

I NEED YOUR HELP URGENTLY Bitcoins


Am I being ripped off? I am business man but I am not tech savvy.  Recently, I have needed to use bitcoin for a few business transactions and so I asked my IT guy to buy the bitcoins for me and take care of the transactions.  He told me that due to various fees the $2000 dollars that I gave him only amounted to $1,400 after said fees.  My question is: am I being ripped off?

Fees usually are around 1% for each side (the person trading fiat for Bitcoin and the person trading Bitcoin for fiat).

Exchanges which directly trade with the user usually have different prices for selling and buying, usually 2% to 3% of by each other (1% to 1.5% from the middle so you're slightly worse off than trading with another person through an exchange).

However, there are exchanges which take much higher fees. Many charge extra depending on the payment option chosen on the fiat side. The most expensive serious one I was able to one has a 10% fee when paying via PayPal and a few weeks ago, someone on this site asked a question about how an exchange with a ludicrously high fee (it was around a third of the value exchanged, like in your case) could exist. Well, its existence of course doesn't mean that it's used a lot ... or at all.

You can easily find exchanges for your country by selecting it here and looking for the fees of a few exchanges listed for it.


How does one generate a paper wallet for a Lightning Bitcoin address? Is there a paper wallet generator for a Bitcoin Lightning addresses? How can one generate it in javascript?

A paper wallet is not the correct backup method for a lightning network Bitcoin address/channel.

To use a lightning network channel, you will need to have the private keys accessible to your lightning network software, so that the software can sign transactions to update the channel state. So the advantage of 'keeping your keys offline using a paper wallet' is not applicable: if your keys are offline, you cannot engage with the lightning network.

Further, to backup a lightning channel, you need more information than just the keypairs associated with the address, you also need information about the current state of the channel. A paper wallet generally refers to a physical record of a single keypair, so it is not designed to store this sort of channel-state information.

Further still, a lightning channel is represented by a multi-sig address, of which you will likely know only one of two (or more) keys. So printing out your key onto paper will be of very little use in being able to recover your funds later, since you will need the signatures of your counterparty's keys as well, in order to spend the multisig output.

I suppose if you really wanted to, you could print out the static channel backup file onto paper, but without a good way to later transcribe this information back to your computer, it seems like an unwise choice that will be prone to error.

It is advisable to follow the backup methods implemented in the popular lightning network clients, such as lnd's static channel backups. Here are the relevant commands, from lnd v0.6.0

exportchanbackup   Obtain a static channel back up for a selected channels, or all known channels
verifychanbackup   Verify an existing channel backup
restorechanbackup  Restore an existing single or multi-channel static channel backup


Do I have to make a back up copy every time I make a transaction? In other words when I make another transaction but I only have the original backup when I restore the backup does it only show the amount from my original transaction or will it be updated to the latest transaction if I've made several transactions since my back up?

You just need to backup your private key or your 12 words nothing else

The whole network keep a full backup of all your transactions

If your wallet make new bitcoin address for each transaction you need to keep a backup of your new private key as well


Is it possible to force a person to honor a conditional promise-to-pay? I'm thinking of the situation where you have an auction where bids are placed. There are two conditions that should be held:

Placing a bid shouldn't expose you to paying the seller unless you win the auction
Placing a bid should require that you pay the selling in the case you win the auction

Is it possible to satisfy these two conditions using bitcoins?

It is possible to create a small transaction output as an anchor for each auction: Interested parties would then be able to place their bids by signing a transaction that uses both their bid and the anchor as inputs.

When the time-frame of the auction ends, the auctioneer can countersign the transaction with the highest bid, and since the anchor can only be spent once, all other bids are automatically invalidated.

The transactions would have to be posted through the auction's portal, as they wouldn't be relayed by the network without being signed completely. After they were posted though, everybody could verify that they are valid and the bidder actually has the funds.

One problem is though, that bidders could retract their bid, by doublespending the output used for the bid. This wouldn't be so much a problem if only people bid that actually want to win the auction, but would be a very easy way for the seller to push the price up.
In the end, the auctioneer could just sign the next highest bid then though.

The retracting of bids could be monitored by the auction platform, requiring registration.


Does Bitcoin + mixers = Monero? Moneropedia defines "ring signatures" as:

Ring signatures make sure individual transaction outputs on the blockchain can’t be traced. A ring signature is a group of cryptographic signatures with at least one real participant, but there is no way to tell which in the group is the real one as they all appear valid, while the key image prevents double spends. When sending a transaction, you select some random transaction outputs on the blockchain and mix those with your own “real coins”. Mixing of coins is enforced across the network, making all coins “equal”. Because every transaction output has plausible deniability on their state (spent or unspent), there are no fungibility issues with monero
To read how Monero gives you a privacy by default (unlinkability), see stealth addresses.
A group of cryptographic signatures with at least one real participant, but no way to tell which in the group is the real one as they all appear valid.

It sounds like Moreo's ring signatures are basically a way of building mixing right in. So, is Monero effectively the same as Bitcoin+mixers?

No. Monero's ring signatures draw on Monero's complete TXO set to create a larger anonymity set.

Monero's method has the disadvantage that since it is unclear which TXO were actually spent, they can never be marked as spent and therefore spent TXO  hardly ever leave the TXO set.

In Bitcoin mixers, you're actually dependent on other users also using the same mixer.


Reuse of addresses by a service ("get new address" returning *funded* addresses) Recently, a marketplace was said to have been reusing deposit addresses, such that clicking the "get new address" button would immediately give the user a different address, however, the "new address" was sometimes already funded.

Needless to say, this is terrible OPSEC, but I'm wondering how such an issue could arise. Is it a faulty implementation of BIP32? This seems more likely than reusing keypool addresses for bitcoind, but I'm curious how this issue could arise.

Keep in mind that the marketplace in question may not use bitcoind, and if they do, may not use it in the most sensible way. Some possibilities:

A list of addresses was generated. When it reaches the end of the list, it loops back to the beginning and reuses the old addresses, assuming that nobody should reuse their old one again. (this is a poor design: addresses should not be reused for privacy, and so that in case someone sends to an old address, you know whose is whose)
The addresses were generated with such low entropy that the same addresses were created and used again. (this is a serious security flaw in their setup)

In either case, it's possible that either...

the system records both accounts as owning the address (which is very bad, since you can both spend each other's money), or
only one of the accounts as owning the address. Which is very bad if the one owning it is the old one, since new funds are likely to be sent to the wrong person; or only slightly bad if the one owning it is the new one, since the old account owner may be inactive and should not reuse his old address anyway if he makes another deposit.

Regardless of the details (which you as a user aren't going to know anyway), it would make me very hesitant to use the marketplace, since it points to a dangerously sloppy design.


Where can I find the explanation of each field of the result returned by the api of blockchain.info? Such as in this result: https://blockchain.info/rawtx/6b1c57d98a557b5f578c02f6c386ef049df5890ebddd01d286bf345f47c5cecc

I don't know what ex. the fields "tx_index", "type", "n" mean.

You can find the documentation for that call, such as it is, here. It's not very helpful.

I can give you a few tips, though.

n is the vout of the input. A vout plus a txid unambiguously specify a transaction output, and are collectively known as an outpoint. More.
tx_index is a field used by blockchain.info, and has no meaning outside of blockchain.info's api.
No idea what type means. Looking at a few transactions at random, it always seems to be zero.


How can I run bitcoind on test and production networks, at the same time, on the same computer? Bitcoin and Bitcoind will send an error if it is launched multiple times.  I'm assuming this is because they share the same database and wallet.

Is it possible to run two instances of Bitcoin QT / bitcoind with one listening on Production and the other on Test? (on the same computer)

Is this advisable or not advisable?

You can run a mainnet and testnet bitcoind next to eachother without problems. They do not share the same database (one will use the testnet3/ subdirectory).

What will conflict is the RPC port, as they will both try to bind to port 8332 for receiving RPC connections. Use -rpcport=N on one of them to use a different port.


regarding transaction size in a block In What are the minimum sizes for transactions and blocks in Bitcoin?

The first transaction is set to be 65 bytes long, due to coinbase requirements. What about the second one ? That can be 61 bytes long ? Also, does each transaction carry a counter ? How is that added to the byte count.

What about the second one ? That can be 61 bytes long ?

Yes.

  Also, does each transaction carry a counter ?

No. There is a global counter in the block that is right after the block header. That counter is the number of transactions included in the block. It is not part of any transaction and its size does not affect the size of any transaction in the block (compared to when that transaction was unconfirmed and in the mempool).

The transactions come after that counter just listed one after another with no additional information separating them (transactions follow a specific format so it is trivial to know when one ends and the next starts).


Size of the blockchain after pruning What is the size of the blockchain stored on a user harddrive after pruning has occurred?

You can set a limit for blockchain data by starting your node with -prune=<n>.

-prune=<n> gives the target size in MiB to use for block files

This limit will only include the blocks and reorganization data. You also need some space for chain state, block index database, and wallet.

I run my node with -prune=20480 (i.e. 20 GiB) and fully caught up the whole directory has 20.77 GiB or 22.30 GB.

I suggest that you leave a few GiB room for overhead.


What is the current state of the Hashcash protocol that is cited in the Bitcoin whitepaper? I have been reading the Hashcash paper which is referenced in the Bitcoin whitepaper. I would like to know what is the current state of the Hashcash protocol and what are the services that are actively using it?

There is no serious usage, and has never been, of Hashcash.

Most obviously, the disparity between the resources of a spammer (who can rent a botnet of stolen compute resources, or use high powered servers and GPUs) is no match for a user sending an email from their phone with limited power available . This simply means that the difficulty of generating a "stamp" has to be so high that only spammers are able to send messages, which defeats the purpose.


What happens when hash160 is same There are two bitcoin address:
(A) 1111111111111111111114oLvT2
(B) 31h1vYVSYuKP6AhS86fbRdMw9XHieotbST
which has the same hash160:
0000000000000000000000000000000000000000
How is this possible and what are the consequences?

https://www.blockchain.com/btc/address/1111111111111111111114oLvT2
and
https://www.blockchain.com/btc/address/31h1vYVSYuKP6AhS86fbRdMw9XHieotbST

Technically speaking, these are not identical hashes, because they are not hashes. They're just addresses someone created by encoding the value 0000...0000 into a P2PKH and a P2SH address.

Funds sent to those addresses cannot be spent, for two reasons.

It would require finding a public key or script whose hash is 0000...0000, which is assumed to be impossible (SHA256 or RIPEMD160 would be broken if that was the case).
Even the value wasn't 0000...0000, but the hash of an actual public key, it would still be impossible to find a script whose hash was equal. Alternatively, if it was the hash of a script, it would be impossible to find a public key with the same hash.


Can mining puzzles be made socially valuable? Bitcoin miners work to solve a random puzzle as "proof of work".  A huge amount of raw computing power is going into finding the solution to these puzzles, yet the actual solution to the puzzle serves no purpose other than to demonstrate that whoever found the solution has access to a great deal of computing power.  Can the bitcoin protocol be modified to accept puzzles from the real world who's solution would actually have some social value?  Perhaps some scientists, governments, or corporations would be willing to pay some amount to whoever solves some reasonably complex computational problem first, and they could contribute some BTC towards the reward a miner receives.

I understand that the particular puzzle chosen is very clever, particularly as its complexity may be easily adjusted as needed, the solution is well defined and easy to verify, and there's virtually no limit to the creation of new puzzles.  I just wonder if something even more clever could be incorporated, if someone ever manages to come up with it.

To clarify, the analogy I have in mind is the way reCAPTCHAs have virtually replaced traditional CAPTCHAs, substituting socially valuable book digitization work for a socially useless text-guessing exercise.

To be valid as a proof of work a problem needs to

be difficult to produce, and it's difficulty must scale up and down as the network speed requires. The levels of difficulty must be quite granular, bitcoin's go down to several decimal places to ensure an even blocktime.
have no central issuer, the work must be independently creatable and verifiable. No central authority should be needed to produce problems and solutions.
be quick to verify even on microprocessors, every node in the network must verify it 300,000 times over to synchronize with the blockchain today. Currently I can verify a sha256 merkle tree proof on a processor that costs a few cents in bulk;  scrypt coins are almost useless in that you need a huge amount of memory to verify the proofs.

Nothing else can fit this bill at all. Primecoin attempted this, but it's method has removed the ability for SPV clients to operate (kilobytes of stupid number strings in the block headers), and the work it produces (certain types of prime numbers in a sequence) is merely a curiosity rather than anything usable by anybody.

It must be a cryptographic hash. The simple fact that it is protecting the network means that it is not "useless".


What is happening after backup? Let's say I have a wallet backup burned on a CD. In that moment I have 10 coins. And I start to make transactions. Then my hard-drive crashes and in the moment of crash I have 20 coins. When I restore my wallet.dat from CD what I see in Bitcoin wallet? I need to make a backup after each transaction?

Assuming you have not created any new bitcoin addresses from the time that you had only 10 coins, your balance will remain intact (20 BTC) when you load your private keys into another client.

In other words, your client doesn't store your coins locally, it only stores a reference (through your keys) to the unspent transactions that have been received by your addresses which at a high level compose your wallet's balance.


If I reuse the same address can a previously used transaction be reused? I was wondering, if I used an address adr0 to spend some coins in a transaction tx0 that give the coins to a different address adr1, and eventually, after some time, I receive some (completely unrelated) coins to the same address adr0. Can somebody take the transaction tx0 I signed and publish it in order to spend the new coins with the old transaction? (after all, they belong to the same address, and I already signed and gave a transaction that spends coins from this address).

If so, how is it that address reuse is not directly forbidden?
if not, can you detail why?

Can somebody take the transaction tx0 I signed and publish it in order to spend the new coins with the old transaction?

No.

Firstly, the transaction inputs are already known to have been used. Any node examining the block will know that the rerun transaction has invalid inputs.

Secondly I expect (but haven't checked) the inputs to the signature include both addresses. This prevents the signature being misused in the way you suggest. (See Murch's clarification in comment below)

It may help (if not you, some other readers) to remember that bitcoins don't exist outside or inside the blockchain. The only thing that exists are transaction inputs and outputs. You can't use a signed transaction with inputs A,B and C to use inputs D and E. The signature prevents you altering the signed contents without invalidating the signature.

  how is it that address reuse is not directly forbidden? if not, can you detail why?

Addresses can be reused. The most obvious problem is one of privacy. If you give someone an address so they can buy $0.01 of tent-pegs from you, they can then see on the blockchain that you also received $300,000,000 recently to that address and go buy a big hammer and come to visit you at 3 a.m.


Government disrupting reception of bitcoins. Is it possible? I was thinking of a very specific scenario: Suppose we have a new organization, let's call it "WikiLeaks2", which receives donnations mostly in the form of Bitcoins. Suppose a national government tries to shut it down by disrupting its reception of funds, so they set up a number of miners with the code modified so they check each transaction against a list of black-listed Bitcoin addresses (among them, that of WikiLeaks2) and automatically reject a transaction coming to/from those addresses.

Let's assume this government has successfully set up moles deep within the organization, so any new reception address is known by its agents after a few minutes. Would they need to control 51% of mining power to make it impossible to send funds to such an organization, or would disruption be possible with a fewer percentage?

Which begs the question: who validates the acceptance/rejection of a transaction, done by the miners, is correct? I.e. who validates the validators?

Would they need to control 51% of mining power to make it impossible to send funds to such an organization

If you have less than half of the mining power:
You control what transactions go into blocks you mine. You can definitely slow down payments to WikiLeaks2. However, you can't prevent payments from going out forever. Other miners will look at the WikiLeaks2 transactions, see nothing wrong with them, and include them into their blocks. You cannot do a 51% attack because the honest nodes, working together, will simply overpower you.
If you have more than half of the mining power: (51%)
You can now prevent everyone else from getting blocks. This means that you can prevent transactions you don't like from getting confirmations forever.

  Which begs the question: who validates the acceptance/rejection of a transaction, done by the miners, is correct? I.e. who validates the validators?

Certain network rules are never voted about - For example, transactions must be signed, a block must have a valid timestamp, you can't spend more bitcoins than you have, that sort of thing.

What bitcoin miners do vote about is what should be on this global, shared, ordered list of transactions.


Bitcoind with -txindex=1 still no mempool transactions I'm reading through Mastering Bitcoin and trying to follow along the examples.

When I first initialized bitcoind, I set txindex=1 in my bitcoin.conf file. In a later example I was unable to getrawtransaction which failed with the error No such mempool transaction. I re-ran bitcoind with the -txindex=1 and -reindex flags, which took a few hours.

However I'm still unable to getrawtransaction, which again fails with the same error.

Have anyone experienced the same issues? Perhaps there is something else that needs to be done for this to work in v0.16.0?

Any advice would be appreciated. Thanks.

Edit 1:

~/Library/Application Support/Bitcoin/bitcoin.conf:

txindex=1

~/Library/Application Support/Bitcoin/debug.log:

Dropbox link

According to your debug.log file, txindex is not enabled:

2018-04-22 20:40:34 LoadBlockIndexDB: transaction index disabled

This indicates that your bitcoin.conf is incorrect. Make sure that your bitcoin.conf file's full filename is actually bitcoin.conf (not bitcoin.conf.txt or with some other extension).


Since transaction fees are based on the "size" in bytes of the transaction, why is it cheaper use "sendmany" rather than just making several? Since transaction fees are based on the "size" in bytes of the transaction, why is it cheaper use a "sendmany" transaction rather than just making several/many separate "normal" transactions? I don't understand where the "overhead" lies that makes it so much cheaper to "bundle together" transactions like this.

The actual purpose of a regular transaction is to create one or more recipient outputs to pay someone. One could therefore think of the recipient outputs as the "payload" of a transaction, and the remainder of the transaction as the overhead to achieve the transaction's purpose.
Let's assume that we send a single payment in a transaction with one input, the recipient output, and a change output. Assuming that the transaction only uses P2WPKH outputs, the input weighs 68 vB, each output ways 31 vB. The transaction also has a header of 10.5 vB.
This means that the total weight of the transaction is 10.5 + 68 + 31 + 31 = 140.5 vB, i.e. 140.5 vB per payment. Note that your wallet will also need to spend every change output it creates in the future, so we also incur a future "blockspace debt" of 68 vB.

Let's say our wallet performs a high volume of payments, and we have a bit of flexibility when we pay exactly, so we are able to batch multiple payments into one transaction. Instead of making one payment, we perform three payments in a single transaction. Let's assume that our wallet needs to use three inputs to fund the payment: 10.5 + 3 × 68 + 3 × 31 + 31 = 338.5 vB. Even though we still have the same number of inputs per payment, we now only need 112.8 vB per payment instead of 140.5 vB. And we only have to spend a single change output in the future instead of three, which saves us another 2×68 vbytes of future transaction weight.

More often than not, we might have a particularly valuable UTXO in our wallet, and we can fund all three payments with a single input. The calculation now becomes: 10.5 + 68 + 3 × 31 + 31 = 202.5 vB which drops us to 67.5 vB per payment, and still only a single change output.

Note that payment batching has diminishing returns with more payments as the cost per payment approaches the actual size of the output. E.g. for ten payments the weight drops to 41.95 vB per payment, for twenty payments it's 36.475 vB per payment, for 100 payments, it's 32.1 vB. Also, eventually, a single input may not be sufficient to fund your transaction.


Why does Satoshi's public key have the uid "BuZz Spacedout" This is more of a historical question about bitcoin than a technical question. Hope that's okay...

Does anyone happen to know why the public key numbered:

pub  1024D/5EC948A1 2008-10-30

Available, for example, at pgp.mit.edu has the uid:

uid BuZz Spacedout   <satoshin@gmx.com>

containing the string "BuZz Spacedout"?

I've been told that this is Satoshi's public key and I was just wondering about the origin of the name "BuZz Spacedout". Is that another pseudonym that Satoshi commonly used besides Satoshi? Anyone know why he/she/they didn't choose "Satoshi Nakamoto" rather than "BuZz Spacedout"?

Cheers.

This is what I see for a search on pgp.mit.eud, which points to this key:

That is a surprising result.  If we download the key purported to be Nakamoto's from Bitcoin.org, we get the following fingerprint:

pub   1024D/5EC948A1 2008-10-30
      Key fingerprint = DE4E FCA3 E1AB 9E41 CE96  CECB 18C0 9E86 5EC9 48A1
uid                  Satoshi Nakamoto <satoshin@gmx.com>
sub   2048g/D6AAA69F 2008-10-30

Downloading the key from pgp.mit.edu seems to provide a key with the same fingerprint (notice it says that the key is updated, not new:

$ gpg --keyserver pgp.mit.edu --recv-keys 5ec948a1
gpg: requesting key 5EC948A1 from hkp server pgp.mit.edu
gpg: key 5EC948A1: "Satoshi Nakamoto <satoshin@gmx.com>" not changed
gpg: Total number processed: 1
gpg:         new signatures: 36

However, when I list the updated key, it hasn't changed (as the previous message indicated, there are only new signatures):

$ gpg -k satoshi
pub   1024D/5EC948A1 2008-10-30
uid                  Satoshi Nakamoto <satoshin@gmx.com>
sub   2048g/D6AAA69F 2008-10-30

I've tried adding other options like -vv for verbose and --list-options=show-unusable-uids for possibly retired user identities but I've been unable to find the "BuZz Spacedout" identity.  I also tried running the ASCII-armored text through a base64 decoder, but that didn't give me usable results.

I don't know enough about GPG to investigate the actual key contents further.  What I suspect happened is:

Someone used a tool to brute-force enough of Nakamoto's key id that the MIT keyserver got confused.
The MIT keyserver was confused in another way.

Happily, local GPG (which is what's important) doesn't seem to be confused at all, so we can be pretty sure it's not the case that Nakamoto has the total lame stoner name of BuZz SpacedOut.