what's inside empty blocks? what purpose does it serve? i understand that blocks are created if there's a transaction, i've also seen many similar questions asked before about this, but i still wonder many answers stating that miners will mine empty blocks, this lead me to another set of questions haven't answered before.

what's inside those empty blocks? (i mean, what is "computationally expensive" from an empty item)
how can a system creates blocks that are empty and have no use (not for transactions use)
what happen if there are transactions example like sending btc to other address but nobody mining it (verifying it through mining), will the transactions ever get through to the destined address?

hope to find answers for this question, since i'm building a blockchain and it struck my logic multiple times

what's inside those empty blocks? (i mean, what is "computationally expensive" from an empty item)

Empty blocks still contain data. They aren't devoid of data, they simply do not have transactions other than the coin generation transaction (known as the coinbase transaction) in them. Since an empty block does not contain any transactions from the Bitcoin network, it is considered to be empty. Empty blocks are still computationally expensive because miners still have to produce a Proof of Work. They still have block headers which are 80 bytes and have all of the fields that non-empty blocks do. They still have a list of transactions; but that list just contains one transaction, the coinbase transaction, which pays the miner the block subsidy.

  how can a system creates blocks that are empty and have no use (not for transactions use)

Empty blocks still have a use. They aren't completely useless. Firstly, they extend the blockchain adding additional work to the blockchain. The transactions that a block contains does not effect how much work needs to be done to mine the block, so empty blocks strengthen the security of the blockchain by adding to the cumulative work gone into the blockchain.

Empty blocks also introduce new coins to the Bitcoin system. They still pay miners for the work that they did, so new coins are generated and paid to the miner of that block. This is part of the coin generation transaction included in the block itself as the only transaction.

Additionally, when there are no transactions, the network still needs to move on. There still needs to be blocks mined, so empty blocks must be allowed in order for the blockchain to continue.

  what happen if there are transactions example like sending btc to other address but nobody mining it (verifying it through mining), will the transactions ever get through to the destined address?

If nobody ever includes a transaction in a block, then the transaction is never considered to be final. It will still appear in users' wallets as unconfirmed and they will see the coins. They can even spend the outputs of that transaction, but creating transactions from unconfirmed transactions is not advised. Such a transaction would also be unconfirmed so long as the first unconfirmed transaction remains unconfirmed.


Are Monero Transaction Anonymous? Lets say i have a monero address and want to send my coins to another address. Will that transaction be private? Can somebody find out that i sent those coins? Are there any altcoins that i can use to send funds from one address to another without anyone knowing that i did?

Short answer: yes, it will be anonymous

Long answer:

The following applies to all Cryptonote based coins, unless stated otherwise:

On the blockchain, all addresses are one time addresses. In Bitcoin, you are exhorted to not reuse addresses, but Monero enforces this. Every new transaction causes a new one time address to be generated, in such a way that the recipient can derive the private keys to that new one time address (and thus spend those funds).

Moreover, Monero uses ring signatures to obscure which outputs are being spent. Those ring signatures are made with 1 private key (the one you're spending) and an arbitrary of public keys, those of outputs that you cannot spend. The transaction you send will appear to spend one of that set. The trick is that you can generate signatures such that an observer (ie, someone finding the tx on the blockchain) can be assured that one of the outputs in that tx was spent with the corresponding private key, but cannot tell which one. On the blockchain, they only see the public keys of your spent output, and the N other public keys you picked from the blockchain.

So, to recap: an observer sees that an output among this set of outputs was spent, but does not know which one. And sees that it went to that new one time address, which has no link to the recipient's address (unless the observer has the recipient's view private key, nice trick to allow a third party read only access to your income).

Now, the devil's in the details. There are other ways inferences could be made, such as particular amounts being spent (ie, if you're sent a very specific amount of dust, it's the only output of that particular amount on the blockchain). The Cryptonote protocol splits amounts by denominations (ie, sending 153 monero will, create three outouts, 100 monero, 50 monero, and 3 monero, so it's a lot easier to hide). Monero is currently working on an adaptation of gmaxwell's Confidential transactions (https://lab.getmonero.org/pubs/MRL-0005.pdf), which can be used with ring signatures, so that this avenue will be fully blocked (this is Monero only, other Cryptonote coins do not have this).

So, yes, if you use Monero, your transactions will be private. Cryptonote is the state of the art in blockchain privacy, though Zerocash may top it once it is released, though Zerocash also has issues of its own, so this will be an interesting thing to see.

By the way, all the papers on https://lab.getmonero.org/ are worth reading if you want to know more about the details.


Which crypto currencies can merge mine with Bitcoin? I remember namecoin has the ability to merge mine with Bitcoin. Are there any others? Is this a bitcoin ability or ability of the coin that is merge minable?

Being able to merge mine with another cryptocurrency recquire that both chain use the same hashing algorithm, sha256 in our case, so in theory all those crypto could do it https://en.bitcoinwiki.org/wiki/List_of_SHA-256_crypto_currencies

The most famous currently merge mining being Dogecoin with its parent blockchain Litecoin both using the same algorithm

You can read more here: https://medium.com/altcoin-magazine/merged-mining-how-dual-mining-of-cryptocurrencies-works-98323ea57529


Issuing bitcoin-cli commands via terminal I am having issues utilizing bitcoin-cli via terminal. For example:

DIRECT-8A-HP-OfficeJet-4650:~ peter$ bitcoin-cli deriveaddresses "wpkh(xpub6Dy2ikUu5mXbDdhw2vAP1C4eiQM8rTz1NiWQt2BzGi83iHC2gEgTSD54JveyuHF9VLAqNkCGnee1jdBL7nA3JNorbqjSSS8DEV6Hn3PuNBt/*)#mn5jvyc3" 99
error code: -8
error message:
Range must be specified as end or as [begin,end]
DIRECT-8A-HP-OfficeJet-4650:~ peter$

However the exact same text in the Bitcoin Core console works without issue.

What am I doing wrong?

I figured out a solution, just use curl in the terminal which communicates the commands via binary data.


Is the transaction within Genesis block spendable? Are the transactions added to the genesis block spendable, just like any other transactions from other blocks, or is that an unspendable coinbase transaction.

In other words..

Is the transaction within the Genesis block spendable, provided the corresponding private key of the bitcoin recipient is found?

and If I fork the Bitcoin code, and generate my own genesis block. Can I use the private key/public key I used as bitcoin recipient of the transactions  hard-coded with the genesis block?

Are the transactions added to the genesis block spendable, just like any other transactions from other blocks, or is that an unspendable coinbase transaction.

Transactions aren't spendable; transaction outputs are.

  Is the transaction within the Genesis block spendable, provided the corresponding private key of the bitcoin recipient is found?

The single transaction output in Bitcoin's genesis block is not spendable. It is not known whether this was an intentional choice by the system's creator, or an accident. Regardless, the reasons why currently don't matter, as no Bitcoin full node software would accept such a spend.

  If I fork the Bitcoin code, and generate my own genesis block. Can I use the private key/public key I used as bitcoin recipient of the transactions hard-coded with the genesis block?

In your own software you can enforce whatever rules you like.


What is the minimum hash rate power should I have to get rewarded in btc.com? I just want to know how much minimum hash rate power should someone have to receive reward in btc.com or other pools?

There is no definable minimum, because the expected reward for having x amount of hashpower is constantly changing. As other miners add or remove hashpower from the network, the effective 'minimum' would be expected to change. The answer to your question will also depend on the fees and policies of btc.com, so it does not fit the scope of questions for this site very well.

See also: How much Bitcoin will I mine right now with hardware X?


bitcoind: incorrect rpcuser or rpcpassword (authorization failed) The host system is Linux Debian Stretch (9 / testing).

The Bitcoin Core package for Linux I have just downloaded and verified and installed.

I have created the following file:

/home/myUsername/.bitcoin/bitcoin.conf

With contents:

listen=1
server=1
rpcuser=myUsername
rpcpassword=myPassword
rpcport=8332
rpcconnect=127.0.0.1

Then I have punched the following holes to my firewall:

sudo iptables -A INPUT -p tcp -m tcp --dport 8333 -m comment --comment "Bitcoin Listen" -j ACCEPT

sudo iptables -A INPUT -p tcp -m tcp --dport 8332 -m comment --comment "Bitcoin RPC" -j ACCEPT

And forwarded the 8333 port from my router to the server.

I am unsure whether the second hole is necessary for RPC connections, but that's not the question now.

If I now run the following command as my regular user:

bitcoind -daemon -datadir=/raid1a/bitcoind/

It says:

Bitcoin server starting

I wait for a few minutes for it to initialize and then invoke:

bitcoin-cli getinfo

With the result:

error: incorrect rpcuser or rpcpassword (authorization failed)

I have a very long and complex password, could that be the pickle?

The debug log says only:

ThreadRPCServer incorrect password attempt from 127.0.0.1:someport

Despite I run both bitcoind and bitcoin-cli as the same user, it for some reason fails to find my personal config file located in standard location:

$HOME/.bitcoin/bitcoin.conf

So I have set up an alias:

bitcoind -daemon -datadir=/raid1a/bitcoind/ -conf=/home/user/.bitcoin/bitcoin.conf

Case solved.


Is it likely that bitcoin will implement important changes in the future? Bitcoin is still the biggest cryptocurrency in terms of market cap, and it will always be the first one to solve some of the most fundamental problems around the implementation of a cryptographic coin.

However we have many newer coins that solve some of the shortcomings of bitcoin and extend the possibilities: scalability/transaction rate, processing time, smart contracts, energy requirements, etc.

Because of this, I find it hard to believe that bitcoin in its present form would continue to be relevant (though I may be mistaken). I don't think that the miners would just let bitcoin fade out either though.

Is it likely that the bitcoin protocol will see very important changes in the future to address these issues so that it can remain relevant (block size, changes in consensus forming, block creation rate, smart contracts)? Are there technological impediments to this? Or is it more likely that this will be done in minoritarian hard forks, while the main bitcoin blockchain will go on essentially how it is right now?

many newer coins that solve some of the shortcomings of bitcoin and
  extend the possibilities

