Ripple difference between source and destination tags I don't understand the real difference between source and destination tags.

Imagine we have client A and service B, and service B wants to identify the payment (deposit from A). He says: please send funds to address (0x123 and use destination tag "12345") why he should ask A to use destination tag but not source tag?

Why A can't use source tag '12345', can't B still identify A payment from source tag?

The ledger itself doesn't really care what tags you attach to a payment. They're just used to help exchanges or wallet services know who to credit for a payment.

The standard use of the a destination tag is to identify the recipient of a payment. The idea is that whoever or whatever controls the account that received the payment will look at the destination tag and know how to properly credit the payment.

While the source tag is rarely used, it serves a complementary purpose. Say Jeff has an account at exchange A and wants to send XRP to exchange B. He fills in exchange B's account and a destination tag that exchange B knows means to credit Jeff and asks exchange a to make the payment.

Now, suppose for some reason exchange B can't credit Jeff. Maybe his account his closed. Maybe he got the destination tag wrong. If exchange B doesn't know who to contact, they might try to return the payment. But if they just send it back to exchange A's account, how will they know to credit Jeff?

This is where the source tag comes in. If exchange A uses a source tag that it associated with Jeff's account in the payment, then exchange B can use that as the destination tag if it needs to refund, return, or partially refund the payment. It can use the incoming source tag as an outgoing destination tag and Jeff will get his XRP back.


What's the difference between xpub and bpub? I've seen extended public keys such as the one below

xpub661MyMwAqRbcFLCsW67CH9AgprkK2MbeLbmdMiBRWb1Wamm6GjGhTFQChvPmwQGQh78MMd8Eu7CLJ7FEuwhsomD66XC74VnfgHdEx1NFSKL

But now I've seen a bpub

bpubgqxJY83YqBS1rgM392MqkPnaa7P8yBEkZ7pZksTUHjRxQRn8RzuL8ST1NYhAqgbM7f3SDzTTJifL1WuCYvVxHinLuhF4kFdnBNN34N4Y2et

What's the difference?

bpub appears to be the extended private key prefix for the Blockcypher testnet.

Bitcoin addresses and private keys usually have a prefix to help differentiate the network/type of key.

The original xpub notation comes from BIP32, meaning extended public key. This expanded into ypub with BIP49, and finally zpub with BIP49+ (used in BIP84).

Various coins can define their own prefix by simply altering the bytes. Litecoin, for instance, often uses Ltub.

It works the same way as changing the address prefix, except you change four bytes, instead of one.


Bitcoin market hours (open/close prices) If Bitcoin trading never stops then what does it mean when news sites and others talk about bitcoin opening or closing at a certain price, and why is this terminology used?

Could two people mean different things when they talk about the closing price at the same date? (apart from price differences between exchanges)

In 24 hour markets High and Low usually mean "highest/lowest price in last 24 hours".

Open generally refers to the price at 12:01 AM UTC of any given day and close generally refers to the price at 11:59 PM UTC of any given day.


Can I use one graphics card for games and one for Bitcoin mining, without losing performance? I have a GTX660 right now, but I bought an R9 290x recently. I was wondering if I can leave both in my pc and use one (the GTX660) for Bitcoin mining and one (the R9 290x) for everything else (mostly games).

Is this even possible?
Will it decrease gaming performance to run a miner on a separate card?

The rest of my specs:
i7 3820 @ 3.60 GHz
16GB DDR3 RAM @ 1333MHz
Asus 2011 P9X79 Pro
Windows 8 pro

I bought the new card for gaming, but if it would be possible to do this with my old card without losing performance that would be great.

With the advent of ASICs, Bitcoin GPU mining is no longer profitable. I would recommend mining a Scrypt coin such as Dogecoin or Litecoin. (You can then trade it in for Bitcoin on an exchange, if you prefer.)

To answer your original question, yes, you can use one card for mining and the other for actually running the computer.


lightning-cli list only my channels After connecting to a busy lighnting node such as 03c856d2dbec7454c48f311031f06bb99e3ca1ab15a9b9b35de14e139aa663b463@testnet-lnd.htlc.me the number of channels my own lightning node knows about becomes very large.

Is there a way to get the lightning-cli listchannels command to apply a filter and list only the channels my node is directly participating in?

The command you are looking for is listpeers. That will only show your direct peers and the channels you have open with them.


Why all miners produce the same blocks My understanding is that all miners are feeded with transactions published by full node servers, but I didn't understand why they end up with exactly the same transactions in their created blocks ? Why miner A doesn't produce a block with saying 4 transactions and miner B produce a block with, for instance again, 3 transactions ?

Nodes will relay all transactions to each other, true. But, how do you know all miners have the same block if only one is actually published? In any case, miners are incentivized monetarily to include the transactions with the highest fee rate (fee/kB) because the miner gets all of the transaction fees. So, it would not be surprising if miners had similar blocks since they all would presumable try to maximize the transaction fees.


I'm in the uk, I wish to purchase bitcoins, but the process seems to be very convoluted. There has to be an easy way? Any way that doesn't involve days of delay, verification etc? Are private traders available?

Provided there is someone near you who advertises on LocalBitcoins, it's probably the most effortless solution available at the moment.


How to sign rawtransaction with private key How to sign raw transaction with private key.
this is my raw transaction :

0200000001fcd54594bba82795afa84ebf500b3944546117c9371e951fc4539e7455ebafb20000000000ffffffff01b8f902000000000017a914b4e6b1471691d9e9e54cd19d39c8565bcadeb3338700000000

which is made by bitcoin-cli createrawtransaction .

That raw transaction made in server.

And I want to sign this raw transaction in my local PC.
How do I sign that with private key?

Please let me know with the sample code.
My language is java.

Very Thank you.

With java? Sign it with the program that created the raw transaction, bitcoin-cli.
With signrawtransactionwithwallet.
Or with signrawtransactionwithkey (0.17.0 RPC)
signrawtransactionwithkey "hexstring" ["privatekey1",...] ( [{"txid":"id","vout":n,"scriptPubKey":"hex","redeemScript":"hex","amount":value},...]
take txid,vout,scriptPubKey from an online explorer, live.blockcypher.com
redeemScript should be blank.
"raw transaction" "["priv key"]" "[{"txid":"the taxid","vout":the vout integer,"scriptPubKey":"from the explorer","redeemScript":"","amount":the amount}]"
after sign, if want to call sendrawtransaction, if the tx id is not synced will be "Missing Inputs"(in dogecoin-1.10.0 executed) ; or if wallet is offline or if started with -noconnect, then broadcast the transaction online like here https://live.blockcypher.com/btc/pushtx/
More info to deal with a -noconnect and no synced data situation: How to send bitcoin from an offline Bitcoin Core that doesn't have a synced balance?


What would be the second greatest bottleneck in the mining process? after the hash generation of course. Lets pretend theres a fantasy world where I can produce an infinite amount of hashes no time at all...

What is the next biggest bottleneck for bitcoin mining?

Is it the bitcoin client? Is the client multi-threaded?
How many requests per second can I send into a bitcoin client for trying hashes?

Or will it be another factor?

You make one call to bitcoind using getblocktemplate to get a template for a block. Then you can generate all the work you need.

In the fantasy world you would find a block instantly. You submit this block and get another template to create the next block.

You would be generating hundreds or thousands of blocks per second. The only thing to slow you down is bitcoind validating blocks and pushing them out on the network.

We will find out what the limit is as new alt coins are created daily, usually with the only "feature" being faster and faster block generation. Once we have an alt coin producing 1000 blocks per second, perhaps we will see some issues (other than disk space).


How do I calculate the expected shares per minute for my pool I am currently mining Zencash in a pool, and I'd like to be able to calculate the expected shares per minute for a given pool's hashrate. Let's say the pool's hashrate is 50 KSol/s. I think that the shares would need to be standardized to some share difficulty, let's call it one. The current block difficulty is 764,414.6217 (11.0 block reward). I've been digging around and it's hard to find the math involved in this. Does anyone know how to do this for Zencash?

I was able to find some information from this page...

https://arxiv.org/abs/1112.4980

I think I was able to figure out the formula, but somebody please correct me if I am wrong. The formula is not very difficult, but you must know the number of hashes that correspond to a minimum difficulty of 1 (share difficulty). This is easy to find for some currencies (bitcoin, 2^32), but very difficult to find for others. For Zencash, it is 8192 or 2^13. The formula to determine the expected blocks per minute for Zencash is:

  blocks_per_time = (hashrate * seconds) / (8192 * block_difficulty)

In our case, the estimated blocks per minute would be:

(50000 * 60) / (8192 * 764414.6217) = 4.791e-4 blocks/min.

Then if we know it takes an average of 764,414.6217 difficulty-1 shares to solve a block, then we can calculate the pool's shares/min as:

  shares_per_min = blocks_per_min * block_difficulty

shares_per_min = 4.791e-4 * 764414.6217 = 366.2.

Or, we can simplify the original equation to estimate the given shares/min in a pool based on a given pool hashrate as:

  shares_per_min = (hashrate * 60 seconds) / 8192

shares_per_min = (50000 * 60) / 8192. = 366.2

Based on this (and the reason I wanted to know the answer to this question), you can see that if you stop mining on a PPLNS pool with a steady hashrate of 50 kH/s where n=20000, you're estimated reward should fall to zero after about 54 minutes. Of course, your shares are very likely submitted at a higher difficulty than one, but this shouldn't affect that calculation.


Can importing a bitcoin address retrieve the lost coins with it? I wish to know if its possible to get the lost coins back if you retrieve the BITCOIN address to which they were sent?

If you have the private key for the address that holds the Bitcoin, you still have control over those coins and they wouldn’t be considered lost. If you sent bitcoin to an address for which you don’t have the private key, then you cannot retrieve them unless the owner of the private key to whom you sent them sends the Bitcoin back to your address or gives you the private key to their address.


Extract genesis block raw TX data RPC does not return the raw transaction for the genesis block. I need to get this data for other coins to be able to add them to ABE.

https://github.com/bitcoin-abe/bitcoin-abe/blob/master/Abe/genesis_tx.py

As the RPC does not return it I presume that I need to somehow parse the actual blockchain files to extract it but have no idea how.

Any advice on getting the raw hex TX for any coin?

Of course you can :) Bitcoin full node keeps a blockchain database in local machine.
Here is a step-by-step instruction to get the genesis transaction information.

 Find block data file.s In mac, it locates at "~/Library/Application Support/Bitcoin/blocks/blkxxxxx.dat"
 Use the given following code to decode the genesis block
 Now got every detail about the genesis block and the coinbase transaction in genesis block, including  tx_version, tx_input_num, tx_prev_output, script_length, scriptsig, sequence, tx_output_num ...