This is technically false; hence this question stems from wrong information.

If you can present a superior algorithm/protocol in your question(purely the explanation minus all buzzwords) community will consider it. Point is, if it exists out there, probably the core devs have considered it already. All the discussion is public w.r.t IRC logs so those might help understand shortcomings of various protocols that asker is arguing for.


What's the difference between these two usb miners? I'm thinking on buying a USB bit coin miner. And searching in amazon I found these two products, that I think that are the same but I'm not sure because one it's 15$ more cheap than the other.

The products are:
- USB Miner 1
- USB Miner 2

So, what's the difference?

According to the specs, there is no difference between the hardware -- they have the same hash rate (330 MHz) and use the same amount of power (2.5 W), so they should be interchangeable. It is possible that there are software compatibility issues, but this is unlikely. The machines are likely identical, so there may be other reasons for the difference in price.

The value of pretty much anything related to bitcoin is volatile right now, including mining equipment, so it's reasonable to see fluctuations in prices like this based on the whims of individual sellers that don't reflect a broad trend across the market. Consider this: the seller with the higher prices also advertises a very limited stock. It's possible that both sellers started out at with same price, and while one decided to start selling off a large quantity at a discounted rate, the other decided to stick to the original price and just sell off all they have left.

So, since there's probably no real difference -- just buy the cheaper one.


Is there any full node software for bitcoin with serious wallet functionality? I'm looking for a bitcoin software with a full-featured wallet functionality and running a full node, but I cannot find any.

Bitcoin Core does run a full node and the network capabilities are great, but the wallet functionality is very limited, it does not support BIP39 mnemonic (so there is no easy way to store the private key on paper for security), the addresses are stored on disk without encryption (it does encrypt private keys, but only that). So any backup have all this data.

On the other hand, electrum wallet seems to support everything, but it connects to electrum nodes only (it does not connect to the bitcoin network) and it send public address there to query for transactions.

Is there any alternative I'm missing? I thing that any sofware that make the wallet side of the equation while connecting to the full node I'm already running should work, but could not find any thin client wallet for bitcoin.

You can connect your Electrum wallet to your own Electrum server to preserve privacy. There are different Electrum server implementations:

Electrum Personal Server

  Electrum Personal Server aims to make using Electrum bitcoin wallet more secure and more private. It makes it easy to connect your Electrum wallet to your own full node.

ElectrumX - Reimplementation of electrum-server

  A reimplementation of Electrum-Server for a future with bigger blocks.

electrs - Electrum Server in Rust

  The motivation behind this project is to enable a user to run his own Electrum server, with required hardware resources not much beyond those of a full node.


Using ZeroMQ of bitcoind to monitor addresses? I'm developing a system which should monitor incoming transactions for the local addresses (addresses in this node's wallet).

It would be great to use high-performance ZeroMQ for this. Is it possible?

I know I can receive notifications about new transactions from it. But notification only contains transaction ID. How do I know if it's related to one of the local addresses?

Do I need to make RPC call for each transaction to find it's output address? This seems extremely ineffective, cause there a lot of new transactions and by making so many RPC calls I will just flood the server.

Is there a better option?

Actually, it's pretty much possible!

You will have to listen for rawtx topic of ZeroMQ in order to retrieve binary representation of the transaction descriptor.

Then you should parse the transaction body and extract Bitcoin addresses from it's output scripts. You could either do this manually, or use some third-party library. No need to make RPC calls!

References:

Bitcoin Transaction Format
Bitcoin Script Format


Broken miner: no more backup pools I have 3 graphics cards running poclbm each with a rate of about 140 MH/s. This has been running since I posted an earlier question ( "No more backup pools left. Using primary and starting over." ) in August I have not found/created a block in that time.

However every so many hours or every few days (irregularly, but never 5 days uninterrupted), I get the message, "No more backup pools left. Using primary and starting over."

Is this message effecting my ability to mine, or am I just impatient?

This indicates that your miner couldn't get work from the pool fast enough and so some mining power was wasted. If this only happens occasionally, I wouldn't worry about it. If it happens often enough that it's impacting your mining rate, you may wish to configure a backup pool. If it's happening because your Internet connection is slow or unreliable, there's probably nothing you can do about it.


Why should I pay in bitcoin as opposed to traditional payment methods? Recently I have seen a few online stores starting to accept bitcoin as a payment method, but I can't think of a reason why I would ever want to pay in bitcoins.

Since I get paid in GBP then I would need to convert that into bitcoins somehow. Most likely by buying them from an exchange. Surely this just creates an unnecessary step since I could just pay the merchant directly using the same method that I purchased the bitcoins from the exchange with.

Even if you are worried about anonymity you could just send cash through the mail directly instead of first sending it to an exchange. I mean, ultimately you need to convert the currency you are paid your salary into bitcoins one way or another. Why not just use that method to send the money directly?

This is an interesting question, and certainly one to which the answer will evolve before Bitcoin adoption could hit the mainstream.

On an abstract level, it is trivial to answer: In order for you to want to pay in Bitcoin, it must give you an advantage compared to other payment methods, or it must be the exclusive path to some good or service.

There are a number of concrete reasons, although maybe none of them will apply to you personally.

Tipping and Donating

Like sending money in the mail, it is possible to offer monetary support without providing your identity or address. Additionally, with Bitcoin the receiving party doesn't have to provide its personal information.
The low transaction fees make it economically feasible to send smaller amounts than by mail. This is especially true if the receiving party is located in another country. It's easy to send just a few cents to another internet user to commend him for an insightful contribution.

Buying digital goods

Buying access to a newspaper article, a movie, or an mp3-download currently requires you to create an account with the merchant and, often, to create a balance first. Bitcoin could allow such purchases without exchange of personal information for a global market.
Especially for small purchases, it would be likely that merchants would offer a discount, as receiving bitcoin payments is significantly cheaper, easier to implement, and less hassle, since they can't be charged back. On the other hand, any sufficient reputable service would not be interested in scamming the customers for cents, potentially alienating its userbase.
For example, I could easily see Bitcoin become a much used payment method for computer game vendors such as Steam or GOG, as it already has become for HumbleBundle.

Online Gambling, Pornography, and Drugs

While we might not like it, Bitcoin as a payment method has advantages for services of questionable morality and legality, so there are some that operate solely on Bitcoin or at least offer it as an alternative payment method.
It might be preferable to users to pay by Bitcoin, than to have a pornsite's charge on the credit card, while pornsites have a lot of trouble with chargebacks due to buyer's remorse and for other reasons.

Bitcoin is a fast and cheap way to send money to a private person abroad

Definitely faster than an international wire, or even TransferWise.
Likely cheaper than Western Union or PayPal (depending on exchange courses and amounts).

You don't need a bank account

For a lot of people it is significantly easier to gain access to Bitcoin (just internet access), than to get a credit card or even a bank account. Currently, not having access to banking is a major hurdle in order to participate in online markets.

Travelling

Far down the road, it might be easier to carry just Bitcoin while traveling than to exchange to the local currency for each country. Already, one can pay taxis, hotel rooms, air fare, and food delivery in Bitcoin.


Storing HTML websites in the blockchain? I see that the blockchain has enabled lots of different distributed networking principles, other than just enabling cryptocurrency. For example Namecoin uses the blockchain for storing DNS data.

I am wondering about the feasibility of storing entire websites in the blockchain. For example, the likes of Wikileaks could find a safe haven in a blockchain which anyone could easily have a copy of and browse locally, off-line or simply anyone could host and manage a website that would be practically impossible to shut-down, since there would be no single point of failure.

Of course this could only enable static content and it would be impossible to have a secure storage system unless it was referenced outside the blockchain, but that would defeat the purpose. But there are many valuable websites out there for which this wouldn't be a problem.

Thoughts?

To get large blocks incorporated into the blockchain, you will have to pay transaction fees based on their size. It could be an interesting exercise to compare this with storage costs for the same level of long-term redundancy elsewhere---but then again, what is the level of redundancy? If storage in the blockchain does become common, it is obvious that soon most people will (have to) stop storing the entire blockchain locally, defeating the purpose of having a highly accessible and highly redundant storage (for your website example or maybe for backup).

In you wikileaks example, I think this might pretty much defeat its purpose. Although many people may be interested in many of their leaks, surely only a small fraction of bitcoin users will be that interested that they'd be happy to store it without reimbursement for their wasted storage space. And at a reasonable compensation, the person or organization leaking it must be so rich, you'd wonder if it was cheaper to finance political campaigns that can change the system to allow risk-free whistleblowing at lower expense.

Also note that wikileaks is not in the business of releasing most of their information. I believe what they have distributed in bulk is a very strongly encrypted version of everything, and very selective, carefully edited small bits. The encrypted bulk would not give the benefits you imagine (allowing anyone to browse it)---and luckily also none of the risks, I might add (just imagine any of what the media has actually redacted out of their stories included something actually dangerous, like, say, the key with which some madman could trigger WW III). And it is not needed: As I understand it, plenty of people have downloaded and spread their encrypted bulk data for free and out of their own volition. I suspect if you wanted to get it, you might still find it easy to find online. Just what you might hope from getting out of browsing an encrypted monster-sized file is a bit beyond me; it seems to me the only benefit is knowing to have helped slightly with wikileak's self-insurance policy.


Reference an UTXO of a transaction that has not been yet mined How to reference an UTXO that has not been yet mined? I want to prepare a transaction and, before spreading it, use its UTXO as input for another relative timelocked transaction. Then, spread the first prepared transaction.
How to do it?

The UTXO is referenced as an outpoint(TXID, Index) in the input of your time-locked spending transaction.

So, when creating your time-locked transaction, you need to know the TXID of the (unconfirmed) transaction you are spending.

Simply double+sha256 and swap endianness of the over-the-wire transaction serialisation to get the TXID you wish to reference.

This TXID is a unique identifier (assuming no TX malleability). The outpoint you are referencing in your spending transaction is not affected by the confirmation of said UTXO.


Got an issue compiling After working my way through many errors compiling an alt-coin windows qt.

Everything compiles fine right until the final stage when the system is putting together the exe.