import struct # make conversation between Python values and C structsrepresented as Python strings
import StringIO # Reads and writes a string buffer
import mmap # mutable string

class BCDataStream(object):
  def __init__(self):
    self.input = None
    self.read_cursor = 0

  def clear(self):
    self.input = None
    self.read_cursor = 0

  def write(self, bytes):  # Initialize with string of bytes
    if self.input is None:
      self.input = bytes
    else:
      self.input += bytes

  def map_file(self, file, start):  # Initialize with bytes from file
    self.input = mmap.mmap(file.fileno(), 0, access=mmap.ACCESS_READ)
    self.read_cursor = start
  def seek_file(self, position):
    self.read_cursor = position
  def close_file(self):
    self.input.close()

  def read_string(self):
    # Strings are encoded depending on length:
    # 0 to 252 :  1-byte-length followed by bytes (if any)
    # 253 to 65,535 : byte'253' 2-byte-length followed by bytes
    # 65,536 to 4,294,967,295 : byte '254' 4-byte-length followed by bytes
    # ... and the Bitcoin client is coded to understand:
    # greater than 4,294,967,295 : byte '255' 8-byte-length followed by bytes of string
    # ... but I don't think it actually handles any strings that big.
    if self.input is None:
      raise SerializationError("call write(bytes) before trying to deserialize")

    try:
      length = self.read_compact_size()
    except IndexError:
      raise SerializationError("attempt to read past end of buffer")

    return self.read_bytes(length)

  def write_string(self, string):
    # Length-encoded as with read-string
    self.write_compact_size(len(string))
    self.write(string)

  def read_bytes(self, length):
    try:
      result = self.input[self.read_cursor:self.read_cursor+length]
      self.read_cursor += length
      return result
    except IndexError:
      raise SerializationError("attempt to read past end of buffer")

    return ''

  def read_boolean(self): return self.read_bytes(1)[0] != chr(0)
  def read_int16  (self): return self._read_num('<h')
  def read_uint16 (self): return self._read_num('<H')
  def read_int32  (self): return self._read_num('<i')
  def read_uint32 (self): return self._read_num('<I')
  def read_int64  (self): return self._read_num('<q')
  def read_uint64 (self): return self._read_num('<Q')

  def write_boolean(self, val): return self.write(chr(1) if val else chr(0))
  def write_int16  (self, val): return self._write_num('<h', val)
  def write_uint16 (self, val): return self._write_num('<H', val)
  def write_int32  (self, val): return self._write_num('<i', val)
  def write_uint32 (self, val): return self._write_num('<I', val)
  def write_int64  (self, val): return self._write_num('<q', val)
  def write_uint64 (self, val): return self._write_num('<Q', val)

  def read_compact_size(self):
    size = ord(self.input[self.read_cursor])
    self.read_cursor += 1
    if size == 253:
      size = self._read_num('<H')
    elif size == 254:
      size = self._read_num('<I')
    elif size == 255:
      size = self._read_num('<Q')
    return size

  def write_compact_size(self, size):
    if size < 0:
      raise SerializationError("attempt to write size < 0")
    elif size < 253:
       self.write(chr(size))
    elif size < 2**16:
      self.write('\xfd')
      self._write_num('<H', size)
    elif size < 2**32:
      self.write('\xfe')
      self._write_num('<I', size)
    elif size < 2**64:
      self.write('\xff')
      self._write_num('<Q', size)

  def _read_num(self, format):
    (i,) = struct.unpack_from(format, self.input, self.read_cursor)
    self.read_cursor += struct.calcsize(format)
    return i

  def _write_num(self, format, num):
    s = struct.pack(format, num)
    self.write(s)

def import_blkdat():
    pass

ds = BCDataStream()
file = open("/Users/junton/Library/Application Support/Bitcoin/blocks/blk00000.dat", "rb")
ds.map_file(file, 0)

# Read file
# https://bitcoin.org/en/developer-reference#block-headers
# https://en.bitcoin.it/wiki/Protocol_specification#block
magic            = ds.read_bytes(4).encode('hex')
block_size       = int(ds.read_bytes(4).encode('hex'), 16)
version          = ds.read_bytes(4).encode('hex')
prev_header_hash = ds.read_bytes(32).encode('hex')
merkle_root_hash = ds.read_bytes(32).encode('hex')
timestamp        = ds.read_bytes(4).encode('hex')
nBits            = ds.read_bytes(4).encode('hex')
nonce            = ds.read_bytes(4).encode('hex')

num_of_transaction = ds.read_bytes(1).encode('hex')
tx_version         = ds.read_bytes(4).encode('hex')
tx_input           = ds.read_bytes(1).encode('hex')
tx_prev_output     = ds.read_bytes(36).encode('hex')
script_length      = ds.read_bytes(1).encode('hex')
scriptsig          = ds.read_bytes(int((script_length), 16)).encode('hex')
sequence           = ds.read_bytes(4).encode('hex')
tx_output          = ds.read_bytes(1).encode('hex')
BTC_num            = ds.read_bytes(8).encode('hex')
pk_script_len      = ds.read_bytes(1).encode('hex')
pk_script          = ds.read_bytes(int(pk_script_len, 16)).encode('hex')
lock_time          = ds.read_bytes(4).encode('hex')

print 'magic: '       + magic
print 'block_size: '  + str(block_size)
print 'version: '     + version
print 'prevHash: '    + prev_header_hash
print 'merkle_root: ' + merkle_root_hash
print 'timestamp: '   + timestamp
print 'nBits: '       + nBits
print 'nonce: '       + nonce

print '--------------------- Transaction Details: ---------------------'
print 'num_of_transaction: ' + num_of_transaction
print 'tx_version: ' + tx_version
print 'tx_input_num: ' + tx_input
print 'tx_prev_output: ' + tx_prev_output
print 'script_length: ' + script_length
print 'scriptsig: ' + scriptsig
print 'sequence: ' + sequence
print 'tx_ouput_num: ' + tx_output
print 'BTC_num: ' + BTC_num
print 'pk_script_len: ' + pk_script_len
print 'pk_script: ' + pk_script
print 'lock_time: ' + lock_time

ds.close_file()


My bitcoin-qt client connection status and uptime at http://blockchain.info/connected-nodes does not show reliably - why? I've been running a Bitcoin-qt client (v0.7.2 beta) on my Mac for over 24 hours, with blockchain fully sync'ed.

I checked http://blockchain.info/connected-nodes at various times for my IP address. In the first few hours my IP appeared in the list. Then it disappeared for maybe 10 or 15 hours. Currently, it's back in the list, but showing a connection time of only 62 minutes, despite my network connection and IP address being completely stable, and a steady stream of inbound & outbound network traffic to/from the Bitcoin-qt client during the entire >28 hour period since I started it up.

Why would my IP show up at http://blockchain.info/connected-nodes for a certain time, then disappear from the list, then re-appear?