You can find the error below. leveldb is installed and libleveldb.a and libmemenv.a files are correctly in src/leveldb ... Any help resolving this issue would be appreciated.

uuid -lgdi32 -lboost_system-mgw48-mt-1_54 -lboost_filesystem-mgw48-mt-1_54 -lboo
st_program_options-mgw48-mt-1_54 -lboost_thread-mgw48-mt-1_54 -lboost_chrono-mgw
48-mt-1_54 -lQtGui4 -lQtCore4
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x433): undefined reference to `l
eveldb::DB::Open(leveldb::Options const&, std::string const&, leveldb::DB**)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x73f): undefined reference to `l
eveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x866): undefined reference to `l
eveldb::WriteBatch::~WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x89f): undefined reference to `l
eveldb::WriteBatch::WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x921): undefined reference to `l
eveldb::WriteBatch::~WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x944): undefined reference to `l
eveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0xac4): undefined reference to `l
eveldb::WriteBatch::Iterate(leveldb::WriteBatch::Handler*) const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0xaf5): undefined reference to `l
eveldb::WriteBatch::Handler::~Handler()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0xb24): undefined reference to `l
eveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x14a9): undefined reference to `
leveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x176f): undefined reference to `
leveldb::WriteBatch::Put(leveldb::Slice const&, leveldb::Slice const&)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x18b2): undefined reference to `
leveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1a57): undefined reference to `
leveldb::Options::Options()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1ae0): undefined reference to `
leveldb::Options::Options()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1b35): undefined reference to `
leveldb::NewLRUCache(unsigned int)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1b44): undefined reference to `
leveldb::NewBloomFilterPolicy(int)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x1b9c): undefined reference to `
leveldb::NewBloomFilterPolicy(int)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x2021): undefined reference to `
leveldb::WriteBatch::~WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x211d): undefined reference to `
leveldb::Status::ToString() const'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x35c3): undefined reference to `
leveldb::WriteBatch::Delete(leveldb::Slice const&)'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x6488): undefined reference to `
leveldb::WriteBatch::~WriteBatch()'
./build\txdb-leveldb.o:txdb-leveldb.cpp:(.text+0x64b8): undefined reference to `
leveldb::WriteBatch::~WriteBatch()'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: ./build\tx
db-leveldb.o: bad reloc address 0x2 in section `.text$_ZN5boost16exception_detai
l10clone_baseD1Ev[__ZN5boost16exception_detail10clone_baseD1Ev]'
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: final link
 failed: Invalid operation
collect2.exe: error: ld returned 1 exit status

Check if your libleveldb.a compiled all necessary files correctly. Could you run the following commands please and post the output back?

ar tv libmemenv.a and ar tv libleveldb.a. If the output is something similar to

rw-rw-rw- 0/0 432255 Apr 15 16:56 2014 memenv.o
rw-rw-rw- 0/0  21322 Apr 15 16:56 2014 port_win.o

then the problem could be that your Windows find.exe is overruling your MSYS file.exe. They both work very differently and are not interchangeable. The makefile of LevelDB uses the Unix style find.exe. You can fix this by explicitly putting your MSYS find.exe directory before the Windows find.exe directory (which should be something like C:\Window\System32\find.exe).

This was a very hard problem to track down and you can see my progress (and that of Ron, who kindly helped me a lot, thanks Ron!) on the 'official' building Bitcoin thread on bitcointalk.org. Starting at page 28 and continuing down until you don't see my name anymore (I'm called Jori there too, it's my real name).


What are the factors affecting expected difficulty and what is the maximum value it can take over the period of 30 days? Lets take for example day 1 difficulty of 300MM. What is the mechanism to determine the rise in difficulty?
What is the maximum value it can go starting from that number and expecting the biggest possible rise over 30 days?

The difficulty is not limited by a specific time-frame, but solely depends on the amount of hashing power available in the network. The difficulty is updated every 2016 blocks increasing or decreasing up to factor four. While the algorithm strives to set the difficulty such that it will always take about fourteen days for 2016 blocks, it could happen that the hashing power grows much faster than that:

Scenario: Difficulty has been just set to 300MM, and somebody adds a crazy mining rig which is 20x as fast as the whole network

The network is now 21x faster than what the difficulty tries to balance
2016 Blocks are mined in 16h instead of 14d
Difficulty quadruples to 1200MM, the next difficulty reset is reached after another 64h (2d 16h)
Difficulty quadruples again to 4800MM,  the next difficulty reset is reached after 256h (10d 16h)
Difficulty finally catches up with the hashing power added and only increases by 21/16.

In this scenario it would take the network (16+64+256)/24=fourteen days to increase by factor 21. Imagine that our great engineer figures out how to first build one of those super-rigs a day and then speeds up the progress. Theoretically the difficulty could increase by factor four every hour all 30 days (which would be a factor of 2880).

In other words, there is no maximum value for the difficulty in the next 30 days.


How do you deploy a Bitcoin-Cash full node on a Cent OS 7 server? I'm looking to compile it on CentOS 7.

Perhaps a guide.

Follow this deployment guide.

https://github.com/CanadianRepublican/BitcoinCash-Daemon-Deployment-CentOS7

it includes a systemd service file, and a logrotate configuration file


Can Bitcoin be used in QuickBooks? I'm wondering if I can manage my bitcoins with my other securities? Or incorporate them into a business plan.

Sure you could However it would be necessary to know how you transact with the coins...do you simply trade them out for fiat immediately?  If so, then I would create the payment as a check from the exchange for the dollar equivalent that was collected and put the transaction ID and recipient address in QB.  You should probably setup something like coinpunk or at least a full wallet server so that you can issue one time use addresses that are meant to be tied to your customer's account.  This way, it will be easier to reconcile later.  If you try to process your payments together manually into your own wallet, then I at least suggest to create a new wallet each month so that your transactions can be bundled together for ease of reconciliation purposes.

I don't think that you can add XBT as a currency yet within QB but then again I haven't used it in a couple years now.


Is there a way to maintain a continually updated copy of blockchain without running a wallet? This question is in response to being stupid, as I just tried to spend from my B-Qt wallet before it was finished syncing (power outage fun yesterday). Was scary when it froze after hitting send, had to force quit the app and relaunch. Hopefully nothing was actually sent and I can redo the transaction. The bitpay invoice did expire, so I'm hoping for the best.

But it got me to thinking if there was a way to keep an updated copy of the blockchain without actually having to keep my Bitcoin-Qt wallet running. Because security? Presumably I'd be able to point the Qt client at this updated blockchain in the event it hasn't been synced for any amount of time, and it would negate the need to get caught up.

Is anything like this possible or already in existence?

I know I could use a sync-free online wallet but I do not want to store coins anywhere but locally. The point being to have a non-wallet blockchain sync but only activate the wallet part when I want to spend.

You could keep two wallets, an 'updater' wallet and a 'secure' wallet, and use the same blockchain with both using the following instructions:

Separate wallets sharing the same blockchain?

The updater wallet would run most of the time, and then you would switch to the secure wallet when needed. Heed the advice about not running two wallets on the same blockchain at the same time.


Why does Bitcoin RPC load wallet too slowly? I'm trying to load old wallet (which I have not been opening for months) and it takes too much time (~minutes). In this time seems like I can't do any further requests to RPC. After this new calls to this wallet takes milliseconds.
Is it true, that Bitcoin somehow synchronize old wallet with the current state of the network and that's why it takes so much time?

Is it true, that Bitcoin somehow synchronize old wallet with the current state of the network

Yes. If the wallet file is not synced with the current blockchain state, a rescan will occur starting from the block that is recorded in the wallet file. It does not rescan all of history, only the things that it has not yet seen.

  and that's why it takes so much time?

Perhaps. There are other things that can effect wallet loading times. In particular, if you have a lot of keys and transactions, loading the wallet could take a long time too.


Which crypto-currency has the most even distribution of wealth? Bitcoin, Ripple, PPCoin, Freicoin and most other cryptocurrencies have a significant portion of the currency in the hands of early adopters or a central group charged with 'distributing' the currency. Does anyone know which has been the most successful at distributing the coins evenly?

Thanks

It's possible to track how many coins are owned by a given address, but there's no way (at least, no easy way) to associate an address with its actual owner; it's not possible to know for sure how wealth is distributed.


SECP256K1 Minimum Value for Private Key I've been looking into Elliptic Curve Cryptography, in particular the SECP256K1 spec which is used in Bitcoin and Ethereum. So I understand that the Generator point G is fixed based on the spec and that a 256-bit private key (privKey) is (ideally) truly randomly selected from 1 to 1.157920892373162e+77. The public key (pubKey) is derived from the private key such that the public key is privKey*G where this includes point addition and point doubling operations.

Now what I haven't seemed to figure out yet is that there is a fixed entrance point G which any adversary would need to start at to try and decipher a private key from a public key (assuming a partial rainbow table of values is not used).

So wouldn't that mean the largest value for the private key, which is the furthest amount of steps away from calculating (i.e. 1.157920892373162e+77), is the most secure?

Hence wouldn't private keys below a certain threshold be considered compromised e.g. private keys in the range of 0-1000 for example?

I feel like there is something I'm missing here, any help is appreciated!

If people in general would more often pick lower integers as private keys than larger integers, then it would be a good strategy for an attacker to start with lower integers.

However, the opposite also holds. If people would more often pick larger numbers, then atackers would ideally start at the end and work their way backwards.

In practice, no such bias exists. As long as people use decent proper random number generation, every integer is just as likely as any other, and it does not matter in what order an attacker tries things. He'll need to go through half of private key range on average regardless.

So no, there is no minimum number to start at. Yes, you have an extremely small chance of picking a number between 1 and 1000. But similarly you have an equal chance to pick a number between 76136428194729137 and 76136428194730136. An attacker has no reason to think you're more likely to pick something between 1 and 1000, so why would an attacker start at?

Also, whenever the attacker has the public key, there exist far faster (but still completely infeasible) algorithms to find the private key. These algorithms inherently operate in random order, so it does not matter.


In LN, how could a payer prove to 3rd party that he indeedly made a payment to the payee? For regular on-chain payments, a txid can prove at least a transferring of value indeedly happened, at a specific time, despite that it may be totally irrelevant. For example, a malicious user can send his own money to himself, to pretend that he purchased some goods from an innocent merchant.

For LN off-chain payments, is it possible for a payer to prove to 3rd party that he had indeedly made a payment to the payee?

In lightning the receiver of the money comes up with a random secret and comits to it via the payment hash. Once all the hashed time lock contracts (htlcs) are set up along a path through the network from the sender to the receiver the recipient will release the secret preimage for the chain of htlcs to settle. The preimage can be seen as a proof of payment. However as with the onchain case there is some doubt. Every node along the route who participated in the payment will know the primage of the payment hash and could thus argue that they initiate the payment


ECDSA: (v, r, s), what is v? Deterministically signing a Tx with RFC6979 returns v, r, s, where r and s are the 2 values used in standard ECDSA signatures. v = 27 + (y % 2), so 27 + the parity of r, as pybitcointools indicates.

So for even r, we get v = 27, odd r we get v = 28.

How is the value of v (27 or 28) important? Why is it necessary to have a v value? Also, why is it 27?

This has nothing to do with RFC6979, but with ECDSA signing and public key recovery.

The (r, s) is the normal output of an ECDSA signature, where r is computed as the X coordinate of a point R, modulo the curve order n.

In Bitcoin, for message signatures, we use a trick called public key recovery. The fact is that if you have the full R point (not just its X coordinate) and s, and a message, you can compute for which public key this would be a valid signature. What this allows is to 'verify' a message with an address, without needing to know the full key (we just do public key recovery on the signature, and then hash the recovered key and compare it with the address).

However, this means we need the full R coordinates. There can be up to 4 different points with a given "X coordinate modulo n". (2 because each X coordinate has two possible Y coordinates, and 2 because r+n may still be a valid X coordinate). That number between 0 and 3 we call the recovery id, or recid. Therefore, we return an extra byte, which also functions as a header byte, by using 27+recid (for uncompressed recovered pubkeys) or 31+recid (for compressed recovered pubkeys).

Strictly speaking the recid is not necessary, as we can just cycle through all the possible coordinate pairs and check if any of them match the signature. The recid just speeds up this verification.

In general, if h is the cofactor, the maximum number of different points with given "X coordinate modulo n" will be 2(h+1). In the case of secp256k1, which has cofactor 1, we get 2(1+1) = 4.


get any transaction in p2p manner using bitcoinj I'm pretty sure bitcoinj is capable of downloading any Bitcoin transaction from P2P nodes by broadcasting GetDataMessage because that's what it  does in the peer.downloadDependenciesInternal method.

I'm trying to find/implement a very simple method which would download a transaction with its inputs and outputs and the block in which it's included (if any) but, because of Guava asynchronous futures, I cannot figure it out.

Very simply, I would like to replace 3rd-party services like blockchain.info with something decentralized.

GetData can fetch only unconfirmed transactions, and that's what Peer.downloadDependenciesInternal is doing.

You might want to contact the developer of the now defunct biteasy.com block explorer, he was using (and extending on) bitcoinj.


Is the NotHaus conviction (Liberty Dollar) relevant as legal precedent? Bernard von NotHaus (the creator of the Liberty Dollar) was convicted of violating a U.S. federal law that forbids the minting of a currency by anyone in the U.S. besides the federal government.  Might it be claimed that bitcoins are also a currency and their users or creators violate that same law?

There are many complementary currencies in use around the United States quite openly and without government interference, including BerkShares, Ithaca Dollars and similar hyper-local currencies, various bartering or time swapping systems like LETS or Time Dollars, etc. The case you are referring to revolved around minting coins that could easily be confused with US money and allegedly circulating (and encouraging others to do so) to local businesses while passing them off as US money (by a lie of omission, if nothing else).

It may well be that Bitcoin faces legal challenges in various countries, including the US, but this particular case will have set no precedent in that regard.


Can i still get bcc? I had bitcoin in my blockchain.info wallet when the hard fork happened but I transferred it since to gemini exchange can i still get bch.

Yes. You can recover your private keys from blockchain.info and send BCC coins from them.


How can I configure my miner for two pools simultaneously? I have a single sc 30gh/s miner.
I want to run cgminer as well guminer at a time simultaneously, will there be any difference?

I want to use cgminer to mine at BTCGUILD and guminer for mining at SLUSHPOOL.

You can use the cgminer -c (config option) to add multiple pools and set up quota system to mine a certain percentage on each pool.

From the CGMiner Readme:

"pools" : [
        {
                "url" : "poola:porta",
                "user" : "usernamea",
                "pass" : "passa"
        },
        {
                "quota" : "2;poolb:portb",
                "user" : "usernameb",
                "pass" : "passb"
        }
]

Will assign 2/3 to poolb, and 1/3 to poola.


Generating additional change addresses manually in Electrum So I have an offline wallet created with Electrum. When signing transactions on the cold storage machine, I would like to be able to check that the address I'm sending the change to is actually a change address I own, however since Electrum is offline it's not up-to-date with which addresses have been used, and so the next change address that is used in the transaction hasn't actually been created yet.

For receiving addresses, I was able to manually create these addresses by running:

>> wallet.storage.put('gap_limit', 50)
>> wallet.storage.write()

in the console, which generates 50 rx addresses worth of keys.

However, this only generates receiving addresses, and I have funds in change addresses beyond the 6 that are generated by default. Unfortunately I haven't found how to increase this gap limit for change addresses. I've tried looking through the electrum source but haven't found anything that would let me change this.

I found that in Electrum, you can create additional change addresses by using the console and typing:

for i in range(0, 100): print wallet.create_new_address(True)

where 100 is the number of change addresses to create. The True means a change addresses is created, while False creates a standard receiving address. The problem is solved now :)


Generated new cryptocoin but how to get balance in my account? I have created new Cryptocurrency from litecoin's fork.

And I can connect more than 2 node with successfully.

But How to pull original balance in my wallet?

Let me share screenshot: https://ibb.co/gci8kn

Balance: 0
Unconfirmed: 0
Immature: 120 MIND.

How to transfer amount 120 MIND in original balance?

I did "setgenerate true" from debug window but it increases only Immature amount.

Please let me know about it. It is very important for it.

Coins that are immature mean that you have not mined enough blocks for them to be spendable yet. If you did not change the COINBASE_MATURITY global variable, then you will need to mine 100 blocks before the immature coins become mature and spendable. Of course the process of mining produces new coins, so your immature balance will increase until you have mined 100 blocks.


Dealing with inactive channels What is the best practice to deal with inactive channels?

Do they have an impact on my node's 'reputation' somehow, should I close them after a few days of being inactive?

What happens if channel funding fees are involved?

You should consider the channel inactive, if after 2 weeks, the other channel does not broadcast a channel_update. At this point, you should try to close the channel cooperatively, and if this fails, broadcast the most recent commitment transaction.

If the channel is active, but just not routing payments, then you should try to figure out why that might be the case. Is it due to liquidity issues on the channel itself, or the other party's liquidity issues, or perhaps liquidity issues in your own channels?

For example, if the other party has no other channels, it will only ever route payments that it makes. If you have only one channel, or no liquidity, then you will never route payments other than your own through the channel.

If you feel that the party you're connected to is not maintaining their node and it is negatively affecting you, then you should attempt a cooperative close, and use the funds to open a new channel to a different peer.

As far as I'm aware, the current implementations do not determine the reputation of their peers, except obvious malicious actions which result in blacklisting. It is currently up to you to investigate and determine whether or not peers are useful.

This will likely change in future software updates, when we have more information about how people are routing payments and what is considered good or bad behavior. It would be premature to make too many assumptions at this stage.

When you close a channel, the fees depend on whether it is closed cooperatively or unilaterally. A cooperative close is a regular, small transaction, and the feerate is haggled, until both parties agree on the fee.

In the unilateral close, the fee depends on how many HTLCs are in flight, and the most recent feerate which has been agreed. The base transaction weight is 724 bytes if there are no HTLCs.


Bitcoin without mining - what needs to be implemented I have read this related question - Bitcoin without mining and I am trying to understand the very basics of Bitcoin network and the blockchain.

I wonder, if we take the mining out of Bitcoin, what would we need to implement in order to make it a working system again.

So far, I am aware of these components that rely on mining:

new coin generation - without mining, we would need to implement a new way of introducing new coins to the system
bitcoin mining is used to create and validate blocks which contain transactions that are to be included in the immutable blockchain - so, without mining, we would need to create another system of creating new blocks that all the nodes will accept (i.e. consensus)

My questions are:

Is there anything else that would need to be done? In this question I assume everything else we would like to work like Bitcoin.
What are the alternatives of building blockchain? If we think about Bitcoin as a currency scheme only (and disregard other aspects of having blockchain) - do we really need a chain that stores all the history? Can't we just have accounts and their balances and update them? I.e. what are the other options of solving the double-spend problem besides having a full history in a chain.

Mining is not essential for coin creation. New coin introduction can be tied to new block creation, or be time based. Even if you don't use proof of work, you will still have blocks (even if you don't call them that way anymore; they may be called "database updates"). More interesting however, if you don't use proof of work, you don't even need your own currency (but you still could).

Validation is done by full nodes (the "auditors"). Miners also validate, but it is not their primary function. They do so because otherwise their blocks - which indirectly provides their income - could unknowingly be invalid, and not be accepted by the rest of the ecosystem.

Mining has one and only one purpose: providing a decentralized, permissionless mechanism for determining which version of history to accept, in case there are multiple valid competing versions. These competing versions are inevitable when there is not a single party coordinating their creation. This is because communication speed across the planet is not infinite, so one may create a block without having heard about a competing block elsewhere.

So to answer your question, if we want a block chain without proof of work, the only thing you need to do is replace the criterion for choosing between different versions of history. The simplest is using digital signatures instead of proof of work. There could be a known central party that signs blocks instead of grinding a nonce, and any chain with its signature would be accepted. No more reorgs, electricity and hardware costs, confirmation times, concerns about propagation, ... the system would work better in every way possible, apart from the fact that it now needs a trusted central party who has the right to censor.