(It also appears that, as of this writing (2013-02-19  18:02:30 UTC,) no client on the list has a connection time of more than about 340-360 minutes. I'd expect it to be in the thousands to tens of thousands of minutes for at least some clients.)

The list on http://blockchain.info/connected-nodes is just a list of nodes currently connected to that specific business' bitcoind server. It has no connection to the list of all Bitcoin nodes connected to other nodes. This hypothetical list doesn't exist anywhere, for obvious reasons, and would be 10 to 20 times longer than blockchain.info's list.

Blockchain.info's server is not authoratative in any way and has no formal connection to the "official" Bitcoin client (bitcoin-qt), the Bitcoin project, or Bitcoin.org.

As for the 360 minutes thing, Blockchain.info's bitcoind server probably prunes clients connected for 6 hours for whatever reasons that business has decided to do that. Or perhaps their bitcoind server lost its internet connection momentarily around 6 hours before you checked their connected nodes list.


Third party gambling In my country of Norway online gambling is legal, but the banks are not permitted to transfer money to online gambling companies. So all transfers of money to online gambling sites are done thru third party. is it possible to set up a system using bitcoins to allow people to transfer money to and from a online gambling site?

I'm not a gambler, but it's probably doable:

It depends what sort of payments your chosen gambling site accepts. If they accept bitcoins, then simply buy some BTC at an exchange funded using your bank account, then withdraw your new BTC from the exchange directly into your gambling account.

If you chosen gambling site doesn't accept BTC, you could always still transfer it via and exchange, although this seems a bit silly as there are probably cheaper services to send the money via.

With this method, you'll obviously incur transaction fees at the exchange, as well as deposit/withdrawal fees, and possibly currency conversion fees.

Another alternative that wouldn't use Bitcoin would be to send the money via TransferWise. TransferWise recently stopped handling Bitcoin related transactions, they also may not be happy about sending money to gambling websites, although I'm not sure.

tl;dr Yes - convert it to Bitcoin and back into fiat if that's all your gambling site accepts. Could prove costly though.


Is there a correlation between Technical Analysis predictions and actual prices? Technical Analysis is a disputed method for "predicting" future prices. This blog has been offering technical analysis on Bitcoin for quite some time (AFAIK it's the only one).

Has there been any significant correlation between its predictions (Short/Mid term UP/DOWN) to actual price movements?

If you are talking about Technical Analysis in general, we would need to write a book to answer that.

As for Technical Analysis applied to Bitcoin, just look at the date when the predictions were made, look at the graphs and compare. During the last couple of months:

He wrongly predicted a short term rally starting at $14 at the end of July
He correctly predicted the short term fall to $6 at the beginning of August
He has been predicting a long term up trend for two months that hasn't happened yet

Overall, I think his analysis are well documented and based on market indicators that work very well in other markets. However, I am not sure if the Bitcoin market got to the point where Technical Analysis plays an important role for price movements. No one can really tell because this is not an exact science.


How should centralized wallets handle user accounts? I tried to generalize this question from one I asked on the BitcoinJ development list.

I'm working on a project that requires a centralized wallet. From what I gather, these types of services generally rely upon simple balance checks to ensure that an individual user doesn't spend more than is in their wallet. That is, all users share a pool of keys, and the only thing tracking each user's balance is the service's database.

The Bitcoin daemon exposes functionality not in the GUI, namely that of accounts. An account is a string that groups keys. You can send from an account, and it will only gather coins owned by the keys in that account. This is beneficial, but is fairly limited. Using this however, you could have each account be a unique identifier for a user, and then that user "owns" the associated keys. One seeming drawback to this is that there is one centralized location to change ownership of an account.

I came up with a potentially better solution. Each account "owns" one or more public key hashes (the meat of a Bitcoin address). When creating a transaction, the service will transmit these hashes, letting the wallet know that when scanning unspent outputs, only use those with a public key hash owned by the user. In this way, without associating a user account with the private key itself, we are able to allow the user to have exclusive access to any number of keys.

Does this seem like a good solution to the problem? Is there something better that I'm missing?

In this way, without associating a user account with the private key itself, we are able to allow the user to have exclusive access to any number of keys.

A very significant benefit that wallet services can offer is immediate and invisible transfer of coins between their accounts, by just updating their internal databases, without going through the block chain. This is how you can facilitate trades on MtGox for example, and it also provides increased anonymity, because you can now make transactions that are not visible on the block chain (and the transactions that are visible are withdrawal and deposits into the service as a whole, and those addresses are shared between many users, so also effectively anonymized). Obviously, this will not work unless the service can "redistribute" all the coins in all its addresses at will internally. (And obviously this also only works if every account holder trusts the wallet service to not take all the coins and make a run for it).

  Each account "owns" one or more public key hashes (the meat of a Bitcoin address).

Actually, for making deposits, this is how it already works with wallet services. There is a (or many) receiving address (sometimes for one-time use, sometimes stable and fit for publication) that is associated with every account holder. You deposit to the account using that address. However, the private key remains with the wallet service, and can be used by it for all kinds of unrelated payments.


How relative can be "Blockchain" and "Social Network Applications"? We hear too much of using Blockchain for "Social Network Applications" (such as Facebook or tweeter) !

I really do NOT understand how blockchain  can be useful for Facebook or tweeter ?! Where, data in social networks applications are not (and must not be) immutable and transparent to everyone.

Assuming someone in one of the social networks applications writes a new comment, this comment will then be verified in a central server of that company and if everything would be right, the comment will appear in the App. This user may then decide to delete this comment. Under some conditions, it will be disappeared from the App.

From my point of view, implementing such scenario based on an open and permission-less Blockchain is not feasible at all. And if Blockchin is private and permissioned, then chaining blocks (Blockchain) do NOT make sense, where the entire chain can be replaced by another one by that company.

Am I wrong?

Can anyone explain one of the use cases of Blockchain for Social Networks?

I think you have pretty much answered the question yourself. The only use case I can think about for implementing social network on a blockchain is if you are hosting content that is illegal (connecting the likes of drug dealers, child porn makers etc.). In that case you can be assured that since there is no single point of failure, the law enforcement agencies cannot shut you down. Consider Silk Road Dapp on Ethereum. For all other use cases, it is redundant.

The current hype of putting everything on the blockchain is a gross neglect for the basic engineering design principles. Blockchain has a very specific use case: Ensuring transactions are valid and no double spend occurs. It should not be used to store your house land record, your marriage certificate or how many times you shower in a day. As you store more and more redundant data on the blockchain, it would get so bloated that a normal user would refrain from running a full node. What's the point of calling your blockchain as a decentralized system then?

As far as my interactions go with normal people, they do not mind seeing advertisements next to their social media feed. Some just block it off with ad-blockers, other love the recommended shopping lists it shows them. The mere concept of paying $0.1/tweet is absurd and pointless. You can build pretty elegant software solving the real life problems that are currently being faced by people. Putting everything on blockchain is definitely not what is going to solve them.


Why does Bitcoin no longer have checkpoints? I've read that checkpoints in Bitcoin were removed because they were not preventing any meaningful attack.

Why should a regular checkpoint not prevent majority attacks? For instance, if a checkpoint is made every N blocks and (for example) 3/4 of the hash power agrees, would this not be possible to be used as a mechanism to create a permanent confirmation of the transactions before the checkpoint? Assuming, of course, that clients would check for those checkpoints and enforce them to be included in the valid chain.

The issue is that you assume a majority attack is an attack that can be prevented. It is not. It is a fundamental breakdown of the security assumptions.

Proof of work (PoW)'s assumption is that the majority of the hashrate will cooperate and converge on a single chain, because it is most financially advantageous thing to do. When that is no longer the case, PoW is broken and we should just move to something else - not to try to fix it up.

You might think that adding checkpoints helps to improve this situation, but consider this:

Either the checkpoints are created for old blocks (weeks or months old), in which case there is clearly nothing being prevented. A week-deep reorganization would utterly destroy the currency and the trust in it, and not be prevented by this.
Or the checkpoints are created for recent blocks (days or hours perhaps), in which case they may indeed affect what chain is accepted on the network during certain circumstances, but at the same time it is effectively replacing PoW based consensus with "developers-decide" consensus... something that doesn't need a complex peer to peer protocol at all, as effectively developers need to run systems to keep the system in check.

So, either checkpoints have an effect - and change the security assumptions into an uninteresting one, or they don't - and they don't matter.

To answer your question: the primary reason for removing checkpoints is due to the confusion they create. They make people think they're part of the system's security model (like your question shows). It does not. It was introduced as a necessity for implementing an optimization (skipping script validation) and an unrelated denial-of-service attack (the disk of a new node being filled with low-difficulty blocks during synchronization). Since some changes in the P2P protocol (headers based synchronization) we no longer need checkpoints to do these things safely.


Should p2pool submit all shares? I setup p2pool for Dogecoin. It seems to work fine, only it submits every single share to the Dogecoin client. The client naturally rejects blocks with insufficient PoW.

Is this how it should work? Is there a parameter that would cause p2pool to submit only valid blocks that meet the required difficulty?

When p2pool is started with --debug, it submits all shares to the node (dogecoind, bitcoind etc.).


Why aren't block solutions sent to a multicast address? In computer networking, multicast (one-to-many or many-to-many distribution) is group communication where information is addressed to a group of destination computers simultaneously.

I think the Satoshi client uses Universal Plug-n-Play (upnp) to find other Bitcoin nodes.  I came to this conclusion after a cursory glance through the code at occurrences of "multicast," IIRC.  I was looking because I thought that multicast would be a great way to broadcast block solutions.

Multicast just doesn't work very well over the Internet. Relaying just works better. One big problem is that multicast provides no way to police emitters of junk while relaying allows each relayer to verify information prior to relaying it, preventing an attacker from getting amplification.


Can you always derive a public Bitcoin address from a message and a random signature? Let's say my Bitcoin address is 1Nu5mzpUD9A7daZ76QJEsBfkBjCWVLh7pJ and I sign the message random-challenge with its private key.

The result is :

IAjU1mpvy70Li2Q1jDaNJKaQudaAJia1oF9SYJ8HGGuNffT9ERmc77WgPMONPLHKAhO8d0bhDF5Nvn+AUzS6R04=

Bitcoin uses a unique property of ECDSQ which allow to calculate the public key from the message and signature. So if I send to the recipient the above message and signatures he/she will be able to get my address 1Nu5mzpUD9A7daZ76QJEsBfkBjCWVLh7pJ

Now, if I send the same signature and a completely different message, will it derive all the time a valid random Bitcoin address ? And if yes, doesn't this have some serious security implication allowing people to prove they control an address without having the private key ?

Now, if I send the same signature and a completely different message, will it derive all the time a valid random Bitcoin address ?

Yes.

  And if yes, doesn't this have some serious security implication allowing people to prove they control an address without having the private key ?

No. In order to prove you control an address, you must do much more than just produce a signature generated by that address. Otherwise, if you were in possession of anyone else's proof, you could claim it as your own.

The validation process consists of three steps:

1) Ensure the signature correctly signs the message.

2) Ensure the public key used for the signatures matches the Bitcoin address you are expecting proof of.

3) Make sure the signed payload actually proves the person you think controls the address.

Your mutilation would break step 1. Since you're changing the message, the signature no longer signs the message.

The verifymessage command does steps 1 and 2. Step 3 must be done by higher-level code depending on the context.


What does message "Server is lagging (9 blocks)" mean in Electrum? When opening Electrum, the bottom of the window showed message "Server is lagging (9 blocks)".

What does this mean? Is the Electrum server not up to date with the blockchain? Can I expect the problem to resolve itself quickly?

The message informs you that the Electrum server your wallet client is connected to is not in sync (not up-to-date) with the blockchain. In the message you quote it is 9 blocks behind.

This can happen when a server has been rebooted after maintenance or, in some cases, if the server is malfunctioning. Hence, there is no guarantee that the problem will resolve quickly.

While the server is lagging the blockchain, it is unable to provide your connected wallet with an accurate transaction history.

By default, Electrum connects to a random Electrum server on the network. To connect to another server simply exit and restart your wallet, or you can go to Tools > Network and manually specify a preferred server.


Can you mine smaller cryptocurrencies - e.g. coins found in an ICO etc? E.g. any of the coins found here:

https://coinmarketcap.com/

"Can you mine smaller cryptocurrencies?"

if they are mineable: obvious yes. (otherwise they can not be used to execute transactions so they would not have any benefit.)
but there are also some not mineable cryptocurrencies, for example ripple or cryptocurrencies which have 100% proof of stake.

"... e.g. coins found in an ICO etc?"

nearly all ICOs use tokens. a token is not a mineable coin. a token exist due to a smartcontract of another cryptocurrency. so the creator of the smartcontract can decide who gets how many tokens.


use old offline phone as a hardware wallet? here's what i want to do:

store my private key on an offline phone.
use that offline phone to generate a signed transaction and generate a QR code for me to scan/broadcast with my online phone.

does this exist?!? i cannot find an app to do it

seems like the most secure/convenient way to use bitcoins.

electrum android app can do this! check it out, it's perfect!
also seems like a nice wallet with a lot of features.

your watch-only online electrum can create an unsigned transaction with QR code.
your offline electron can scan then sign it & generate a QR code for you to broadcast with online electrum!


Values for txid and vout for create a coinbase transaction I want create a coinbase transaction to go with a new block minned by my program. I am creating it with the json-rpc command createrawtransaction. What's the values for txid and vout in this case?

The coinbase transaction contains a single input, which has  txid set to 0000000000000000000000000000000000000000000000000000000000000000 and vout set to 0xFFFFFFFF.