This can be extended. Instead of one known central party, there can be multiple. For example, there could be 10 known parties, and every block is required to have a signature from 7 out of those 10. This requires a significant number to conspire, but if they do, they can still censor transactions. In fact, this system is a modern incarnation of Byzantine Fault Tolerance, a distributed consensus system that long predates Bitcoin. The only downside is that there is no recourse when the security assumption (7 out of those 10 are honest) is false. In a proof-of-work setting, one can join the mining landscape in that case, even without telling anyone else.


BTC Transfer from One Exchange Vendor to Other Exchange Vendor It's my first time doing transfer with BTC. I have read from some articles that if you send BTC with low transfer fee it will be stuck in the network and the status is 'unconfirmed'.

I was sending ~0.049 BTC from one merchant to another merchant (BTCMarkets to Binance). I'm not sure how it performs but somehow my transfer was joined with someone else transfer. The other transfer was confirmed but my transfer is still unconfirmed. I also have no idea how to 'control' the transfer fee since I only paid the withdrawal fee from BTCMarkets. Below is the tx for the transfer. The ~0.0049 BTC was my transfer which is still unconfirmed.

https://blockchain.info/tx/e75f48c3fa06de6198fc0fbac0f2a2eadcdd6608ca572757015d45cdba6c1f1a

Can anyone help how to un-stuck or reverse or change the status to 'confirm' for my transfer? Thanks all.

I've marked this as a duplicate of a 'my transaction isn't confirming' question, there is a lot of good info if you look at the answers there.

One additional note: when sending from one exchange to another, you do not decide the fee. The exchange controls the keys that spend the coins, so they will set the fee for you. If you control the keys of your coins yourself, then you can choose the fees when you spend your bitcoins.

Exchanges can choose to 'batch withdrawals', which means they will send multiple withdrawals to customers as a single transaction with multiple outputs. Batching a transaction allows the sender to pay less fees than if each transaction was sent individually.


Implementing events with the bitcoind notifications using PHP Bitcoind has 3 methods

blocknotify=cmd
walletnotify=cmd
alertnotify=cmd

I understand that these 3 command line parameters needs to be used for get notifications from bitcoin daemon. Could someone suggest how it needs to be integrated or communicate with PHP application.

I would recommend that you use blocknotify to execute a CLI PHP script. The script would then use PHP JSON-RPC to call listsinceblock to get the transactions that occurred in the latest block and put them in a MySQL database.


Search for BTC transactions by amount range It is possible to search transactions by amount range using blockchain or other website without having hash,  just by range or exact amount?

Blockchair.com allows for searching by output amount, or transaction total value.


What is the significance of version byte and address checksum in version 1 Bitcoin address Pay to public key hash is used in version 1 bitcoin address. Bitcoin address is calculated by sha-256 -ing the public key followed by ripemd160- ing the result. The result can then be encoded in base 58 after 3 more steps as shown in https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses
Version byte and address checksum are added to the ripemd which yeilds same result without them-

This:
010966776006953D5567439E5E39F86A0D273BEE

And this:
00010966776006953D5567439E5E39F86A0D273BEED61967F6

Yeilds same result when encoded, then
Why is that done?

How could they give the same result? You do RIPEMD160(SHA256(pubkey)). Then you add zero byte 0x0 to this and perform double SHA256. You take the first four bytes and use them as s checksum which means they are control digits which help the wallet determine you didn't misstype the address.

Now you take this whole thing zero-byte+RIPEMD160(SHA256(pubkey))+checksum and you convert it to base58check. Note: zero byte will make the address always start with '1'.

When sender gets a bitcoin address, their wallet converts it from base58check to hex, checks the checksum and removes both the zero-byte and checksum to get RIPEMD160(SHA256(pubkey)). Then it proceeds with scriptPubKey verification.

That's why it is called Pay-to-public-key-hash. Bitcoin address is just a way of encoding a public key hash.


Sites for searching the blockchain? This is a general question, but what's the best way to search the blockchain? Blockchain.info lets you search by address, but it seems to be a side feature instead of its central purpose.

Are there other sites for searching Bitcoin transactions? I want to see all the transactions associated with a single address or to do other arbitrary types of searches?

The term for such a site is block explorer and there are many of them.  Among the top Google hits for "block explorer" are:

http://blockexplorer.com
http://blockchain.info
http://biteasy.com
http://blocktrail.com
http://btc.blockr.io
http://bkchain.org


How do you determine how much money an address has? If you get an address, and have payments sent to you, how are people able to determine how much money you have? What steps do they do to figure this out?

They don't.

You can have as many addresses as you like, and there is little anyone can do to track them all to you.

This means that usually people can know how much money a single address has, but that's pointless, since you can have multiple addresses.


How often does temporary fork occur and how long does it last? I was wondering, how often does temporary forks occur? They appear when there are two different blocks mined based on the same previous block (parent block), but what are chances for that? And if fork occurs, how long does it last (on average)? What is the moment in a chain when side branch gets discarded by the network, or when is the node certain that the branch he continues to mine on is really the longest one (following the longest chain rule)?
Thank you guys!!

Blockchain forks occur when two blocks are found at the same height. Only one of the two chaintips can become part of the best chain. Each full node will consider the first block it saw to be the best block for that height, until proven otherwise by another chaintip accumulating a greater total difficulty (i.e. adding another block). When another chaintip pulls ahead, the node will reorganize to the best chain. The node reverts its current chaintip back to the last shared block and then applies the blocks from the best chain. A blockchain fork is generally resolved whenever a block for the next height is found. The "best chain tip" is always a probabilistic determination, but the confidence quickly rises as more blocks get added (hence the recommendation in the white paper to wait for six confirmations). Nothing prevents a miner to continue mining on a stale chaintip. However, a miner cannot spend the block reward if the block does not become part of the best chain, so in most cases, it is unreasonable to mine on a stale chaintip. A miner with a large portion of the hashrate may try to extend a stale chaintip if they authored the stale block in a selfish-mining attack.
Earlier in Bitcoin's history there were some two dozen cases in which blockchain forks consisted of multiple blocks before a best chain emerged. You can read more about that in What is the longest blockchain fork that has been orphaned to date?. As far as I'm aware, we have not had a multi-block chainfork for multiple years.
If you have access to a Bitcoin Core instance that has been running for a long time, you can get all stale blocks it registered by calling the getchaintips rpc. Obviously, your node might not have seen all stale blocks that have occurred. Any node syncing later, will only download the best chain, and not acquire these stale chain tips.
Stale blocks were a fairly common occurrence in 2013-2015. IIRC, there would usually be one or more per day.
Headers-first sync introduced with Bitcoin Core 0.10.0 significantly reduced that. In 2016 the Fast Internet Bitcoin Relay Engine (fibre) replaced a previous effort (the "Bitcoin Relay Network") to provide a supplementary relay network connecting especially mining entities that directly pushed new blocks to other participants.
The rate of stale blocks further dropped around the time that segwit got activated. Some people surmised back then that some miners had been running old versions of Bitcoin Core, and when segwit activation forced them to update to a segwit-compatible client, they leapfrogged a number of block relay improvements that had been added over the years. Another rumor was that some mining outlets (spending millions on mining hardware!) used micro-computers as their mining controllers which would take a while to validate new blocks, delaying their switch to the latest chaintip.
These days, it's common that the network goes weeks without any stale blocks. BitMEX Research runs a forkmonitor which offers an RSS feed to alert users when stale blocks (and other block related events) occur. Unfortunately, it seems to me that the RSS feeds item list was reset and I was unable to find a list of their history of fork alerts. In lieu of that, let me note that BitMEX Research tweeted on 2020-01-26 that they had seen a stale block at height 614,732 and that this was the first stale block they had registered since 2019-10-16. Searching BitMEX Research's tweets for "stale", since 2020-01-26, they also tweeted about stale blocks on 2020-07-10, 2020-06-09, 2020-03-03, 2020-02-27, and 2020-02-22. Assuming BitMEX research tweeted about each, they have recorded seven stale blocks since 2019-10-16.
Note that the "orphan block chart" provided by blockchain.com appears to be broken.


Can double-spends be automated by malicious custom bitcoin clients? Say a malicious mobile bitcoin client is created, programmed to quickly send two or more double-send transactions whenever a payment is made.

Is this an attack vector we should be concerned of?
What could be done in order protect against such an attack?

What could be done in order protect against such an attack?

Wait for N confirmations before accepting a payment as successful.


What happens if I delete wallet.dat? I have this question, say I have my coins in my local wallet and 1 of 2 things can happen, say I somehow delete the wallet.dat file or some kind of malware deletes the file. I have the password private key to the wallet, would I need the wallet.dat file to recover the bitcoins or could I just recover with the private key to the address? Would I need both?

Since wallet.dat is mostly a collection of private keys, you will simply lose all private keys that you have not duplicated or copied. It also by default stores the next 100 Bitcoin addresses it will give you when you generate a new address as a safety measure.
Bottom line
You will lose the copy of the private keys to addresses you've created or added but you won't destroy them. A backup will save you regardless if wallet.dat exists or not. If you restore wallet.dat from a backup, you:

will not lose past transactions, those are stored by the network, not you.
will not lose ownership of any bitcoins you may have acquired under the private keys you backed up, generating a new one and not creating a backup may result in loss. Keep in mind first 100 addresses are stored in wallet.dat.
will not need to know the address of a public key. Those are derived from the private key mathematically.


How long should confirmation (spendable amount) take? My transaction already has 24 confirmations at blockchain.info, and the transaction is correctly recorded in Multibit.

But there is no "spendable amount".

I've already "Reset Blockchain And Transactions", but to now avail.  I've closed MultiBit and restarted, to no avail.

I'm sure I've have connections (or else the transaction wouldn't have recorded), but I don't know about how to check how many nodes Multibit is connected to, or where to find out, or what to do about it.

I'm new to BitCoin, so I'm here to learn . . .

Is there something else I should be doing?

If you do not see the balance row with 'Spendable' appearing, it is because ALL your bitcoin is spendable. The row is just made invisible in this case.

It's only shown when the total is different (normally when you have incoming bitcoin that hasn't confirmed yet)


Is there a liquidity aggregator service for bitcoins? I would like to check quotes from multiple bitcoin exchanges in a single, aggregated place. Is there such a service or at least something in that direction out there? Or do I have to connect to each and every exchange and get their market data by myself?

Coral Blocks has a free service that provides aggregated liquidity from Coinbase, Coinsetter, Okcoin and LakeBTC. You can get the aggregated book in JSON through the link:

http://www.coralblocks.com:45453/book/BTC-USD

{
    "last updated":     "20151015-21:01:27.551",
    "time zone":        "America/New_York",
    "symbol":           "BTC-USD",
    "exchange":         null,
    "spread":           -0.90,
    "best bid size":        0.07000000,
    "best bid price":       255.87,
    "best ask size":        0.00090000,
    "best ask price":       254.97,

    "bids": [

        [ "OKCN",       0.07000000,     255.87],
        [ "OKCN",       0.07000000,     255.84],
        [ "OKCN",       0.07000000,     255.81],
        ...
    ],

    "asks": [

        [ "LAKE",       0.00090000,     254.97],
        [ "LAKE",       0.06700000,     254.98],
        [ "LAKE",       0.60000000,     254.99],
        ...
    ]
}

You can also get real-time updates through TCP and FIX. More info about the API here:

http://www.coralblocks.com/index.php/2015/10/free-real-time-bitcoin-market-data/

Disclaimer: I am a developer at Coral Blocks.


How would these parameters affect mining and the size and content of the mempool? Q1 and Q2 are theoretical questions to confirm my understanding.  I know doing the following serve little practical purpose.

Q1: If a mining pool were to set blocksonly=1 in their bitcoin.conf, would all blocks created be "empty blocks" (only the coinbase transaction)?

Q2: If a mining pool were to set mempoolminfee very high, would all blocks created be "empty blocks" (only the coinbase transaction) or possibly only a few transactions?

Q3: I can't seem to find the syntax to put mempoolminfee in bitcoin.conf.  Any help appreciated.

Q1: If a mining pool were to set blocksonly=1 in their bitcoin.conf, would all blocks created be "empty blocks" (only the coinbase transaction)?

Yes. The mempool would be empty so the miner would not have any transactions available to add to a block except for their own coinbase transaction.

  Q2: If a mining pool were to set mempoolminfee very high, would all blocks created be "empty blocks" (only the coinbase transaction) or possibly only a few transactions?

Yes.

  Q3: I can't seem to find the syntax to put mempoolminfee in bitcoin.conf. Any help appreciated.

The option to set is actually minrelaytxfee. This is because a node will only add to its mempool something it will relay, so the minimum relay fee is what controls the minimum feerate to be added to the mempool. Note that this is a feerate, not an absolute transactionfee.

The documentation for this option is:

  -minrelaytxfee=<amt>
   Fees (in BTC/kB) smaller than this are considered zero fee for relaying,
   mining and transaction creation (default: 0.00001)


Electron Cash wallet password not working! I downloaded the wallet software from electroncash.org, version 2.9.4. I then transferred some Bitcoins from Coinbase using shapeshift to my new BCH wallet and after a few minutes, saw my tokens alright.

Then 2 days later, when I fired up the software again, my password didn't work!

Can you help me? I got the seed phrase but how do i use it?
When I fire up the software, the only wallet to choose is default_wallet. I also see the password field just below the pull down menu to select my wallet. I also tried entering the seed phrase into the password field.

Try it with the caps locks on. For me it was that the application wasn't telling me that my caps lock was on. Then, on restart, "Wrong password." Etc.


Bitcoin Wallet for Android - permission denied decrypting the wallet backup file using OpenSSL I've followed the advice found on the https://github.com/bitcoin-wallet/bitcoin-wallet/blob/master/wallet/README.recover.md, but I'm having issues decrypted a wallet backup file

When I run below line

openssl enc -d -aes-256-cbc -md md5 -a -in bitcoin-wallet-backup-2017-12-25 > bitcoin-wallet-decrypted-backup

I got below error message

$ openssl enc -d -aes-256-cbc -md md5 -a -in bitcoin-wallet-backup-2017-12-25 > bitcoin-wallet-decrypted-backup
bitcoin-wallet-backup-2017-12-25: Permission denied
140623991867032:error:0200100D:system library:fopen:Permission denied:bss_file.c:398:fopen('bitcoin-wallet-backup-2017-12-25','r')
140623991867032:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:400:

Is there something wrong?

It looks like you don't have the permissions to read the file bitcoin-wallet-backup-2017-12-25. Check your permissions on the file and make sure that your user is allowed to read the file.


Recovered wallet does not contain imported address. How can I recover my funds? I had a few transactions sitting in my imported address and not in my actual wallet (at that time I didn’t know I had to move the funds from the imported address to the main wallet).  I only found out recently when I changed phones  and forgot my login since I didn’t use the blockchain app for a while. I used the 12 word phrase to recover the account and when I regained access, the balance was zero. Now I know that the 12 word phrase does not back up the imported addresses.
What can I do to recover the funds?

What can I do ...

Re-import the addresses

to recover the funds?

Imported addresses are called "watch-only" or "unspendable" addresses.
If you ever had control over the money at these imported addresses you would have had a private-key somewhere for them.
To give your current wallet control over that money (the ability to spend it) - you must either "import" the private key(s) or "sweep" those private keys into your wallet.
Sweeping private keys is usually considered safer than importing private keys for the reasons demonstrated by your question - imported things are not recovered by using a recovery phrase to recreate the wallet.
The recovery phrase only recovers private-keys and addresses that were generated by the original wallet, not things that were imported into it.
If you don't know the private keys for the imported addresses, there are a couple of possibilities depending on where you got those addresses from in the first place:

You have another wallet that contains those keys
Someone tricked you and you never had any Bitcoin money at those watch-only addresses.

Confusion about the nature of imported addresses is something we often see in victims of fraud.


is it available to pay for my multiple inputs at one time? I have a Bitcoin wallet and there is a large number of spendable addresses.
if i make a transaction and there is a multiple inputs which is belonged to me(my wallet),  is it possible to pay a fee by the single address? (Is it possible to pay fees for my other bitcoin addresses?)

Within a bitcoin transaction, there is no specification for 'which address (input) is paying the fee'.

The fee is simply calculated by subtracting the sum of all outputs, from the sum of all inputs. The inputs are consumed entirely, and the newly formed UTXOs specify the exact amount paying each address. Whatever is left over is the fee that miners can claim.


In NXT, what is the difference from Account ID and Account Numeric ID? For NXT, why are there 2 different ways of identifying your NXT account? There is a Account ID and Account Numeric ID.

What was the differences and why was it done like this?

What are advantages/disadvantages from using one or the other?

Starting in software version 1.1.3, the numeric account format has been changed to Reed-Solomon format by default (the account address starting with NXT- ) which provides higher security against typing mistakes. You still can use both address formats, but the new format is recommended.