What's relationship to each address other in Bitcoin Core? I just made two and more address in Bitcoin Core wallet.

Is there any relationship to each address? Like based on seedphase? or Just literally making 'random' address?
If so, an attacker can hack the other address if knows one of private key?

Thank you for your answer.

Is there any relationship to each address? Like based on seedphase? or Just literally making 'random' address?

It depends.

In old versions of Bitcoin Core, addresses were just randomly generated and the private keys stored in wallet.dat.

Newer wallets that implement BIP32 derive all of the wallet private keys from one master private key.

  If so, an attacker can hack the other address if knows one of private key?

If an attacker knows your 12 seed words, they can derive the private keys in your wallet and steal all of your coins, but this is no worse than an attacker having your wallet.dat.


How to run a python script when occur incoming transaction in Bitcoin core 0.18? I want to run a python script when occur an incoming transaction. I think set zapwallettxes flag in bitcoin.conf but I don't know where set the script path to execute.

Is it possible to execute another executable file or another language script?

You're looking for walletnotify setting in bitcoin.conf

It will call the specified script for every transaction received for your own wallets.

walletnotify=/some/path/mywalletscript.py

Here mywalletscript.py will handle the JSON data passed into it.

Here is a sample walletnotify implementation including database access. It's a bit dated but should give you an idea on how to handle events.

As per this Bitcointalk thread you can also hook up handlers for blocknotify and alertnotify so you can create your own payment system by receiving alerts, checking block confirmations and so on.

Just wire up a walletnotify handler via bitcoin.conf as answered here and here.


How do I buy Bitcoins safely face-to-face? I've made a contact via LocalBitcoins.com and am going to buy some coins with cash. The seller is not verified, but as we will meet, it sounds ok:

I show him the cash.
He transfers the Bitcoins.
We wait one block.
I give him the cash.

Is this safe enough or is there anything I should take care of? Any scams known?

He requested to use my mobile internet, though (will enable Wi-Fi hotspot on the smartphone).

Shamelessly summarized from this extensive guide on local transactions:

You want to meet in a sufficiently public location, such as a pub or mall, preferably one that has an open wifi.
If you have agreed on terms in beforehand, print out what you agreed upon and take it with you.
If you have not agreed on terms yet, be sure to check the current price of bitcoin during the meeting.
Wait for the transaction to complete and check if the right amount was paid. If the other person is willing to wait around for one additional block together that is a good sign.
Specify your expectations in advance: When and where to meet, what each person will have on hand to make the deal, how the price for the bitcoins will be calculated.
Consider taking a second person along for additional safety.


How to withdraw all funds from a Ripple account? I'm trying to close my account by withdrawing all my XRP into a new account. But the Ripple client insists on keeping a minimum balance of 50 XRP. How can I properly close this account?

You can't withdraw the deposit, just leave it as it is.

Remove all trust and all offers to lower the minimum deposit.


How blocks are created and broadcast? Followings are some of my understandings about how bitcoin blockchain works, and want to confirm. Appreciate your comments and thoughts.

In the blockchain, every peer receives both transactions and blocks. A peer will store the transactions they received into a local buffer, keep them ordered, and organize them into blocks. Then, if this peer successfully solves the mathematical puzzle, it will broadcast the block it has. Otherwise, if this peer receives a block, it will update the existing transactions in its buffer according to the transactions in that newly received block. Please correct me if I am wrong.

If the above process is correct, does a peer broadcast only 1 block each time when it solves the mathematical puzzle, or it can broadcast multiple blocks? If a peer can only broadcast 1 block, what if the peer has created multiple blocks since last time it has received or broadcast any block?

It would first have to broadcast the first block. The way it works, the hash of the first block (including the nonce that is needed to solve the puzzle) would included in the second block. So the miner can't create the next block without first solving the puzzle for the first block because that's the only way to get that nonce.