What is the extraNonce? This question helps identify the various components of the getwork "data" field, but I'm curious where the extraNonce comes from. My hunch is it's the first four bytes of the second half of the data, because I believe this is still part of the Merkle root (and yet, being in the second half of the data, it won't be part of the midstate). Is this correct? And if so, how does one increment the extraNonce, and what does it mean to do so?

Example getwork data:
00000001a10bacc7e639d1c69a01014bc5db6f2604b3477a3f273a4e019a232700000000a5942372cc60477c8a276e59c8f1a3f58654ea2f6c4402bf1b18e48455b5b8f64f10868b1c07475200000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000080020000

Is the extraNonce (in little-endian, I know), 55b5b8f6?

This really helped me understand it:

  A solo miner increments Nonce until it overflows. Then it increments extraNonce and resets Nonce. extraNonce is located in the coinbase transaction, so changing it alters the Merkle root. extraNonce is reset based on the time.


Regarding Mnemonic Code words and salt key My aim is to make a hardware wallet.

I was studying HD wallet generation (BIP 39) and have figured out how things work under the hood, except one thing.

At high level :

  Mnemonic code (128bit or 256 bit) + Salt('mnemonic'+passphrase)
  -----do PBDKF2 (2048 rounds)---> 512 bit seed

Users are requested to back up their mnemonic code. If I am on a Hardware wallet like ledger nano, the passphrase above serves as my password.

  Different passphrase creates different seed.

Now if i want to open the same wallet from anywhere else, theoretically i can do so just from the Mnemonic code(12 or 24 words).

My doubt is will the passphrase have no use if wallet is being opened from third party clients like Greenwallet, greenbitz, breadwallet etc?

To rephrase : How is passphrase consumed by third party wallets if I have generated an account on ledger?

Third Parties should extend your mnemonic phrase with your passphrase else they will get a different wallet with different addresses.

Electrum and some other wallets call the passphrase a "seed extension" or "mnemonic extension".

Third parties should have an option to extend mnemonic phrase with your passphrase, It's a weird idea to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason, many wallets make it possible to encrypt a mnemonic phrase with a password.

Take a look at this open-source project, you can import play around with any mnemonic phrase and extend it with your passphrase and see the changes


creating a hash that starts wtih 9 zeros I am working on a school problem and want to generate a hash starting with 9 zeros, it is assumed to be the first block with only your name and the previous hash is 64 zeros.

Can anybody help me or show me how to mine/create a 9 zero hash?

This exercise is actually a good way to understand proof-of-work. In order solve your problem, you need to pass your input into SHA256 until you get a hash with 9 zeros, there is no other way around it other than brute force. This is because SHA256 is a one-way function which cannot be solved in reverse. As you've already learned, brute forcing will take many guesses. It would be a good exercise to calculate just how many guesses it would take and how fast normal hardware could do this:

Get the target value. Your maximum target is:
000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffff

Divide by ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, which is the maximum value of a 256-bit number. You now have the probability of a single hash solving a block. Or, as you pointed out, you can calculate the probability of getting 9 zeros in a row in base 16 (1/16^9). Using wolframalpha,
target / max256 = 1.46E-11

Take the reciprocal of the probability to get the average number of hashes to solve a block.
1/1.46E-11 = 6.85E10 or
68.5 Billion

Divide the average number of hashes by the hashrate of your hardware (a typical laptop does can maybe do around 100k Hash/sec) to get the average number of seconds required to solve a block.
6.85E10 / 100,000 = 685,000 seconds or just over a week

Nowadays Bitcoin is mined using dedicated hardware (ASICs) that can do terahashes/second and solve this in less than a second, however, they are usually configured to mine on a pool using a specific protocol (e.g. stratum) so it would require either modifying the miner software or the pool software if you wanted to pass in arbitrary data to hash. Since this is a finance class, this is not likely the purpose of the assignment and was probably designed for you to fail to teach a lesson.
Also, here is another resource that might help: Generation Calculator.


Are Namecoins obsolete with the upcoming Bitcoin 0.9? After I have read this article (Smart Property, Colored Coins and Mastercoin) on coindesk I guess that Namecoin is obsolete. I have read the possible use cases for Namecoin and as far as I understand coindesk, it tells that Bitcoin version 0.9 will have the same features.

Difference: Bitcoin will use 80 Bytes of message data where Namecoin will use 520 Bytes.

Is that true, that Bitcoin 0.9 will have the same features Namecoin has?
Will Namecoin still have any special quality compared to Bitcoin, that justifies Namecoins’ continued existence?
Or in other words: Is the low value (compared to Bitcoins) of Namecoins the only advantage over Bitcoins, because messages, notary acts, votings etc. are much cheaper and therefore only affordable with Namecoin?

Well, the fact that it will be possible to implement features similar to Namecoin that it will become obsolete.

Bitcoin is intended as a currency and a payment system, while Namecoin is designed specifically as a DNS provider for .bit domain names.

The fact that Namecoin would be able to handle .com domain names, doesn't mean the currently employed centralised DNS would become obsolete either. (OK, some may argue it does, but Namecoin is not going to replace centralised DNS providers.)

Namecoin is intended for a very specific goal. Be a decentralised DNS for .bit domains. Existing proxy applications exist to map .bit domain names to IP addresses using the Namecoin network. The fact that it would be possible to replace all those programs with an alternative program using Bitcoin makes little sense. Why would a payment system take over the functions of a DNS system?


Installing app on new phone I may have to get a new phone very soon.  When I install Copay on the new phone how do I log in to access my account?  Currently on the phone I have it is permanently logged in.  I see no option to log out.  So again, when I install the app on a new phone how will I get into my account because I have no recorded log info.

You should get out your recovery phrase and install copay on the new phone when they ask you for recovery phrase (usually 12 words) add it and your wallet should work as the old phone.


Can Bitcoins or other coins be transferred back to US dollars? Can Bitcoins be transferred back to US Dollars?

Bitcoin is just like anything else you can own.  You can buy it using any currency that a seller is willing to accept, and you can sell it for any currency you are willing to accept.  You aren't transferring, you are trading.  A bitcoin is always a bitcoin, and a dollar is always a dollar.  You simply need to exchange it with someone.


Bought Bitcoin from ATM, haven't showed up I made two transactions at a BTC ATM, one of around £80, the other of £10. It has now been >3 hours since the transaction was made. However, only the smaller transaction has appeared in my Bitcoin wallet. Blockchain.info shows no unconfirmed payments. So, can anyone advise me on what is going on?

Cheers.

EDIT 1: No changes after half an hour, on TradeBlock, my address has no pending transactions listed, is this significant?

What kind of wallet are you using?  I ask because if you're using a full node (like bitcoin core) then it could be that you need to wait for the latest blocks to finish uploading...or... it could be that the transaction for £80 hasn't had a confirmation yet and we're still waiting for that confirmation before it appears in your mobile wallet.

Using tradeblock (the screenshot) we can see that there's about 1,718 tx still waiting to be confirmed in the queue and that the last block happened 6 minutes ago...I'm guessing that it wasn't in that full Bitfury Block there so it's likely still waiting to be confirmed.

Final edit:  Electrum is an spv wallet, likely you're waiting for a confirmation as it should download the block headers pretty much instantly.

Do this...close Electrum...then reopen it..I don't expect your balance to update but maybe it will (if there's some sort of bug or network timeout issue happening)...from there...give it about another 30 or so mins for it to be included in the next block...this happens because sometimes bitcoin ATMs send non-standard trx and the fee is low (compared to free market).  I believe the recommended fee is approximately 10 satoshis per byte and we see the average fee is about 14 in the pic above.  Taking my comments into consideration - don't worry about the coin being lost it should still hit your address balance.  The worst case scenario is this:  in 72 hours if the coin fails to route then the ATMs wallet gets the coin back - you would be able to reference the failed transaction with the atm operator to get your money back or request them to send the coin with a higher fee so it confirms faster.


i need help getting my bitcoin back from an address i sent my bitcoin to another address i generated from another site not knowing they have a policy that if the bitcoin is not up to 0.005 it wont be able to reflect. now my question is that would my bitcoin be return to my account

A bitcoin address represents a public key.  When you generated the address, did you also get or write down the corresponding private key?

If you have this private key, you can import it into any bitcoin wallet and you'll be able to return the BTC to the old address.  In fact you'll be able to send the BTC anywhere you want to.


Split BIP39 words by hand I'm thinking about a way to split the bip39 words (by hand) and I would like to have some opinions on it.
The aim is to store the word list in several locations, I came with something inspired by one-time-pads.
Example with a 6 words list: wrist orient foil naive shock predict
Step 1: convert the words with their numeric index
Words (W):
1: wrist   -> 2035
2: orient  -> 1252
3: foil    -> 723
4: naive   -> 1173
5: shock   -> 1586
6: predict -> 1357

Step 2: Prepare two sets, each half filled with random numbers between [0; 2047]
Set 1 (S1):
1:
2:
3:
4: random -> 1050
5: random -> 1779
6: random -> 556

Set 2 (S1):
1: random -> 1889
2: random -> 1074
3: random -> 914
4:
5:
6:

Step 3: fill the missing values of each set in order that S1[i] + S2[i] = W[i]
Set 1 (S1):
1: (2048 + W[1] - S2[1]) % 2048 -> (2048 + (wrist=2035) - 1889) % 2048 -> 146
2: (2048 + W[2] - S2[2]) % 2048 -> (2048 + (orient=1252) - 1074) % 2048 -> 178
3: (2048 + W[3] - S2[3]) % 2048 -> (2048 + (foil=723) - 914) % 2048 -> 1857
4: random -> 1050
5: random -> 1779
6: random -> 556

Set 2 (S2):
1: random -> 1889
2: random -> 1074
3: random -> 914
4: (2048 + W[4] - S1[4]) % 2048 -> (2048 + (naive=1173) - 1050) % 2048 -> 123
5: (2048 + W[5] - S1[5]) % 2048 -> (2048 + (shock=1586) - 1779) % 2048 -> 1855
6: (2048 + W[6] - S1[6]) % 2048 -> (2048 + (predict=1357) - 556) % 2048 -> 801

Step 4: write words of the sets with the values as word index
Set 1 (S1):
1: 146 -> banana
2: 178 -> bike
3: 1857 -> trend
4: random -> 1050 -> lobster
5: random -> 1779 -> tattoo
6: random -> 556 -> earth

Set 2 (S2):
1: random -> 1889 -> ugly
2: random -> 1074 -> mail
3: random -> 914 -> impulse
4: 123 -> aunt
5: 1855 -> treat
6: 801 -> goat

Advantages:

You ends up with two sets that looks like valid bip39 words (except for checksums).
You can do this with 2 or more sets.
One (ore more) leaking set does not compromise the private key at all (as long as at least one is kept secret, words are safe).
In case someone asks (if you are physically threatened) you can give the robber your 1/n part of the key, or plausibly says that you misswritten your words (bad checksum), you cannot find back the key at the moment anyway (other parts are located elsewhere).

To find back the words, you simply have to sum each set:
Words (W):
1: S1[1] + S2[1] -> (146 + 1889) % 2048 -> 2035 -> wrist
2: S1[2] + S2[2] -> (178 + 1074) % 2048  -> 1252 -> orient
3: S1[3] + S2[3] -> (1857 + 914) % 2048  -> 723 -> foil
4: S1[4] + S2[4] -> (1050 + 123) % 2048  -> 1173 -> naive
5: S1[5] + S2[5] -> (1779 + 1855) % 2048  -> 1586 -> shock
6: S1[6] + S2[6] -> (556 + 801) % 2048  -> 1357 -> predict

I'd like to know if someone sees any problem or a better solution for this case.

Best practice is not to split up your seed words.
There are many different clever ways one can store their bitcoin back-ups and the way you described might be one of those ways. It may work for you and that's great, but it isn't an approach that would be generally recommended or accepted.

The aim is to store the word list in several locations

Generally, it is recommended to use multisig if you want to split up any sensitive data that will be used to sign a transaction.
Alternatively, you can add a BIP39 passphrase that could be stored separately from your seed words.


I want to know how I can express a phenomenon found in Merkle Trees mathematically I want to know how I can express a phenomenon found in Merkle Trees mathematically. If I want to figure out which leaf node in a Merkle Tree has changed I can look at the authentication path to figure it out. Let's say there is one leaf node and one root node. If the root node changes you don't have to look at any other nodes (0) to determine which leaf node must have changed. In Figure 2 there is a 0 across from 1. If there are 2 leaf nodes and the Merkle  Root changes you only have to look at 1 node to determine which leaf node must have changed. As we increase the number of leaf nodes there is a relationship that exists with the total number of nodes you need to look at. I was wondering if there was a way I could express this mathematically in a clean way. Thanks!

Figure 1.

2*0 = 0  (1 zero)

2^0 = 1  (1 one)

2^1 = 2  (2 twos)

2^2 = 4  (4 threes)

2^3 = 8  (8 fours)

2^4 = 16 (16 fives)

2^5 = 32 (32 sixes)

2^6 = 64 (64 sevens)

Figure 2.

Leaf (Left Column)   &   Total Nodes (Right Column)
1         0

2         1

3         2

4         2

5         3

6         3

7         3

8         3

9         4

10        4

11        4

12        4

13        4

14        4