So you can't work on two blocks and broadcast them simultaneously. The blockchain defeats that (that nonce which you can't tell till you have actually solved the block). You can work on two blocks to find the next block faster (although I doubt it's really reasonable since you have two split your hashing power between the workloads).

Now it's possible to broadcast the first block and find the next one  or two in quick succession. This happens. Finding the hash is brute force. It's a game of probability, which is basically just a fancy word for chance.


Wallet.dat Bitcoin core Privatekey Recovery Is there any method from which we can manually calculate wallet privatekey from a protected bitcoin core wallet.dat file ?
I was searching on it and find this , I think it is related to my topic https://bitcointalk.org/index.php?topic=4413938.0

Is there any method from which we can manually calculate wallet privatekey ...

You can't calculate the private-key.
You can extract the key if the wallet is unprotected or if the wallet is protected and you know the wallet passphrase (also known as the wallet "password").
You can do this using  walletpassphrase and dumpprivkey in either Bitcoin-core's debug console or using its API.
You can also do this using the equivalent methods in other tools such as pywallet.

... from a protected bitcoin core wallet.dat file?

Only if you know the passphrase for the protected wallet. Bitcoin core uses the password to encrypt the private key.
If you don't know the passphrase, you can't extract the private key.

Related:

How can I export the private key for an address from the satoshi client?
How do I export my private keys from my Bitcoin-Qt client?
How can I export all my private keys using bitcoind?


Sweep all functionality for a Bitcoin Lightning private key using mobile, desktop, or cli wallet? Bitcoin wallets have a sweep all function to transfer all coins from one private key to another. Is there such a feature in a bitcoin lightning wallet where you can sweep all coins from a lightning private key to another lightning address?

There are currently no specifications for interoperable text/file formats between lightning network node implementations. The lightning BOLT specifications deal with standardization of the network protocols so that different lightning implementations can talk to one another, but all other details which are not part of this protocol are left up to the individual client implementers to choose.

It will probably be useful to have a standardized import/export format for lightning node information and channels in future, so that you can migrate your node information to an alternative implementation. I'm not aware of anybody working on such formats to date.

Channels in the Lightning Network are tightly coupled to a specific node with a specific public key. It is not really possible to migrate channels to a node with a different public key, and attempting to do so will likely get both nodes blacklisted, as the specification indicates that blacklisting should occur if any duplicate channel is broadcast with a node id which does not match the one previously known.


Is bitcoin egalitarian or is there a hierarchy of owners of the cryptocurrency? I hope my question will be well understood and well received. I see bitcoin as a passive system, as far as I know, and therefore egalitarian, but maybe there is a situation where at the point someone puts in a bid for it, the whales get the cheapest bid and at that point it creates hierarchy and inequality, I don't know, so this is why I asked the question.
As a general rule, nobody is going to treat you different as an individual owner of bitcoin whether you buy or sell it, but I don't really know. I don't know how the exchange is programmed, I don't know if it has a high frequency trading that is biased.
Does Satoshi and the original buyers of bitcoin have more power over other bitcoin owners?

The exchange of Bitcoin is carried out under the laws of a free market (supply and demand). The  mechanics of the blockchain and Bitcoin do not intervine in the buy/sell of the cryptocurrency. The only aspect that the code of Bitcoin affects the cryptocurrency in the economic field is by its programmed scarcity which makes the currency a deflationary one, and therefore creates an upward pressure for the price (makes the price go higher).
Exchanges simply serve as a means through which people can buy or sell Bitcoins for other currencies (fiat or cryptos) and it is performed outside the blockchain. Only the transfer of the funds takes place in the blockchain.


New Venezuelan crypt worth it? Venezuela is about to launch its own Petro cryptocurrency

Could the chaotic economic scenario the country have lived be a good chance to  change the usual  currency to a criptocurrency?

I mean, What can significantly mean success or failure in this case?

From my point of view, any chaos in the monetary system may be an opportunity for an alternative system.

Taking control out of the banks would be the first step towards an attempt to improve the economy, but we must be very careful about the government control.

The current scenario in Venezuela is all fault of the Government and not totally of the banks, if the government itself wants to launch a monetary system without the interventions of the banks what would be the logic of this?


What does a Bitcoin transaction consist of? I gather that 2400 transactions fit into a 1 MB block.
That's 436 bytes per transaction record.
But what's in a transaction record?

Is there a good Powerpoint presentation that describes how Bitcoin transactions work?

Thanks.

Here's an interactive diagram showing the indivdual steps through the diagram:

http://staging.spectrum.ieee.org/static/how-a-bitcoin-transaction-works

A typical transaction (simplified) looks like:

Spend:
   20 BTC from a transaction using address:ABC123

To:
   10 BTC to address XYZ111
   10 BTC to address JKL222

Here XYZ111 is where you want to send your BTC to and JKL222 is your address for the change.

With transations like this you do not know (reliably) where your BTC are coming from. The next transaction will probably spend from JKL222 as ABC123 is all spent.

This in intentional in the Satoshi client so that it jumbles up the change and the sendee's addresses.


Preventing sybil attacks : How does bitcoin get to know the computing power of a node? I know that bitcoin prevents sybil attacks through proof of work - which takes into account the computing power of each participating node . So how does bitcoin get this information ?

Most nodes these days do not mine at all, nor do they care who exactly is contributing hashpower to the network.

Proof of work does not prevent a sybil attack from occurring, rather the required work to create a block makes it costly for a successful sybil attacker to feed the victim a tailored chain-tip. Unless uses immense hashpower, they can at best hand the victim a doublespend transaction while withholding the new blocks and transactions relayed on the rest of the network. Simply waiting for one or more confirmations corresponding to the value of the transaction largely mitigates the dangers of a sybil attack.

On the other hand, sybil attacks itself are difficult because Bitcoin nodes initiate eight outbound connections to random peers in the network preferring nodes in different IP ranges. Whereas an attacker could perhaps gain control of a lot of inbound connections after identifying the victim's IP address, replacing the outbound connections would be a lot more difficult. Yet, as long as the node connects to just a single honest peer, a doublespend attack as mentioned above would be foiled.


Is it safe to connect multiple alternative crypto currency clients to the same TOR socks port? Or should I create multiple TOR socks ports and use one for each client?

I plan on running bitcoind, namecoind, litecoind, etc... all on the same ubuntu machine running under different users but all going though the same TOR connection.

I don't think there any good reasons to use multiple SOCKS listener ports on the same tor in your situation.  After all, it all ends up in the same place.


Unconfirmed after 48 hours and counting still ... Someone please help me https://blockchain.info/tx/ad9f5be7f893c8a2e6d977dce0367dcdaae20074c7eaa1f3ff288baf8f3a0059

I am new to this i have seen someone else accelerate anothers transaction can someone please help me with this i am new i didnt know about fees i left everything the way it was

The transaction has been broadcast and nodes have viewed it, so as for the moment; you'll simply have to wait.

If there are a number of blocks found quickly; which happens... there will be less transactions transmittted due to the short time interval / blocks found, and the node that mined the block will accept and confirm funds sent with low TX fees.

But the reason it's stuck is your fee is too low.

If it's not confirmed after another day or two, it will likely be rejected back and ignored, thus returned to the original address.

The BTC isn't lost, it's just the block size is only so big, and there are so many transactions taking place, that if you do not "bid" a high enough fee you don't make the cut list.

The nodes are all programmed now to accept transactions based on "highest fee first, downward, until max block size is reached.

There is no work around.


How do I calculate transaction fee for call to createpsbt()? When my user invokes my app, he passes as an input parameter the desired value of the TX fee in satoshis per byte.  I create a PSBT by calling createpsbt().  I exert complete control over the determination of inputs and outputs.  For example, I don't call walletcreatefundedpsbt(), because I don't want bitcoind to select inputs on my behalf.  I have a chicken and egg problem in that I need to call createpsbt() in order to determine the size of the TX in bytes, but I need to specify the fee amount before the call to createpsbt().  The best solution that I can think of is to execute a dummy call to createpsbt() using a dummy fee value, then measure the size of the TX, then do a real call to createpsbt() after correctly calculating the fee amount.  Is there a better way?

Edit: I want to spend all UTXOs.  I want two outputs, one to receive a fixed amount, the other to receive change less the fee.  I have tried many incantations, I can't get it to work.  Here's my latest attempt:

raw_psbt = rpc.walletcreatefundedpsbt(
    # all UTXOs, as returned by listunspent():
    inputs,
    # one recipient: [ { addr : amount } ]
    outputs,
    0,  # locktime
    {
        "replaceable" : True,
        # I would like for the change less the fee to go here:
        "changeAddress" : xxx,
        "includeWatching" : True,
        "feeRate" : 0.005,
    }
)

This fails with Signing transaction failed (-4).  Any idea what I'm doing wrong?

Edit #2: I can't use walletcreatefundedpsbt() as suggested below to create the PSBT, because that function requires that its inputs be "solvable", which is not the case in my environment.  More info at this link:

Errors with walletcreatefundedpsbt & non-solvable UTXOs

So my original question remains unresolved at this point.

Edit #3: So I asked on Slack.  The problem is that our UTXOs are 1) not "solvable" and 2) cannot be expressed in the descriptor language, so Bitcoin Core has no way to calculate the TX size before the TX is signed.  Apparently I would have to calculated it manually as explained in the attached screenshot.

If you want to implement your coin selection, the only alternative to calculating the fee manually I can think of is the following:

You select which inputs you want to be used in your transaction based on your coin selection algorithm.
You then proceed to lock every input that is not the one you selected. You can get the list of all inputs through listunspent and you can lock an input with lockunspent false [{"txid":"hex", "vout":n}, ...].
Now you can use your walletcreatefundedpsbt without being afraid it will select any input that you don't want and you can pass the option {"feerate":your_feerate}.
After getting your raw transaction, you can unlock all previously locked inputs with lockunspent true


How does bitaddress.org ensure unique address? You can use this service offline (as it's done with JS) so how can they possibly ensure a unique address is generated?

I don't know what bitaddress.org does exactly, but just take some numbers into consideration:

There are 2^160 possible Bitcoin addresses. If you generate an address from a key pair generated with a good randomness source, it is fairly impossible to find a collision.

In conclusion, they can ensure uniqueness just by the negligible odds of picking an address more than once.


Why can't you just tell the blockchain that your bitcoin was stolen so that nobody can use it? They evangelize about The Blockchain. It cannot be changed or tampered with. It's TRUST without needing to actually trust any person. So, tell me. Why is it that when I watch Youtubes of how to set up a Bitcoin Wallet, I get dire warnings of: "You have to do it THIS way and take THESE precautions OR ELSE your Bitcoin might get STOLEN!" I mean, if the Blockchain is so pristine, why not just TELL IT that your bitcoin got stolen... and, therefore, no one can use it?

The short answer, is because "the blockchain" has no idea whether your bitcoin got stolen, or whether you actually intended to spend it. The blockchain sees a legitimate spend and a theft as the same thing: A transfer from one account to another.

What the setup instructions are trying to protect you from is losing the private key to your wallet. If somebody learns your wallet private key, then they can spend your money. The catch is, you don't know whether somebody else has a copy of your private key until your bitcoins are gone.


Does the Bitcoin client generate bitcoins automatically? I mean, you just need to install the software, and with the time, you will get lots of bitcoins?

Not really, there are a few issues you have to know about:

In order to generate Bitcoins, you have to be explicitly mining them. The standard client does not mine coins, it stores the keys you use to access them. You need to run a so called miner (like the GUIMiner) and you probably want to join a mining pool (like, Slush's Pool).
Even if you are mining Bitcoins, you probably won't make too many coins unless you have some good hardware. You should check out what hashing speed your hardware has and then punch the hash speed in a dedicated calculator.
If you want to mine coins by yourself (without pool), the chances of getting coins are pretty small, again, check the calculator and look for "Time to generate one block".

So in short, you need specialised software and hardware to mine coins, but it's not hard to get started.


Can transaction be stuck in the 'processing' stage and has not been mined by the Blockchain network? Can transaction be stuck in the 'processing' stage and has not been mined by the Blockchain network and due to this, it cannot reflect in wallet ?

My friend send me a bit coin but it did not reach me, Can it get stuck in the

Yes, if the fee is not enough then it can take days and then it will be canceled.


How can I find out the current exchange rate of Bitcoin/USD? What is the value of 1 bitcoin in USD, today? Where can the exchange rate be looked up?

Very simple. Go to google and type: BTC to USD

A nice box with the current exchange rate should appear on your browser.


How long does it take to earn back the investment of a miner? I was strongly considering buying one of the 25 GHash/s miners and hooking it up to my laptop or desktop when not using them, as in, leave the miner running overnight or while I'm at work.

The mining profitability calculators confuse me. If I join a pool and mine the way described above, would it be profitable?

How long would it take to earn that c. $800 back?

You can run the miner all the time, not just overnight or while you're at work.  It doesn't use hardly any resources on the laptop... all the heavy lifting is done on the miner.

It's very risky to buy a miner.  The miner manufacturers often take a long time (i.e. several months) to deliver your order.  While you are waiting the mining difficulty is going up and the manufacturers move on to new more powerful models.  As a result, by the time you get your hardware it could be well on its way to becoming obsolete.  Keep in mind that a mining rig is not useful for any other purpose.

It is a very real possibility that you will never make back your investment unless the bitcoin price goes up a lot.  And if you want to bet on the bitcoin price going up, you can simply buy bitcoin and save yourself the whole mining hassle.


Looking for nonces of even numbers Each one of bitcoin and its derived crypto-currencies has a nonce value in the block, no matter what the algorithm is. Every miner tries to search for a luck nonce which can make the hash value smaller than the target under the required difficulty.

However, recently I search scrypt based cryptocurrencies, like the dogecoin and vertcoin block chain for few blocks. I found most of the nonce are even numbers, except for (only manually browsed in block explorer)

Block #184161 - nonce = 8dce5c01

Block #184143 - nonce = 2a674001

Block #184139 - nonce = 930aa899

many other blocks from the latest block (Block #184174) and blocks in between of them are even numbers. Moreover, many nonce value are in hex number of form XXXXXX00 (in an integer hex number form, it is stored as 00XXXXXX in block), or multiples of 256.

The same outcome I observed in Vertcoin blocks. I manually traversed for few blocks and also found nonces of them are also even numbers.

I'd like to ask a question. If I configure the scrypt or n-scrypt to search only even numbers, is it possible to have higher chance to find the nonce which can solve the current quickly?

BTW, I won't expect the mining revenue of each miner in the pool (PPS or PPLNS) is going to be greater than that of normal nonce searching algorithm because the pool count for "shares" you found. When you skip odd numbers, you also lose the chance to get a share (solved by the odd nonce) which can meet the diff the pool gives to you. However, when a pool found a nonce that can solve the block, then the pool wins and gets the rewards.

Edited: Apr 18

I wrote a small program to collect some statistical data. From recent Dogecoin block #186,299 to #145,000 (the last mandatory update)

total 41,300 blocks

number of odds = 3,891  (9.42%)
number of evens = 37,409 (90.58%)

ratio of odd to even is about 1:10

Among the evens, the number of multiples of 256 = 35,106

85% of total
93.866% of evens

Update: 4/20

I recently also checked the nonces from block 552,780 to 253,898 of Litecoin.

totally 298,883 blocks.

number of odds = 42,963 (14.374521%)
number of evens = 255,920 (85.625479%)
Among the evens, the number of multiples of 256 = 225,746

75.529890% of total

Update: 4/21

I use a small Perl script and call litecoind/dogecoind wallet to print out each block's nonce. It is very slow but quite simple. It would be very fast when you are using binary block database parser.

#!/usr/bin/perl -w

my $odd = 0;
my $even = 0;
my $m256 = 0;
my $total = 0;
for ($i = 186299; $i >= 145000; $i = $i-1) {
    $nonce = `dogecoind getblock \`dogecoind getblockhash $i\` | grep nonce`;
    chomp $nonce;
    $nonce =~ s/[^0-9]*//g;
    printf "%d %d\n", $i, $nonce;

    if (($nonce %2)== 1) {
            $odd++;
    }
    else {
            $even = $even + 1;
            $m256++ if (($nonce % 256) == 0);
    }
    $total ++;
}
printf "odds=%d (%f%%) evens=%d (%f%%) 256s=%d (%f%%)\n",
     $odd, (100.0*$odd/$total),
     $even, (100.0*$even/$total),
     $m256, 100.0*$m256/$total;

I think that Tim S. may have the answer with his comment about endian-ness.

Your observations about the nonce having its lowest byte zero (being a multiple of 256), are with respect to the little-endian byte order of the block itself.  From the perspective of a big-endian machine, these are statements about the high byte of the nonce.

So consider a miner which is big-endian.  The natural algorithm is "start with nonce=0, compute scrypt, increment nonce, repeat", so your "even" nonces will be tried first.  However, when a new transaction (or a new block from another miner) arrives, a new block header has to be constructed, and it would be natural to restart the nonce at zero when this happens.  In order to get a nonce that is "not a multiple of 256", it has to complete 2^24 hashes before being restarted.

Of course, x86 is the most common desktop CPU, and it is little-endian, but most scrypt mining is done on GPUs.  I hypothesize that a majority of these GPUs are big-endian, or at least that some common mining software causes them to increment their nonce in a big-endian manner.  Does anyone know if this is the case?

From this chart, it looks like modern GPUs can run scrypt at roughly 1 Mhash/sec.  So 2^24 hashes would take 16 seconds.  Litecoin is currently averaging roughly 10K transactions per day, which is an average of one every 8 seconds or so.  So it would not be surprising that a miner would  usually not get into their high byte (which for you is the low byte) before restarting.

This hypothesis would also explain why we do not see such a pattern with Bitcoin.  Current SHA-256 ASIC miners run at many Ghash/sec, and so are very likely to go through all 2^32 possible nonces before being restarted by new transaction data.  (We might see patterns in the extraNonce, though.)


What is the average number of transactions that a BTC wallet contains? If a BTC wallet has 8 addresses, and each address has 10 transactions, then that sums to 80 transactions.

Is this around the average per wallet?

There is no answer for your question because you can not know which adresses are connected to which wallet.

By the way: You don't even need a wallet to send or receive transactions.


Is the Electrum seed compatible with other wallets? Apologies if this is a simple question - a newbie here!
I'm trying to understand backups. If I use Electrum to make a back up (including the 12 word seed password), will I then need to use Electrum to restore my BTC/ or can I use a different piece of software (like Exodus?).

What I mean is: are backups/restoring wallets dependent on the software you made the original back up on? or can you restore using any software as long as you have the 12 word seed?

I'm wondering about cold storage of wallets.

THANKS!

There are different "backup-standards".

Some use BIP39 (mnemonic) which lacks a flexible wordlist and versioning. It's used by Ledger, Trezor, Bitpay/Copay, etc.

Electrum uses a different – more flexible – mnemonic backup concept which is incompatible with BIP39.

There is also the BIP32 keypath which can be different among wallets. Example: you can restore a Trezor BIP39 mnemonic in iOS BreadWallet, but due to missing support of BIP44 in BreadWallet, the funds cannot be recovered there.

If you switch away from a wallet, consider sending all your funds to the new wallet (although this has some privacy implications, it's generally good for security due to the re-keying).

But as long as you keep your backup (seed / mnemonic), there will always be a (theoretical) option to recover your funds. If the wallet didn't stick to a standard and died (no maintenance, etc.), then you may need to contact an expert for a manual recovery.

If you use a mnemonic, make sure you use at least 24 words.


Pay private bolt11 via sendpay I need to get fee, before send payment.
BOLT11:
root@855e20daeae9:/# lightning-cli --testnet decodepay lntb1u1p07t3tdpp5ax3hk4jzf08sn8a8dupayswf6ja497mj25lmcdqn7m0ce22ch0qqdq8vankwecxqrrss9qy9qsqsp5f5s9kqwnp7uh3pg93wr970420xy7vueelqhratwlrt9jzvn2lv7srzjqwfn3p9278ttzzpe0e00uhyxhned3j5d9acqak5emwfpflp8z2cng8xmauqqq0gqqqqqqqlgqqqqqeqqjqatpu8h3tcatdvvxl0t93zkltwlpzaqlu75sgrh3vv92utfqaq6gpgmyaks48v5tptmc30yaach48pr3l3dfnhm5ytr5my8z87xjmnpcqmjh036
{
   "currency": "tb",
   "created_at": 1608893805,
   "expiry": 3600,
   "payee": "03aba9dfe8612755f6edc363b90e3f1f4a684517cd0558452fb9620ffaebab683e",
   "msatoshi": 100000,
   "amount_msat": "100000msat",
   "description": "gggg",
   "min_final_cltv_expiry": 18,
   "payment_secret": "4d205b01d30fb97885058b865f3eaa7989e67339f82e3eaddf1acb21326afb3d",
   "features": "028200",
   "routes": [
      [
         {
            "pubkey": "03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134",
            "short_channel_id": "1891311x61x0",
            "fee_base_msat": 1000,
            "fee_proportional_millionths": 100,
            "cltv_expiry_delta": 144
         }
      ]
   ],
   "payment_hash": "e9a37b56424bcf099fa76f03d241c9d4bb52fb72553fbc3413f6df8ca958bbc0",
   "signature": "3045022100eac3c3de2bc756d630df7acb115beb77c22e83fcf52081de2c6155c5a41d06900220146c9db42a7651615ef11793bdc5ea708e3f8b533bee8458e9b21c47f1a5b987"
}

Then i need to get route:
getroute id msatoshi riskfactor [cltv] [fromid] [fuzzpercent] [exclude] [maxhops]

Final node ID:
root@855e20daeae9:/# lightning-cli --testnet getroute 030f1784fafe1b5b143e4e4545e6c2f612943c60e6a5b770b35e324c60b6ae9516 10000000 10
{
   "route": [
      {
         "id": "03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134",
         "channel": "1900118x8x0",
         "direction": 1,
         "msatoshi": 10002000,
         "amount_msat": "10002000msat",
         "delay": 178,
         "style": "tlv"
      },
      {
         "id": "03d5e17a3c213fe490e1b0c389f8cfcfcea08a29717d50a9f453735e0ab2a7c003",
         "channel": "1834823x53x0",
         "direction": 0,
         "msatoshi": 10000000,
         "amount_msat": "10000000msat",
         "delay": 34,
         "style": "tlv"
      },
      {
         "id": "030f1784fafe1b5b143e4e4545e6c2f612943c60e6a5b770b35e324c60b6ae9516",
         "channel": "1722566x108x0",
         "direction": 1,
         "msatoshi": 10000000,
         "amount_msat": "10000000msat",
         "delay": 9,
         "style": "tlv"
      }
   ]
}

which id should i use to get the route fot private BOLT11?
how to pay private BOLT11 in manual mode?

There is the routes field in the invoice as a routing hint
   "routes": [
      [
         {
            "pubkey": "03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134",
            "short_channel_id": "1891311x61x0",
            "fee_base_msat": 1000,
            "fee_proportional_millionths": 100,
            "cltv_expiry_delta": 144
         }
      ]

This tells you the node ID which getroute can find:
03933884aaf1d6b108397e5efe5c86bcf2d8ca8d2f700eda99db9214fc2712b134
There are plugins that allow you to create custom routes along a given path. So I suggest to call getroute to the node from the routing hint extend that route with the private hope and use the following plugin to create a custom onion:
https://github.com/lightningd/plugins/pull/85


Can my exchange recover BCH sent to a BTC address that existed pre-fork? I have a wallet on Luno and another on Poloniex. Both pre-exist the Bitcoin (BTC) to Bitcoin Cash (BCH) fork. After the fork, Poloniex created another wallet for me containing the same number of BCH as I had BTC at the time of the fork. All good so far.
Now I wished to transfer the BTC from Poloniex back to Luno, but I mistakenly sent from my BCH Poloniex wallet instead of my BTC wallet.
Both Poloniex and Luno claim that the BCH that I sent to the BTC wallet on Luno is "lost".
However, from my (very limited) understanding of the blockchain and the fork, would the BTC address on Luno not have been duplicated to the BCH blockchain at the time of the fork, and therefore be a valid BCH address? If so, how would I go about claiming that address - or can Luno do this since they still control that same address on the BTC blockchain and have the private keys, and would/might/(should??) be able to lay claim to the coin in the BCH blockchain?

In principle, Luno can claim these coins, but you cannot.

There is no distinction between BTC and BCH addresses.  They each use addresses generated from private keys in exactly the same way.  Money sent to an address, on either chain, can be spent by whoever holds the corresponding private key, and by nobody else.

So Luno created an address (call it 123abc) which means that they hold the corresponding private key (call it 567fgh).  It's immaterial whether they created the address with the intention of using it for BTC or BCH (or both), or whether they created it before or after the fork, or whether it has been used before or after the fork (on either chain).

You sent BCH coins to 123abc (i.e. with a BCH transaction on the BCH chain), and so Luno is capable of using their private key to spend those BCH coins (again on the BCH chain), if they want to.  Of course, they can also choose not to spend them, if they prefer not to, or find it too much trouble to adapt their software to do it.  And even if they do choose to use them, you have no way (other than legal action or something similar) to force them to send those coins back to you, or to give you any sort of credit in exchange.

Unless of course they deleted the private key.  If so, then the coins would indeed be lost, but the same would be true of any BTC coins sent to that address.


Where do I find my bitcoins after buying from an ATM? I don't know where to find my bitcoins. I have a receipt from the ATM:  and the transaction is confirmed:

When you purchase bitcoins at an ATM, you have to provide a destination where they'll deliver the bitcoins. Recipient information is provided in form of addresses. The receipt shows an address to which the ATM delivered the bitcoins. As pointed out by other answers, the bitcoins were actually sent to that address.

The question is now, how did you provide the destination address for the purchase? Did you perhaps show a QR code from a wallet on your phone, or had a printed QR code that you got scanned by the ATM? The bitcoins would have been received to the corresponding wallet, e.g. on your phone if it was a mobile phone wallet.


Input/Output size for various transaction types What are input/output sizes for various transaction types?

I see some numbers like 210 byte for input for p2sh-p2wpkh here (How do virtual size, stripped size and raw size compare between legacy address formats and native segwit?), but curious to know more detailed breakdown of input/output for each transaction types.

This website (https://www.buybitcoinworldwide.com/fee-calculator/) shows the approx size of transactions according to the address type, number of inputs and number of outputs and the final fee (after you set how much sat/byte you want to pay)

As you play with it you will see that the most important if you are worried about fees is to reduce the number of inputs. The best practice is to consolidate your small inputs in native segwit addresses (bc1...) when fees are low.

This way when you need to transfer bitcoins when the network is congested you will have a smaller transaction size, paying less fees.

Be careful with your privacy while doing so.


How do I fund BTC-e and transfer money there instantly from other exchanges? A few services claim they support sending money to BTC-e, but I haven't actually found the option to do it.

Does anyone know of an instant way to send money to BTC-e or transfer money to BTC-e from another exchange like Mt. Gox?

Currently there is no such option, hence the difference in price you see. Bitinstant used to offer the service I believe, but now it's only offered as a withdrawal option.


Orders and "fills" are confusing! Back around the small panic during mid April, I tried to sell a large qty of XBT to USD quickly on an exchange. I expected that I would get current USD/XBT quoted on that website times # of XBT in my account. I was very wrong.

Instead, the exchange broke my transaction into several smaller transactions of various sizes, sold some quickly while others took as long as 30 minutes to convert to USD, and none of these sub transactions were converted at the price quoted on the site.

As I understand, that's because every exchange has Buyers and Sellers whose Orders are like virtual post-it notes on a bulletin board announcing their desire to buy or sell A amount of currency at P price, and the exchange just tries to "find good matches".

Is that true? And is it true that every exchange has its own algorithm for doing so and there is no "standard" for how such an algorithm should operate? If so, what info do I have to go on if I want to have a good idea of how much USD I will get for my XBT when I place a Sell order at Exchange X?

That is how most exchanges work, with an order book containing bids (buy) and asks (sell) orders. The trading engine of the exchange will match orders as quickly as possible, though in cases of a crash or excessive volume exchanges have been known to suffer a severe amount of trade lag (e.g. mtgox), resulting in orders not being filled at the last price when submitting an order.

Here's an example of how an exchange works:

You have 1 XBT you would like to sell for $1000, so you go to an exchange, deposit your coin and place a sell order of 1 XBT @ $1000. If there are bids over $1000, your order will fill at the price of that bid. E.g. If there is an order to buy 1 XBT @ $1050, you will receive $1050 less exchange and withdraw fees.

If there are no buy orders above $1000, the exchange will put your order in the orderbook and wait until it fills or is cancelled (or expires, in some cases on some exchanges). In this example, if someone were to later place a bid to buy 1 XBT @ $1050, they will pay $1000 for your order (providing there are no orders trying to sell XBT for less already on the book).

If you are trying to sell in an easier manner, I would recommend using Coinbase, which works very nicely within the US.


Will 2mb blocksize mean double as many transactions? If the blocksize is increase to 2MB will that mean twice as many transactions? Basically how much of the space is used on the standard variables found in the block?

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

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


Why can't Bitcoin transactions be stopped like SWIFT transfers? As I know, most BTC hacking happens at digital wallet (but in blocks). I believe the hacker use normal BTC transaction to transfer those stolen BTC to other block addresses. Why can't we stop the transaction like the SWIFT system does? All blocks should contain the original and source addresses. Is it because of miners doing the Merkle Tree verification to anonymously verify all executed BTC transactions mechanically and all nodes in BTC have to honor executed BTC transaction?

A transaction that steals money looks exactly the same as a transaction that sends money from one person to another. They are exactly the same thing, just that the person who initiated the transactions are different. The Bitcoin network does not know and cannot distinguish between a theft transaction and a normal transaction since they are exactly identical. Furthermore, the idea of identities don't really exist; there is no way to identify that an address is a thief's just by looking at the blockchain alone (which is all that nodes have access to).

Because the transaction is perfectly valid and no one except for the owner of the wallet and the thief know that the transaction was actually one that stole Bitcoin, the transaction will be propagated through the Bitcoin network by full nodes and included in blocks by miners. There is no central authority that can issue a stop nor is there a way for anyone else to know that a transaction pertains to a theft.


bitcoin script for a competitive crowdfunding-like contract I'm curious about how one might replicate the functionality of http://whatbitcointhinks.com/ using bitcoin script. The functionality is that there's a sort of crowdfunding competition between two charities. There's a time limit on the competition so that by the end, the charity that has raised the most funds wins all the funds.

Here's a screenshot of the concept:

The question of how this might be implemented as a smart contract came up on r/bitcoin, and I suggested a scheme that would use three p2sh addresses. But a reply asks whether the loser might get around the restriction by claiming the funds before the winner:

    Maybe side A is one p2sh address, side B is another p2sh address, and both scripts specify as outputs a third p2sh address that's a sort of 1-of-2 multi-sig address where each charity holds one of the two privkeys. Its not multi-sig exactly, because the additional restrictions are nLockTime, and for charity A to claim the funds, the inputs to the side A p2sh need to be greater than the inputs to side B p2sh.

  Suppose for concreteness that A gets 10 1BTC donations and B gets 9. What stops B from broadcasting a transaction using all 9 B donations and 8 of the 10 A donations?

Is there a way to implement this as a crowdfunding-like contract in bitcoin script?

It can't be done with today's infrastructure. We can imagine two solutions.

First solution: Bitcoin upgrades

Script gets progressively more powerful with new opcodes. In this case I think there would actually have to be a new UTXO set index (which nodes don't currently even calculate) so the script could find all the payments to a particular address/with a particular marker and reflect upon them. You could then have people put money into outputs with scripts that say in pseudo-code:

If it's past a certain time
Do the UTXO lookup to find all outputs tagged as being for party A
Do the same lookup for party B
Parse and sum them to figure out which one won. The existing instruction set might or might not be quite good enough for this, but re-enabling the opcodes that were panic disabled a long time ago doesn't seem impossible: just needs good unit tests.
Then using the result of that calculation, require a signature originated by the winning address

So the script architecture could do this, with an extension and a few of the disabled opcodes being re-enabled. But the real question is - should it?

The primary downside of allowing this sort of thing is that calculating the needed database indexes is computationally intensive and will slow nodes down, thus making them more expensive to run and hurting Bitcoin scaling.

The upside is that this construction would be audited and verified by every network participant, which is the best security you can have in Bitcoin.

For this particular use case, I'd probably feel the costs outweighed the benefits. The construction is IMO rather odd and uncompelling. It's possible though, that someone comes up with a use case for an OP_LOOKUP_OUTPUTS that actually is compelling, and we have been talking forever about making nodes calculate more indexes over the UTXO set. If we end up doing that for other reasons anyway, at that point exposing it via Script doesn't seem like such a big leap and making this construct as a "pure" smart contract would become possible (easy, even).

Second solution: oracle network

Since Bitcoin began there has been a debate about the balance between simplicity and power in scripting contracts. Bitcoin has a fairly restrictive scripting language, partly because in the early days it was found to be insufficiently well tested and open to security exploits, and reducing unused power was a quick way to stabilise the core.

Ethereum is the exact opposite, it gives scripts enormous power and access to lots of expensive capabilities, like data storage slots. How secure it is, how resistant to DoS attacks and so on is currently an unresolved question, but we know from bitter experience with Bitcoin, Java, Flash, HTML/JS etc that sandboxing mobile code is extremely hard. They're gonna have their work cut out for them. All mobile code sandboxes I know about have been found to have holes in them at some point, so nobody has ever managed to do what Ethereum wants to do without recurring exploits. This is why the Bitcoin community is so conservative with increasing Script's power.

It would be ideal if we could somehow create two scripting systems, one simple/trivial one that manages the movement of money in the core network and a more powerful one in which security breaches only impact the people using those features instead of everyone.

There's a couple of ways we can do this in Bitcoin.

One is to have an independent p2p network of oracles:

https://en.bitcoin.it/wiki/Contracts#Trust_minimization:_multiple_independent_oracles

In this case each oracle has an identity and people pay to a threshold signature of pre-selected oracles. Each oracle runs the program independently and then signs with their private key if the program succeeds.

The problem here is that you don't have much agility. Oracles can't come and go in the same way miners do.

Another is to use a side chain, when such technology becomes available. In this case the side chain does not contain any coins and two-way pegging is not necessary. Rather the side chain "transactions" just assert that a program was run and was satisfied. Oracles then "mine" the side chain thus proving that a hashpower majority ran the script and got the expected output.

A final way is to use SNARKs, when such technology becomes available.

The appeal of sandboxing things this way is that if, for example, a sandbox escape exploit is found in the dominant oracle implementation, it would result in oracle-locked outputs becoming stealable but not any other Bitcoin outputs, so the risk is contained.

The Ethereum design in contrast binds things together more tightly. An exploit in the Ethereum contracts engine could result in the entire system breaking.


Negative Bitcoin Balance I was playing around with bitcoin and I discovered an address that appears to have a negative balance on the blockchain.

The details of this address are below.  At the time of writing the blockchain states the balance in the account is -0.00199614 BTC.

https://blockchain.info/address/12AKRNHpFhDSBDD9rSn74VAzZSL3774PxQ

Does anyone know how a negative balance is possible?

Details:

Bitcoin Address:
12AKRNHpFhDSBDD9rSn74VAzZSL3774PxQ

Public Key: 04FDF4907810A9F5D9462A1AE09FEEE5AB205D32798B0FFCC379442021F84C5BBFC891EB16B0FAEF4BEF99BA6D522FB85470A20DF730808E583778AA35C7AF98F5

Private Key:
6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b

It has a Negative Balance of -0.00199614 BTC, but it also has an unconfirmed transaction for the same amount.  The transaction is from 2015.

That report page is showing unconfirmed transactions as well as confirmed.
Presumably, that transaction will never get confirmed, because it would send the balance negative.


Bitcoin will not open instead I see: error loading blkindex.dat I have downloaded it onto my windows pc 3 separate times and each time it goes to start the program it shows the bitcoin wallet "loading addresses", then it's "loading block index" then my computer makes a noise and I receive this: error loading blkindex.dat. I click OK and it disappears with no options on how to fix.

I'm not very computer savvy. Please help.

Close the client, go to C:\Users\(Your Username)\AppData\Roaming\Bitcoin and delete everything in the folder except for wallet.dat - do not delete wallet.dat under any circumstances (and empty your Recycle Bin), then restart the client. Somehow your block index file became corrupted.


How can one create a Genesis Block for a new Proof of Stake Cryptocurrency? I've been trying to fork the cryptocurrency Clams for about a week now. All of my code is correct to the coin's specifications, but I've been stuck on the creation of the blockchain. The developers have removed the code involving the genesis block and there doesn't seem to be any way for me to generate the PoS genesis block. If anyone has any experience with PoS coins, I would appreciate any advice incredibly. Thank you.

Quick and dirty solution?  Use their own initial hash.


How does a node find a transaction in the blockchain? If a (light) SPV client asks a full node for the Merkle branch containing a specific transaction (or the value of an address), how does the full node find this transaction (or the UTXOs) in the blockchain?
Does the full node scan linearly through the entire blockchain or is there a faster way to link transactions and blocks?

You can read the bip37 specification for all of the gritty details.

  how does the full node find this transaction (or the UTXOs) in the blockchain?

The client builds a filter which contains what they're interested in, be it output script (addresses), public keys, or TXID. They then send this to the node they are connected to. When they request data for a particular block the node filters it to only contain things which match the clients bloom filter, and sends it to them. To find all of their unspent UTXO, they request every single block in the chain in turn and look for things that could be theirs. As you mostly worked out, this does involve for every client the node loading 80GB of blocks from disk and performing extremely expensive filtering operations on them.

Modern nodes recognise how terrible of an idea this is, and allow users to disable the functionality completely due to the massive load and denial of service risk involved. With specially crafted transactions, a remote peer with a single command of less than 50 bytes can cause a node to load a 1MB block from disk, hash it over a million times, and then return nothing.


Why can't a transaction be redirected after it is signed? Scenario:

Step 1: User-1 initiates the TXN-1 to pay to User-2 and the TXN is not yet confirmed with the ongoing block POW.

Step 2: What prevents fraudster (anyone a miner or someone listening/participating in the network), to double spend or divert the payment to User-3 with a new TXN-2 by copying the data from pending TXN-1 including the User-1's signature?

Step 3: if the miners reject both TXN-1 and TXN-2 as a suspicious or double spend activity in the current block POW, what prevents the same fraudster to issue a new TXN-3 by copying the TXN-2 with the next block POW?

Thanks in advance.

The signature corresponds to the transaction it signs. You can't use the same sig to send the money to another address, because that would require a different transaction for which the signature would not resolve to valid.


Can the bitcoin supply be expanded? I know that bitcoin is supposed to have an almost fixed supply of 'coins' (with a maximum of 21.000.000 bitcoins) and technically it can't be expanded. If I store my bitcoins in a third-party e-wallet, or I have bitcoins in an account in a bitcoin exchange, for example, is it possible for this third party to lend my bitcoins (through leveraging for example) and thus increase the money supply by creating debt? If so, is there any regulation or fractional reserve requirement for these institutions? And finally, can this expansion of the money supply affect the price of bitcoin?

"[...] is it possible for this third party to lend my bitcoins [...]"

If the bitcoins are in your address and only you know the private key of your address, then nobody else can move your bitcoins away from your address.
However, if you deposit your bitcoins into a third party, theoretically they could do fractional reserve like normal banks do. This would cause an expansion of the currency issued by those third party, but not in the amount of bitcoins available in the blockchain.

  "If so, is there any regulation or fractional reserve requirement for these institutions?"

The bitcoin territory is still very much unregulated. The judicial system is debating much broader issues than fractional reserve requirements. For example: there is still an on going debate about whether bitcoin should be consider money or not.

  "And finally, can this expansion of the money supply affect the price of bitcoin?"

Although the bitcoin supply in the blockchain is limited to 21Mi, third parties can issue their own currency backed by bitcoins. In a free market, supply and demand would regulate the exchange rate among such currencies and bitcoin.
Depending on how this expansion of third parties currency take place, this could increase or decrease the bitcoin price.


One Code, Two Different Compilations (One Dirty Version of BitCoin) Right now i'm developing an AltCoin based on BitCoin Cash.

I have one code, which i compiled in two different servers (A and B).

The A server, compiles the Bitcoin as "Bitcoin ABC version v0.16.3.0--g2vdf00a68", but the B server compiles the Bitcoin as "Bitcoin ABC version v0.16.3.0--dirty".

Right now the nodes are visible as peers, between the servers.
But the mining has been impossible.

I think it may be related with the difference between versions, on the compilation of the SAME CODE.

Here it's the compilation output of the dirty version:

https://pastebin.com/P8A2Ydk3

Dirty means that the compiled binary includes code that is not committed in git. You can use the git diff command to see what the uncommitted code is and use git show to see what the  most recent commit is for each of your code trees. There's a good chance that what you think is the same code is not actually the same code.


ripple consensus - mathematical certainty for all unl graphs? It has been stated that ripple reaches to consensus with mathematical certainty.
If we analyze the consensus protocol, we can see that a specific validator can have a very narrow view of the state of the rest of the validators. At least 80% of his unl list must have proposed to include the transaction. Each of them received from 70% of their unl list such a proposal etc....

Unless all those nodes represent the 80% of the unl list of any validator, one cannot assume that the initial validator has knowledge there has been a global consensus on the new ledger.

A problematic example is a unl graph whose directed distance is more than 6 and has low connectivity.

Is this correct? if true what are the assumptions ripple makes on the unl graph so that the above happens?

Edit: wouldn't 2 disconnected networks reach to 2 different consensi, and thus have complete luck of knowledge of the second consensus? If we assume a graph and 2 subgraphs that are connected but have a core that is far away from their boundary. A validator that is inside that core, it will assume that consensus has been reached and only the validators at the boundary will know that there is no consensus.  In other words, shouldn't the unl list be build by a uniform random selection of all the trustworthy validators,or there is chance to not be able to detect the absense of consensus?

The conclusion that no consensus has been reached is a valid conclusion and can result due to poor topology or Byzantine failure. Certainty is always with respect to something that has occurred in the past. It is not possible to know with certainty the present state without observing at more points than will normally be possible.

So each server runs out ahead of what it knows for certain, applying transactions and attempting to reach consensus on them. When and if a consensus is in fact produced, the server later determines this with certainty, and thus can advance what it knows for certain.

Essentially, the consensus process produces a a stream of signed messages called "validations" from which it's possible to determine with certainty whether a consensus had actually been reached at some point in the past.

It is possible to create UNL topologies that frequently fail to reach consensus. The plan is to have Ripple servers build their UNLs using an algorithm that makes such topologies exceedingly unlikely.

Even with a perfect topology, two types of Byzantine failures are possible.

One, which is not that uncommon (one out of every 200 rounds or so), is a local failure. In order for a consensus to ever arise, someone has to declare a consensus. And for that to happen, someone must declare a consensus first. When that happens, whoever makes that declaration can't know for certain that others will declare that same consensus (or they would have already done so, and so he wouldn't be first). So it's always possible that he declares the wrong consensus.

In this case, the server that suffered the Byzantine failure quickly discovers that the other validators have built a different ledger than it did and it begins its resynchronization process. Other servers will still, from the validations, which ledger was the majority ledger.

A much less common type of failure is complete Byzantine failure. In this case, several servers declare different consensuses and there is no clear majority ledger. In this rare case, the network as a whole must reconverge before a true consensus will emerge. Ripple has an algorithm to do exactly this. Servers will see the conflicting validations and know with certainty that there was no actual consensus.


What kinds of wallets are there? Can I get short a explanation about cryptocurrency cold/hot wallets?

Are there more kinds?

Hot and cold in this case refer to if the private key is stored on a system connected to the internet or not. Hot wallets are stored on system connected directly to the internet. This can be on the client machine or on a centralized server. A cold wallet can be a HW wallet, an offline wallet or a paper wallet. You kind of create an air-gap that drastically reduce the attack surface on the wallet.


Is having a copy of my wallet.dat file enough to recover lost Bitcoin? I have been using Bitcoin-qt to mine bitcoin. I am a little worried about losing my coins on my computer, so I have made a backup of my wallet.dat file and put it somewhere safe.

Is this the right way to keep my coins safe from my computer crashing? Am I completely on the wrong track? What else might I need? I haven't encrypted my wallet.

Yes, but having the wallet.dat file is only enough to recover the lost bitcoins if it hasn't been compromised in the meantime (that's why it's a good idea to encrypt your wallet). There have been at least 2 other questions in the last week or two where a user tried to recover an old wallet and found it had been emptied.

If you do encrypt your wallet (and you should, to protect against malware stealing it), then you'll also need your passphrase for the wallet when you want to restore it and reopen it.


Antimer L3+ - Approximately How Many Coins In 30 days I am about to receive one L3+ LiteCoin miner with
A hash speed of 4TH/s.

Approximately, how much litecoin could I
reasonably expect to mine in 30 days with my L3+
running at full operating speed 24/7, with unlimited
bandwidth up/down for my internet connection to
the miner? Approximately??

Thanks in advance for any response!

An Antimer L3+ could be making about 32 USD per Antminer per day. But the total over 30 days depends on a lot of things. If you take an average of 30$ over 30 days and bitcoin price average of 11,000, then you could make 900$.

Also, you need to include other things like a power outage, internet connection down, and hardware issues to be on safer side.

Let us know if this answers your question.


Bitcoin QT - why do I have an undefined reference to `qInitResources_bitcoin() error I have built the Bitcoin source code, created my own genesis block and everything was working great! Now that I have changed the word bitcoin to GELF in some places of the program to suit my own software's name, I am running into plenty of issues with undefined references. I cannot seem to work out why I am having this undefined particular undefined reference when I run make. Here is my error output:

make
make[1]: Entering directory '/home/q/Desktop/GELF-master/src'
make[2]: Entering directory '/home/q/Desktop/GELF-master'
make[2]: Leaving directory '/home/q/Desktop/GELF-master'
  OBJCXXLD qt/GELF-qt
qt/qt_GELF_qt-bitcoin.o: In function `main':
/home/q/Desktop/GELF-master/src/qt/bitcoin.cpp:548: undefined reference to `qInitResources_bitcoin()'
collect2: error: ld returned 1 exit status
Makefile:3701: recipe for target 'qt/GELF-qt' failed
make[1]: *** [qt/GELF-qt] Error 1
make[1]: Leaving directory '/home/q/Desktop/GELF-master/src'
Makefile:9475: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

I can't find anywhere in the code where this function is defined! Here is the line that is breaking:

Q_INIT_RESOURCE(bitcoin);

What does this function do? It isn't anywhere to be seen in the developer reference. How can I resolve this error?

The root cause of the error is likely related to the Qt Resource Compiler (rcc), which is generally called earlier as part of the bitcoin compilation process. The rcc generates the src/qt/qrc_bitcoin.cpp file from the src/qt/bitcoin.qrc resource file.
Unfortunately, the compilation process is not halted, if the rcc encounters an error when operating on the resource file. Instead an empty src/qt/qrc_bitcoin.cpp file is created. qInitResources_bitcoin() is never defined and hence will be missing during the linking process.
A common source of errors are missing assets in the qt makefile (ensure listed assets in src/qt/bitcoin.qrc are also included in src/Makefile.qt.include.