15        4

16        4

17        5

18        5

19        5

20        5

21        5

22        5

23        5

24        5

25        5

26        5

27        5

28        5

29        5

30        5

31        5

32        5

33        6

34        6

35        6

36        6

37        6

38        6

39        6

40        6

41        6

42        6

43        6

44        6

45        6

46        6

47        6

48        6

49        6

50        6

51        6

52        6

53        6

54        6

55        6

56        6

57        6

58        6

59        6

60        6

61        6

62        6

63        6

64        6

65        7

66        7

67        7

68        7

69        7

70        7

71        7

72        7

73        7

74        7

75        7

76        7

77        7

78        7

79        7

80        7

81        7

82        7

83        7

84        7

85        7

86        7

87        7

88        7

89        7

90        7

91        7

92        7

93        7

94        7

95        7

96        7

97        7

98        7

99        7

100       7

101       7

102       7

103       7

104       7

105       7

106       7

107       7

108       7

109       7

110       7

111       7

112       7

113       7

114       7

115       7

116       7

117       7

118       7

119       7

120       7

121       7

122       7

123       7

124       7

125       7

126       7

127       7

128       7


API to send bitcoins from paper/cold wallet? I am making a program which will take a .wif private key, and send all funds from the wallet represented by the key to a certain address. I need this to be fully automated, but I can't seem to find any simple API which can send from a .wif. Thanks!

You can just do it yourself instead of having to send a 3rd party your private keys. Here's one that I wrote using nodejs and bitcore-lib that takes a WIF and sends all funds to a different address.

https://github.com/coinables/sweepkey/blob/master/app.js


Question about nSequence with regard to bip-0112 and bip-0068 So far my understanding is that when you create an op_csv output the value entered before the OP_NOP3 is an arbitary number, lets say 10.
This number can be interpreted as block based of time based depending on the nSequence value set when spending (according to bip-0068).

What I am confused about is the following, say my first transaction has a redeem script as follows

10
OP_NOP3,
OP_DROP,
alicePubKey,
OP_CHECKSIG

Does this mean that the spender, who sets the nSequence type flag (1<<22) to either on or off whilst creating the spend transaction, effectively has the ability to decide whether the 10 is interpreted as block based or time based?

It seems the granularity of the time based option is 512 seconds, so close to an average block time.

Thanks

So turns out the sender has to set the same number in the nSequence that is in the script. In the case above 10 will be interpreted as 10 blocks because I was using bitcoinJS lib which converts the decimal 10 to a 32 bit integer which would be

00000000000000000000000000001010

according to bip68 https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki

the last 16 bits is the value i.e. 10 in binary signed twos compliment is
0000000000001010

the first 16 bits represents the flags, so as they are all 0s it means the disable flag is set to off and the type flag is set to off which means the number is interpreted as blocks

however if I did this

00000000010000000000000000001010

it would be interpreted as time span, i.e. 10 * 512 seconds

for anybody like me who needs to stop thinking in terms of decimal/ints and start using 32 uint and thinking in bits/bitshift operations etc
there's a handy bitcoin-js lib which will convert it for you

https://github.com/bitcoinjs/bip68


How to check BTC transaction when buying face to face? I have never bought bitcoins face to face. Don't have iphone/ipad and therefore I would need answers on the following question:

What do I need to have on my cell phone in order to provide seller my bitcoin address AND to be able to check whether or not he/she really sent bitcoins to me before we say BYE to each other. I would like to avoid requesting to rewrite bitcoin address from physical paper because mistakes could occur. In this question I am asking how to provide him my bitcoin address in easiest and most useful possible way, and I am also asking how to check that I really got my bitcoins. I have old Samsung cellphone and probably (at least i hope so) its not everything about QR code - my cellphone doesn't support it.

Assuming that I don't want to bring my laptop with me (additional safety reasons as I don't know with who I am dealing - you never know what kind of person he/she is), assuming that I don't have iphone/ipad and assuming I don't want to use public computer, is there any fifth (fourth is usage of cellphone) way how to do this?

I checked the following two links but neither of them helped:

How to check if user sent me the BTC?

How do I buy Bitcoins safely face-to-face?

Does your cellphone have a web browser? There's many good web wallets (such as https://greenaddress.it/en/) which would allow you to simply open it in a web browser. If you don't have QR code capabilities, then your only resort is to have him/her write your bitcoin address, character by character. Once (s)he's sent the bitcoins, your web wallet will alert you that it's arrived and you're good to go. You must of course have an internet connection on your phone.

PS: if it's a large amount of money you're transferring, you should probably wait 10 mins or so to get at least 1 confirmation.


How can we be sure that Open Coin would not create more than 100 billion XRP? ripple server code is still private and beta.

There is no legality preventing Open Coin to print more XRP now as it is a private company and the network is not at a stage where it is wide scale distributed like bitcoin for consensus process to have any meaning in this aspect.

Doing so would subject OpenCoin to lawsuits due to promissory estoppel. OpenCoin's statement that they will not do so is effectively a warranty. And, of course, it would be a completely self-destructive thing for them to do.

(I am an employee of OpenCoin, speaking only for myself.)


High level description of modern Lightning network (as per BOLT) The Lightning network specification (BOLT) differs substantially from the original Lightning network paper (some of the differences outlined in this SE answer). Is there a document with a high-level technical description of the Lightning network as per BOLT? The problem I'm facing is that BOLT is a bit overwhelming, I'd like to see concepts introduced step by step (e.g., types of transactions used, the overall mechanics, etc) before the implementation details.

There is an article series on medium by rusty Russell (one of the main authors of the BOLTs)

The first part can be found at https://medium.com/@rusty_lightning/the-bitcoin-lightning-spec-part-1-8-a7720fb1b4da and the succeeding parts are linked from there.

This article series is from late 2016 and also somewhat outdated.

I recently started to write a book about the lightning network at https://github.com/renepickhardt/The-Lightning-Network-Book the goal is to bridge the gap. But the book has not arrived at describing the BOLTs yet.

On a extremely high level I can tell you that the BOLTs have several components :

the peer 2 peer protocol ( messages and gossip)
the transport protocol (onion routing and SPHINX)
construction of payment channels via RSMCs
transactions (RSMCs and HTLCs)
payment process via invoices

While the structure of the BOLTs is clear they still seem to be entangled among these topics and indeed a high level overview or "architecture" seems to be missing. For example I had a hard time understanding that the transport layer and the HTLCs are two very different things. Stuff like the gossip protocol and the transport layer are pretty much not mentioned in the white paper


Bittrex API OpenBuyOrders OpenSellOrders - what do they actually show? e.g. https://bittrex.com/api/v1.1/public/getmarketsummary?market=btc-bcc

shows:

{..."OpenBuyOrders":1557,"OpenSellOrders":13944,...}

What do these numbers refer to since they do not match the BTC or BCC bid and ask volume values on the bittrex screen when looking at this pair.

Any ideas what these two values are showing? I need to know the total number of bid and ask BTC volumes via the API calls? Thanks

The Bittrex API documentation doesn't divulge many details but I expect those two values would be all outstanding (open) buy and sell offers, not just for that day.

You may need to contact Bittrex for further clarification.


What does the value of bitcoins depend on? I've been looking up stuff about bitcoins for some time now and i have two question stuck in my mind:

How is the value of bitcoins so unstable?

And can there be bitcoin inflation?

The value is unstable because it's a small and speculative market.

People don't really understand what bitcoin is and they can be lead to believe many things.


Setup a full node on server for frond end Wallet I am a new in bitcoin technologies. I want to setup a full node on cloud server. Also I need to use RPC of this server for front end app.That is creating bitcoin wallet and its further operations(such as send and receive). My question is

Is suitable to use own full node cloud server for front end wallet app(Like PHP web app) ...?

Thanks in advance.

Yes, but a few important points.

Don't forget to enable txindex, it will allow you to query your node for all transactions.
Don't use the RPC API on the front end. RPC is needed to make transactions, but it might allow others to withdraw your coins. Keep the RPC in the back end.
The HTTP REST API is suitable for front end use.
Don't keep your funds on a client on a cloud server unless you trust them.
The front end shouldn't contact the node to make transactions or handle the private keys, instead, you should use BitcoinJS or Bitcore-lib to create transactions on the front end.


Why are Sphinx forward messages not used in Lightning's onion packets? It is useful to send some additional information with a payment in LN. For example, spontaneous payments in LND send a payment_preimage to the destination of a payment. LND uses a non-trivial EOB format to try and encode this information into the hops_data. The hops_data must be a fixed size to prevent intermediary nodes knowing where they are in a route, which limits the size of information which can be forwarded.

The Sphinx protocol on which LN's onion routing is based already supports forwarding encrypted messages as a separate field. The notation (M,δ) is used for an onion message, where the M corresponds to the onion_packet format in BOLT4. δ is the encrypted payload, which can be of arbitrary size, and is not used.

Would it not make more sense to utilize this message forwarding rather than trying to overcomplicate the protocol with the EOB format, which gains us a trivial number of bytes?

I can see that arbitrary size may be an issue for an attacker monitoring traffic flows. Perhaps δ can be made a fixed size and padded such that each update_add_htlc_with_payload remains a fixed size. We could potentially transfer larger and more useful information to the destination (in particular, I would like to be able to embed a refund invoice in the payment).

Are there any other issues with forwarding a separate encrypted payload which I'm unaware of?

Questions like these are always leading to an opinionated response and are a little bit tough to answer. I will give it a shot though.

First of all I think youelf already answered your question to an important degree. Forwarding messages via the SPHINX protocol yield the possibility of message length attacks.

I think Another reason was the goal to be simple in the beginning. I know there is a lot of discussion to extend onion routing to HORNET which would create a connection oriented encrypted communication layer on top of the lightning network and routing protocol. This obviously yield some advantages but also complexity and possibilities to introduce exploits.
Let us remember that sphinx mix format was created to send and receive messages / emails and we "abuse" it for lightning. So I guess we liked at the core feature we needed.

I think the main reason for using the EOB field in spontaneous payments is that it was easy to implement this in the current system without too many changes. But to be sure roasbeef might give the exact reason.