Is bitcoin running over a structured or unstructured overlay? How nodes are being admitted to the system? Does each node have a sequential unique address?

In other words, are bitcoin nodes considered structured or unstructured?

Bitcoin uses an unstructured network.

The primary reason a network might opt for a structured system is to allow systemic retrieval of information. This is not necessary in Bitcoin, since each node maintains the same information.

Bitcoin does not, however, employ the flooding technique at the start. It uses a set of DNS seeds to get an initial node list, and connects to nodes from that list, before asking them for additional peers. This prevents the bandwidth issues associated with flooding, while maintaining a reasonably decentralized discovery method.

Note that even if all the DNS seeds ceased to exist, new nodes could connect by connecting to any existing node, and then asking for a peer list, and cascading down the peers' peers. In the based, IRC channels were also used for node IP discovery, which again shows how the system can remain functional without the DNS seeds.


What's the maximum size of the memo in a LN payment request? What is the maximum size of text held in the memo portion of a lightning network payment request?

The memo field can hold 639 bytes of information.

But how many characters? Let's assume utf8 (since lncli encodes the text in utf8)

utf8's characters are variable length, meaning some are larger than others.

From stackoverflow:

  The first 128 characters (US-ASCII) need one byte.

  The next 1,920 characters need two bytes to encode. This covers the
  remainder of almost all Latin alphabets, and also Greek, Cyrillic,
  Coptic, Armenian, Hebrew, Arabic, Syriac and Tāna alphabets, as well
  as Combining Diacritical Marks.

  Three bytes are needed for characters in the rest of the Basic
  Multilingual Plane, which contains virtually all characters in common
  use[12] including most Chinese, Japanese and Korean [CJK] characters.

  Four bytes are needed for characters in the other planes of Unicode,
  which include less common CJK characters, various historic scripts,
  mathematical symbols, and emoji (pictographic symbols).

For the US-ASCII character set and onward:

639 bytes / (1 byte / 1 char) = 639 characters

639 bytes / (2 byte / 1 char) = 319 characters

639 bytes / (3 byte / 1 char) = 213 characters

639 bytes / (4 byte / 1 char) = 159 characters


Can a clever hacker still steal everyone's money from the blockchain.info wallet? Blockchain.info claims:

  We cannot (and don't want to):

  View your balance
  View your address book
  Make transactions on your behalf
  Confiscate your wallet
  Lock you into our service.

They do this by only storing the encrypted wallet file containing the private keys, and letting the web client do the decryption and signing using the private keys without ever communicating them using the server. This means it is indeed true that the blockchain.info can't make transactions on your behalf.

I used to think this also meant that, if a hacker broke into their servers, they would not be able to steal everybody's bitcoins, because the private keys are not stored there.

However, now I'm not so sure. Couldn't the hacker simply change the server code to send javascript to the web client which, when executes, decrypts those private keys and sends them back to the (now-hacked) server?

It would take longer, as everyone would have to sign in to be compromised... but they'd still be able to steal a bunch of Bitcoins.

Am I missing something or is this indeed the current state of affairs with blockchain.info?

(Note this is not meant to be a dig at this particular website; it's really more of a security question in general.)

They anticipated this type of attack and they are monitoring their JavaScript files, check this website of theirs http://blockchain-status.com/javascript_verifier

Also, CloudFlare (the reverse proxy they use) can modify the Javascript on the fly (CloudFlare is at the other end of the encryption for your browser, so SSL here only secures the connection between you and the CloudFlare machines, and optionally CloudFlare to Blockchain.info, you're not directly connecting to Blockchain)

It is true that the client-side script does not send the password to the server but you actually need to send your wallet password to use their old wallet API (it's being deprecated) and if a hacker can somehow control their servers, it is possible that the hackers can read the unencrypted wallet from the memory without having to inject malicious client scripts, even if we assume they are not saving them to the disk.


Is there a website that tracks Bitcoin taxes paid to local government? One thing that would further legitimize Bitcoin with government oversight is the payment of relevant taxes to Federal and State government (in local equivalent currency) for e-commerce and mining activities.

To this end, I think it would be good to highlight the legitimate business models, and how much tax revenue those companies are bringing to their community. One way this could happen is to have a website of sorts that details the tax paid on the transactions and/or mining.  Perhaps this could be detailed on a per country basis.

Is there any effort underway that is attempting this?
If not, what are some possible ways to publicize the taxes paid to each local government?

I think it would be fantastic if my tax jurisdiction were to accept payment in bitcoins.  Every additional way bitcoins can be used adds to bitcoin's value -- it accelerates the network effect.

When they do begin accepting bitcoins, each jurisdiction could be asked to supply the totals (via FOIA request, at a minimum).  Some organization or individual could then take that data and compile a report.

But expect this to occur long, long after bitcoin is "legitimized", as you describe it, and not before.


What if I backup my wallet from a client that is not fully synced with the blockchain? I've just backed up an encrypted wallet, but the client (Bitcoin-Qt) is 26 weeks behind.

During these last 26 weeks this wallet has only received BTC (roughly one transaction per day), no payments were made from it.

I have a few questions:

(1) If I install a new client on a new machine, import wallet from this backup, and then let the new client fully sync with the blockchain, will I have access to the BTC received during the last 26 weeks, or these funds (or some them) will have been lost?

(2) I have run the keypoololdest, which returns May 10th 2014; I assume this is the date of the oldest unused key in the pool. The last outbound payment from this wallet was in May 2014, about a week after the keypoololdtest date.

The date which is 26 weeks behind today is Jan 29th 2015, which is 264 days after the keypoololdtest date.

Could someone please shed some light on what's going on here?

(3) Are keypool keys only used on outbound transactions (to receive change), or each inbound payment also uses up a key?

Thanks in advance!

1) Yes. You will have access to your funds. Every wallet.dat stores the "best block" (~newest block the wallet was synced with). When you start a bitcoin-core together with your old wallet.dat it will automatically rescan for wallet transaction down to the "best block" stored in the wallet.dat.
If you funds are not available, try starting bitcoin-core with the -rescan argument.

2)3) A keypool does contain pre generated keys. The keypoololdest is a timestamp of the oldest (unused) key in your keypool. If you have not generated addresses (also happened when you send funds; change address!), this timestamp can be really old and doesn't matter in your case.


Is it normal to get 60 confirmations for a transaction in blockchain Is it normal to get 60 confirmations for a transaction in blockchain and still it is not received and confirmed, can you help I m worrying as this is my first transaction, did I forget anything

Confirmations never stop. Confirmations is simply the number of blocks that have been mined on top of the block that contains your transaction. It will keep incrementing as long as blocks are being mined.

  Is it normal to get 60 confirmations for a transaction in blockchain and still it is not received and confirmed

All wallets I'm aware of show even unconfirmed transactions, and definitely show confirmed transactions with even 1 confirmation. If your wallet is not showing the transaction you are:

Connected to a node that is not fully synced for a light wallet.
Using a wallet that is attempting to scam you
Behind some kind of internet restricting proxy or firewall that prevents a wallet from communicating with nodes
Using a Bitcoin full node directly that is not fully synced.


Can I sell items on Etsy using Bitcoin? What is the correct way for an Etsy shop owner to sell their items using bitcoin? Does Etsy even allow it? Will they freeze my account?

Etsy merchants that accept bitcoin have been tagging their shop items with 'bitcoin' so that a simple search shows what is available:
http://www.etsy.com/search?q=bitcoin

An email to support@etsy.com got this response about being allowed to use bitcoin:

"If you would like and are able to support a third party payment system, you are welcome to use another payment service."

They also included instructions for how to setup your cart so that people can easily pay:

"To do that, click Your Shop > Shipping & Payment > Payment Methods. Select 'Other' as a method. Then, indicate which service you use in your Shop Announcement, listings and/or Policy Page. After the buyer has purchased an item using 'Other,' you can contact them with instructions and/or an invoice so they can pay through your preferred method."

Enable the 3rd party 'Other' checkout option, and when someone orders an item you can send them your bitcoin payment address.

You can also join the Etsy Team Bitcoin page, and there is Discussion threads for you to ask questions. The team page has information on the different bitcoin wallets you can use such as coinbase.com or downloading the reference bitcoin client from bitcoin.org.
http://www.etsy.com/teams/10366/bitcoin


How to recover wallet by importing private key on testnet? I want to test the functionality of wallet recovery via private key import on the testnet. Preferably thru an online service.

I only want to test the functionality so that I can verify that it's basically working since I'm working on some Python code that I want to use on the mainnet later.

So for that, I don't want to download the whole blockchain but instead, want to verify that my private key is generated correctly and I can access the funds that way. But I can't find any possibility to do that on testnet...

EDIT: I did not use mainnet for anything yet. I'm exclusively used testnet to create the wallet and get some coins and want to verify on testnet the wallet recovery thru private key

Testnet uses a different address format than mainnet, you can not view or verifying anything about the mainnet on testnet, they are separate.

You can test your method from the origin by using testnet funds instead.

Alternatively, you can test on mainnet with a small amount of funds to confirm your recovery method is working the same as it did on testnet (which it should).


Is there a way to initiate a payment request in bitcoin? I'm writing a recurring billing system and I want to be able to contact a customer and request a certain amount of money. Is this possible via bitcoin?

If not, could a URL be provided the customer so he can simply click it and it opens the bitcoin app and initiates a payment process?

You can now use the Bitcoin payment protocol to do this.

Here is an easy to use implementation from Bitpay.

There are already a few wallets that support this (including the reference client).  More will be released soon.

See:

BIP 70
BIP 71
BIP 72
BIP 73


How to test if a transaction is standard without spending real money? The problem with Testnet is all types of transactions are allowed, so how can I know if a transaction would be rejected on mainet ?

You can use Bitcoin Core's testmempoolaccept RPC. It will tell you whether the transaction you give it would be accepted into your node's mempool at that time but won't actually add it to the mempool or broadcast it.


Sending bitcoins with armoryd fails What is the correct process to send bitcoins using only armoryd? I'm using Armory 0.93.3 on MacOs Sierra.

I have Bitcoin Core 0.14.1 and another instance of armoryd running and up to date.
Here's what I figured out so far:

$ ./armoryd getarmorydinfo
{
     ...
     "versionstr": "0.93.3",
     ...
}
$ ./armoryd createustxtoaddress <address> 0.001 0.0001 > test.txt
$ cat test.txt
=====TXSIGCOLLECT-XxXxXxXx======================================
...
$ ./armoryd walletpassphrase <passphrase> 100
Wallet XXXXXXX has been unlocked.
$ ./armoryd signasciitransaction test.txt > test.txt.sig
$ cat test.txt.sig
=====TXSIGCOLLECT-XxXxXxXx======================================
...
$ ./armoryd sendasciitransaction test.txt.sig
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

However, the transaction doesn't show up on blockexplorers. What am I missing?

In order to use Bitcoin Core 0.14.0+ with Armory, you need to have Armory 0.96. Since you are using Armory 0.93.3, you will need to use Bitcoin Core 0.13.2 or earlier. Also keep in mind the armoryd has not been maintained for the past couple of versions so it may not work if you use Armory 0.94+.


What is "Script Hash" address exactly and how does it work? I found out this address playing with blockchain

https://blockchain.info/address/3NukJ6fYZJ5Kk8bPjycAnruZkE5Q7UW7i8

I found out it's something called "scripthash". How does it work exactly? How does it differ from a normal address?

I found out this - https://en.bitcoin.it/wiki/BIP_0016 - but I still don't get it and I don't get the point.

  The benefit is allowing a sender to fund any arbitrary transaction, no matter how complicated, using a fixed-length 20-byte hash that is short enough to scan from a QR code or easily copied and pasted.

How does it differ from what is possible today - scanning just the address of the reciever?

edit: And adding one more question - why exactly is this transaction with the mentioned address as input

https://blockchain.info/tx-index/3618498

included in 94 different blocks? How does that even work?

The P2SH, as defined in BIP 16, states that

  The purpose of pay-to-script-hash is to move the responsibility for
  supplying the conditions to redeem a transaction from the sender of
  the funds to the redeemer.

  The benefit is allowing a sender to fund
  any arbitrary transaction, no matter how complicated, using a
  fixed-length 20-byte hash that is short enough to scan from a QR code
  or easily copied and pasted.

Hence it allows any client implementation to fund a transaction with an arbitrary script, without the client necessarily having to understand it. You see, there are some quite complicated possibilities for transactions to state their claiming conditions, which may put different implementations of clients under a dilemma: each time a new script type surfaces they'd have to implement it so that the client can send transactions that make use of them.

P2SH has the advantage that the client does not necessarily have to know how to build such a script, it just has to know how (given an arbitrary script, or indeed its hash) building a script that first verifies the script and then uses that script to verify the claim itself works.

Suddenly, if I provide you with a hash of a claiming condition (script) you can send me bitcoins without actually having to know what security mechanisms I put in place to secure that only I can then spend them.

As an added bonus it really keeps the addresses small (25 byte script) which can easily be displayed in a QR code or may even be typed by hand.

The reason transaction 4005d6be is included in so many blocks is all of those blocks are orphaned, so the miners that included them supported a version of P2SH but never got a majority. The fact that this transaction is still unconfirmed is probably due to it being not a true P2SH script.


If I were executing a 51% attack, would I be broadcasting my state of the network to nodes? In the scenario where an entity has control of greater than 51% of the hash power and wishes to build a longer chain where they double-spend previously confirmed transactions, do they broadcast the chain to the network as they are working on it?

The alternative scenario I see is the entity working on the chain and only broadcasting it to full nodes at the point where it has overtaken what is believed to be the current longest chain. This second scenario would appear to me to be far more damaging to confidence in Bitcoin if it was pulled off. Technically, are both these scenarios possible?

Yes, both scenarios are possible.  The validity of a block is determined solely by its contents, not by when it is broadcast or received, so the attacker's longer chain is equally valid whether they broadcast it as they go, or all at once.

(There is an exception to this principle on testnet because of the 20-minute rule, but that's not relevant here.)


Blockchain long run issue the last days I have thinking about the bitcoins and the technical issues that can have this currency, I am a computer science guy, with many interest in the global economy.

The first question that I want to ask is about the blockchain, the file that store all the transactions done in the network, the problem is that the current size of this file is about 7 GB, with only 100.000 bitcoin accounts, something insignificant to the global economy, still insignificant for a little country of third world.

What will happen when exists 10 , 100 or worse 1000 million of accounts, what will be the size of the blockchain file?.

If this file grow and grow this is not problem for the current tecnology, is more a problem againts the philosopy of bitcoin, because not all the people could be have the file in their own computers, then in the long run the system will tend to transform in something centralized, where only some organizations or very rich people would have a copy of the blockchain file, and the system will be more susceptible to be shut down if some power entity decides to do that.

What do you think about?, is like I am thinking? or am I missing some one about the design of bitcoin?.

Thank for your answers.

This is explained in Satoshi's original paper:

Basically, the block hash does not contain the hashes of the individual transactions, rather it contains the root of the Merkle tree of the hashes. Once all the bitcoin outputs of a transaction have been fully spent, then there is no need for the original transaction, and hence its branch is chopped off from the Merkle tree. As time passes, all the branches get chopped off and one is left with just the root.

So, let's say someone gives you 1 BTC in transaction A (which has no other outputs). You give it away in transaction B to someone else. After a few more blocks have been generated, I have no reason to doubt that transaction B is valid and since A cannot be referenced anywhere else (it is already spent), it is safe for me to remove A from my blockchain.

Of course, some entities may keep the entire chain but this is not strictly necessary for bitcoin to work.


Bitcoin-QT issues with non standard filesystem I'm having issues with blockchain catchup that I believe to be related to the underlying file system.

Symptoms: Significantly behind the network, start client and begin catchup. Catchup proceeds for 1-2GB then halts. CPU usage is 0 for the process, but it holds 500MB-1GB RAM allocated. 0 connections. Console commands receive no response, so crashed process? If I restart the client it will proceed again for a similar length of time, then repeat the behaviour.

Last run:

BOOT AT: ~353355
STUCK AT: 359430

Logs show many of these errors:

2015-11-21 03:39:26 ERROR: AcceptToMemoryPool : nonstandard transaction: non-final

End of log:

2015-11-21 04:03:10 UpdateTip: new best=0000000000000000041ca40bdec7946dc4105fea0cefb26ea7fb8914880fe089  height=359623  log2_work=82.893042  tx=71115044  date=2015-06-06 04:15:15 progress=0.806010
2015-11-21 04:03:14 UpdateTip: new best=0000000000000000028104e61aabd1b31bd0a136c33daecdd92165126aeb7ce1  height=359624  log2_work=82.893074  tx=71115578  date=2015-06-06 04:29:37 progress=0.806021
2015-11-21 04:03:15 UpdateTip: new best=00000000000000000b0c4437cd594ae56bb6dc532c497af9b595b653311345f5  height=359625  log2_work=82.893107  tx=71115639  date=2015-06-06 04:26:21 progress=0.806019
2015-11-21 04:03:26 Pre-allocating up to position 0xd00000 in rev00278.dat
2015-11-21 04:11:27 UPnP Port Mapping successful.
2015-11-21 04:31:27 UPnP Port Mapping successful.
2015-11-21 04:51:27 UPnP Port Mapping successful.
2015-11-21 05:07:26 socket inactivity timeout
2015-11-21 05:09:30 socket inactivity timeout
2015-11-21 05:11:27 UPnP Port Mapping successful.
2015-11-21 05:31:27 UPnP Port Mapping successful.
2015-11-21 05:51:27 UPnP Port Mapping successful.
2015-11-21 06:11:27 UPnP Port Mapping successful.
2015-11-21 06:31:27 UPnP Port Mapping successful.
2015-11-21 06:51:27 UPnP Port Mapping successful.
2015-11-21 07:11:27 UPnP Port Mapping successful.
2015-11-21 07:31:27 UPnP Port Mapping successful.
2015-11-21 07:51:27 UPnP Port Mapping successful.
2015-11-21 08:11:27 UPnP Port Mapping successful.
2015-11-21 08:31:27 UPnP Port Mapping successful.
2015-11-21 08:51:28 UPnP Port Mapping successful.
2015-11-21 09:11:28 UPnP Port Mapping successful.
2015-11-21 09:31:28 UPnP Port Mapping successful.

This seems to happen on my Flexraid disk array(Snapshot RAID) that appears to the OS (2008R2) as a regular NTFS 8TB volume but not on a regular 160GB backup drive. I've seen issues once before when an application attempted to create many files at once, this was resolve by tweaking that applications write caching.

Any suggestions for tweaks to allow stable disk IO?

EDIT: Forgot client info

"version" : 90300, v0.9.3.0-g40d2041-beta
"protocolversion" : 70002,
"walletversion" : 60000,
"balance" : 2.27391276,
"blocks" : 353567,
"timeoffset" : 9,
"connections" : 8,

NB: Client is out of date BUT I've tested with the latest LTC-QT and have the same RAID no single yes behaviour so its unlikely the cause.

Ok so its finally up and working.

With v0.9.3.0-g40d2041-beta the core process definitely crashes on that volume. Now with version : 110200 it appears as if its crashed, but doesn't. Setting the write catch to 512MB may have had an impact here.

14:44:48  getinfo

15:36:10
{
"version" : 110200,
"protocolversion" : 70002,
"walletversion" : 60000,
"balance" : xyz,
"blocks" : 388767,
"timeoffset" : -7,
"connections" : 1,
"proxy" : "",
"difficulty" : 79102380900.22598300,
"testnet" : false,
"keypoololdest" : 1385606583,
"keypoolsize" : 101,
"unlocked_until" : 0,
"paytxfee" : 0.00000000,
"relayfee" : 0.00005000,
"errors" : ""
}

Note the delay of 52 minutes for a console command to return a response. This probably indicates bad threading that an IO process can block the interactive terminal. Eventually though block processing does resume and it caught up 16GB worth of data.

I might look into it further so I can log a bug report.


Is the Bitcoin Transaction ID also the "Hash of things to sign" for the signature generation? As a random example, is the transaction id:

114be7fea4d3dd0cf2e88a8fa9a56d4ea741efbabd07d61d08cf0810be2254fd

Also the hash that was used as the "hash of things to sign" for the "signature generation" for this transaction?

No. The transaction id contains the signatures. But you are making the signatures at the same time, so it can't possibly be the hash that is being signed. How to redeem a basic Tx? describes the actual sighashing algorithm.


Is there is any 12 word wallet recovery passphrase in bitcoin core How can i get wallet recovery passphrase of wallet.dat file. So that even if the wallet got corrupted or lost i can recover entire wallet using recovery passphrase.

Also i can't find any recovery passpharse command in API call list (https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list).

No, there is not. Bitcoin Core does not use BIP39.


What software do exchanges use to manage wallets? Do they write wrappers around bitcoind or is there a better solution out there? Some exchanges handle dozens of digital currencies, does this mean they are running bitcoind, litecoind, dogecoind, etc concurrently?

From an exchange's perspective, the best option would be to write mostly your own software. From a technical perspective, an exchange only has to fulfill the following in order to be accepting a crypto-currency:

Must allow deposits of Bitcoin or coin the exchange claims to accept.
Must allow withdraws of Bitcoin or coin the exchange claims to accept.

Normally bitcoind or the altcoin variant of it, litecoind, dogecoind, etc., take care of both for a user of a crypto-currency. But an exchange has special demands. Here are some issues I can think of that may happen to an exchange if they used the core client.

Core clients are not designed to work in a multiple server environments, something vital for large exchanges.
Private keys and corresponding addresses need to be stored under special conditions. An exchange may want add a username along with an address or even reuse addresses for efficiency.
Core clients aren't exactly lightweight. An exchange doesn't need a lot of features commonly packaged together with a core client. As an example, accounts; it's purely for organizing money cosmetically, something exchanges don't need.
Core clients don't allow for more intricate control of transactions or other components, SatoshiDice is impossible to create using bitcoind because it require manipulation of transaction inputs to create sends, something you can't currently do with bitcoind.

So what should an exchange be doing?

Using a combination of the two, or even ditching the core client. There are many programming libraries that simplify all aspects of Bitcoin technology, libbitcoin is a C++ library that allows you to make a partial or full node in no time. SatoshiDice is constructed on BitcoinJ, a popular Java library for Bitcoin. There are also many libraries available for other languages, but the point is that building a node isn't too hard.

I recommend a hybrid use because bitcoind is a lot more safe and bug-free than your own code. You can accidentally create code that creates invalid transactions or even accidentally send coins to the wrong address. I'd use a library and my favorite language to detect deposits and accredit them to accounts, and then push raw transactions to a bitcoind instance running on my own or possibly the same server where it will validate it and take care of sending it other nodes in the network. Less space to mess up in code.

For altcoins, you'd need an instance running or just doing small modifications to the code to differentiate. There isn't a huge difference between the protocols all the crypto-currencies use. You should know anyways if you're planning to accept a coin as an exchange.

TL;DR

Exchanges should be using software they're wrote themselves. This isn't hard to do as there are many libraries available that give you nitty-gritty access to Bitcoin. Core clients can be a bottleneck at times but can be used in conjunction to avoid said bottlenecks while maintaining a safety net for an exchange and can even simplify certain parts.


Client that can run behind a firewall Is there any client that can run behind a firewall?  I tried bitcoin-qt and Electrum and neither could work because of blocked ports.  I know I could use a web-hosted solution but I'd prefer a local wallet.dat.

Electrum is perfectly happy running through either standard HTTP ports (443 and 80) or through a SOCKS proxy like Tor. Both options are viewable under the server settings in the main panel, and both will help you break through a restrictive firewall.


Is Bitcoin mining chance based? This answer says that Bitcoin is not chance based, may I know how it is deterministic and does not have any associated probability of mining a coin?

To sum up the mining process: miners have a potential future block and they need to solve a problem based on that block to prove that they worked on it (Proof of Work). They apply a hash function to the block and get back a hash. The hash needs to have some properties, e.g. start with 3 zeros. If it doesn't, the miners change a value in the block (called nonce) and apply the hash function again. The new hash will be different. If it still doesn't start with 3 zeros miners repeat the process until they find a hash that starts with 3 zeros. For more details, please read this to understand the mining process.

A hash function is in itself deterministic. However, the mining process is not. Thus, the answer in the link you provided is wrong. If everyone was trying to mine identical blocks with identical nonces of the same exact order then it might be, in a sense, deterministic but that is not the case.

Everyone has a chance to win (although it is so small that in practice doesn't occur). See here for some examples.


How to mine with Intel HD Graphics 4000? I'd like to mine with my Intel HD Graphics 4000 (128SP 16C 350 MHz/1 GHz, 1.8 GB DDR3 1.6 GHz 64-bit, Integrated Graphics). I think it has support for OpenCL, as I ran benchmark software, and it said it has.

So I tried to use CGMiner on Windows in the single pool mode:

cgminer -o http://pool:port -u username -p password

But it said it could not find any devices:

 cgminer version 3.8.5 - Started: [2013-12-25 13:41:02]
--------------------------------------------------------------------------------
 (5s):0.000 (avg):0.000h/s | A:0  R:0  HW:0  WU:0.0/m
 ST: 2  SS: 0  NB: 2  LW: 5  GF: 0  RF: 0
 Connected to dogepool.pw diff 16 with stratum as user Zignd.igor
 Block: f190f72c...  Diff:472  Started: [13:41:07]  Best share: 0
--------------------------------------------------------------------------------
 [P]ool management [S]ettings [D]isplay options [Q]uit
--------------------------------------------------------------------------------

 [2013-12-25 13:41:00] Started cgminer 3.8.5
 [2013-12-25 13:41:01] No devices detected!
 [2013-12-25 13:41:01] Waiting for USB hotplug devices or press q to quit
 [2013-12-25 13:41:01] Probing for an alive pool
 [2013-12-25 13:41:02] Pool 0 difficulty changed to 16
 [2013-12-25 13:41:02] Network diff set to 472
 [2013-12-25 13:41:07] Stratum from pool 0 detected new block

What should I do?

The latest cgminer no longer supports GPU mining -- it is now exclusively for ASIC mining.

Here is the old 3.7.2 version, which is the last one to support GPU:
http://ck.kolivas.org/apps/cgminer/3.7/


How to generate a paper wallet? What do you find the best way to generate a paper wallet for BTC?

I've heard of this one: https://keybase.io/warp/warp_1.0.9_SHA256_a2067491ab582bde779f4505055807c2479354633a2216b22cf1e92d1a6e4a87.html

How can you be sure your address is not compromised?

Thank you!

David

If you follow the procedure at How to download bitaddress.org to use offline? for creating a paper wallet on an offline / airgapped computer, you can be fairly certain that your private key will not be compromised during the process.  For more info, see https://en.bitcoin.it/wiki/How_to_set_up_a_secure_offline_savings_wallet


Is there information about the buyer and seller in the Blockchain? Suppose I wanted to track transactions by an individual entity in the Blockchain, say Mr. Smith. Is that possible?

Yes & No

You can track a person's transaction only if you know that person's wallet address/es

By the wallet address/es, you can see the transaction.

The incoming transaction can be a buy, or a sale completed, etc.

The outgoing transaction can be a sell, or a purchase, etc.

You can also track a person using all his xpub key to know all the address/es at once.

Buy you cannot track a person just with a name or a single wallet address (if he owns multiple, which at this time, people do).

Hope this answers your question.


Bitcoin ZeroMQ and Scala application I'm trying to connect to Bitcoin's ZeroMQ queue, having no success and don't even know where my problem is. Here is what I did so far on my Ubuntu 14.04:

Installed Bitcoin via sudo apt-get install bitcoin-qt
installed ZeroMQ via wget http://download.zeromq.org/zeromq-4.1.2.tar.gz && cd libzmq/ && ./autogen.sh && ./configure && make -j 4 && make check && make install
In my Scala application I use jeromq: libraryDependencies += "org.zeromq" % "jeromq" % "0.3.5"
In Bitcoin's bitcoin.conf I add the following line: zmqpubhashtx=tcp://127.0.0.1:28332 (i'm only interested in incoming tx id's)

After doing all that I launch Bitcoin, then I launch my Scala app with the following code:

import org.zeromq.ZMQ
val context = ZMQ.context(1)
val socket = context.socket(ZMQ.SUB) // Since server side is PUB
socket.connect("tcp://127.0.0.1:28332")

while (true) {
  logger info socket.recv.length.toString
}

And I receive no messages. Thing is I don't even know what the problem is or how to test it. Does apt-get version of Bitcoin even has ZeroMQ support? On jeromq github it is stated that it's Based on libzmq 3.2.5 while Bitcoin requires ZeroMQ API version 4.x or newer, could that be a reason? Or perhaps it's something else entirely?

It is not specified what to subscribe.

socket.connect("tcp://127.0.0.1:28332")

socket.subscribe("hashtx");
# if you need raw data or block data, to add->
socket.subscribe("hashblock");
socket.subscribe("rawblock");
socket.subscribe("rawtx");

see.
https://github.com/bitcoin/bitcoin/blob/master/contrib/zmq/zmq_sub.py


A conflicting transaction has been detected in our memory pool. The transaction hash displayed below may change SO i received this transaction from my other wallet
1)  https://blockchain.info/tx/06810d392213a7453bbe6ad4ab95c0892875b0db2b56b3db5ef942b0a42eced4
for 1.02BTC

and sent these for 1btc and 0.2btc while the previous transaction was unconfirmed:
2)  https://blockchain.info/tx/44f68a0987fe9dfe88045c977c5d66534a65ca399f0d2b27fec7c80785ddc759
3)  0.2 (similar to 2) )

Now suddenly from my other wallet automatically
 4)  a new transaction for the same value but different hash

and the transaction number 1) shows
 A conflicting transaction has been detected in our memory pool. The transaction hash displayed below may change.

Can you tell me when 1) will be confirmed, and are 2) and 3) dependent on 1).
How long until the transcation is unconfirmed that the bitcoin is refunded.
I have paid the fees for all transcations.
Pls help!

There has been some malleability attacks recently - third party duplicating the transactions.

See https://en.bitcoin.it/wiki/Transaction_Malleability for details on the attack technique.

The attack is merely an annoyance as far as I've understood, and there is a BIP in the making (BIP 62) to deal with this attack vector.

Perhaps this explains your problems.


Unconfirmed Transaction - 8days - Exchange to Hardwallet Hi All I transferred BTC from exchange (BTC Markets) to Ledger Nano. Transaction after 8 days still showing up as unconfirmed however the amount shows up in the wallet. Any suggestions or clarity on this?

I suggest contacting BTC Markets and asking them to increase the transaction fee. Ledger isn't the issue - most wallets display unconfirmed transactions.


How can I find a digital forensics expert to help trace stolen bitcoins? Are there any professional organizations that have lists of blockchain analysis and digital forensics experts by location?

I know some of this work can be done online but a directory of experts by location would be helpful, since I prefer to work with someone locally.

I'm not sure of the existence of a directory of experts by physical location since Bitcoin is a digital currency.

Elliptic is a blockchain intelligence company identifying illicit activity on the Bitcoin blockchain and providing services to leading Bitcoin companies and law enforcement agencies globally. Their HQ is in London and main office in New York. More information of the company is available here. If you're based in either of these locations you could contact them locally.


What are some causes for long chains? Blockchain.info shows a graph of transactions excluding "long chains" of more than 10: https://blockchain.info/charts/n-transactions-excluding-chains-longer-than-10

This seems to indicate that ~68% of all transactions in bitcoin are part of long chains (which just means they changed hands more than 10 times in a day).

Tumbling is mentioned as one reason these chains are created, but I would like to explore this deeper. What other reasons might long chains be created?

Would gambling create long chains? (continuing to send to a service that pays out sporadically to you and others)
Are there other examples where two parties would legitimately want to transact between each other rapidly on blockchain?
How often does tumbling create long chains? I'm not familiar with which services are popular and how many rounds are recommended.

It would be interesting to understand what is causing the popularity of long chains in bitcoin right now. Thanks!

There's an extensive discussion on long chains here.

A "long chain", as defined by bc.i, appears to be a transaction chain whose growth rate exceeds a target value in 24-hour period. Note that transaction chains are destined to become long over time. That's how chain of ownership works. It seems the thing bc.i wants to separate out is rapid velocity transactions.

A long chain requires that a coin is given to a payee, who quickly passes it on, and so on. It's a sign of either highly coordinated effort between multiple users (unlikely) or a single user shaving a coin by making rapid-succession payments.

There are many possible causes beyond the ones you cite. For example, the game SauruTobi supposedly used high-velocity transactions, and from what I understand, so does ChangeTip. Essentially, any direct-payout service can cause long change, which covers a lot of ground.


How do I get my public address in Bitcoin Core? In a world of pain at the moment. I downloaded Bitcoin Core, and before I realised I'd need the complete downloaded Blockchain, my friend transferred some coins to my address.

I did some research and am trying to import my Bitcoin core private keys to Blockchain, therefore having access to my coins. My problem is, I can't get my public address. I have tried using several commands in the console window, and are able to unlock and lock. I've used 'listaddressgroupings' - which works, but the return is "[" and then "]" directly below?

I've also used getaccountaddress and getaddressesbyaccount "Your Address" with no luck.

Many thanks

Edit: Answer to the question: How to get private keys out of Bitcoin Core

After you found your addresses (by using the commands I listed below, for example) you can execute the folllowing command:

dumpprivatekey 1ofYourAddresses

If your wallet is password protected and locked run:

walletpassphrase "your password or passphrase" 600

And 'walletlock' when you're done to re-lock it.

You can easily recognize addresses from Private Keys because addresses start always with one (1), Private Keys instead start with 5, K or L. You don't need to manage public keys at all. Also you just need the Private key to export/import a "wallet", in fact a private key is a wallet, and from that ypthe software can find out the address(es) that correspond to it, so you need just to export that.

Answer to the original question: How to get public address in Bitcoin Core
Note the account API is currently deprecated (being removed in new versions)

Your main (first) bitcoin account in Bitcoin Core and bitcoin-qt is the empty-string account, '""'.

To get your bitcoin addresses via bitcoin-cli or via the bitcoin-qt console, for your main account, use:

getaccountaddress ""

That will return your first address of the main account, and:

getaddressesbyaccount ""

Will return (at first launch two addresses and in general) the list of all your addresses associated with your main account.

This is an example output of the getaddressesbyaccount call on a newly installed bitcoin-qt:

> bitcoin-cli getaddressesbyaccount ""

[
    "1AA37Akj16aj9nU4NYgx2cRwjgmuwpxR6Z",
    "1CbkkAbB7ootHHu9Fhbh8TtRR2iiCoNCZD"
]

This is the minimal ~/.bitcoin/bitcoin.conf you want to have to be able to run bitcoin-qt with the CLI enabled, this way you can understand which accounts and addresses you own and their balances etc. from the UI.

rpcuser=bitcoin
rpcpassword=TYPE_A_STRONG_PASS_HERE

# enables deamon in bitcoin-qt
server=1


How to query blockchain.info? I need to query blockchain.info with an address and determine how much is there, ignoring transactions that don't have 3 confirmations.

Can anyone give me a hint how to do this?

Get the block count:

http://blockchain.info/q/getblockcount

Subtract 3 from that number.

Get the transactions from the address you're looking for:

http://blockchain.info/address/$bitcoin_address?format=json&limit=50&offset=0

This returns 50 transactions by default, change the 'limit' value to wherever you might need it to be. Setting 'offset' to 5 will allow you to skip the first 5 transactions. Make sure you don't set offset to something greater than the total number of transactions on a particular address, it won't ever return anything.

Then set up your code to ignore any transaction that's newer than 3 blocks ago.


Where can we buy shares of ASICMiner ASICminer did decide to keep the hardware and mine. They're selling
  shares with intent to payout the dividends from whatever profit is
  made.

Okay, so we got three players. ASICminer. Avalon. And butterfly labs. Obviously ASICMiner is the one most convenient. We don't need to do anything. We just pay. And get results.

So where can I buy ASICminer share?

Also how do they pay dividend?

So we own a share. Then we login to their site, and then we insert our bitcoin address? Or what?

Where is their website?

Disclaimer: At the time of this writing, I am a shareholder with ASICMiner.

Also be aware that the Bitcoin stock market is, like Bitcoin, very immature and not regulated. The risks involved are far greater than for a traditional stock market.

Like @Steven Roose just wrote, you can buy Pass-Through (PT) shares through two separate stock exchanges, BTC-TC and Bitfunder. I personally prefer the former due to its easier interface, but either works.

However, know that these are PT shares only. A PT means that you buy shares with someone who holds real shares with ASICMiner. In practice, it is much the same, but both PTs will charge a 0.5% fee from your revenues, and you don't get voting rights, so keep that in mind.

For 'real' shares, ASICMiner do not sell those directly. They were sold initially at a now defunct stock exchange (GLBSE) which turned into a bit of a disaster and after that, friedcat, the person in charge of ASICMiner, decided he did not want his stocks traded on any exchange for fear of similar accidents.

That said, there are a lot of people that hold 'real' shares, and these are sometimes put on auction over on Bitcointalk.org (check https://bitcointalk.org/index.php?board=73.0). In case you wint one of these auctions, the seller will transfer the sold amount by sending a message to friedcat with your email address and your Bitcoin address for dividends. I suggest using one of the escrow service providers on that forum to ensure the transfer goes smoothly and safely. Several escrow providers will do this for free, but it is customary to tip a few bitcents at least for their service.

Dividends for PT shares are paid to your exhange account and directly held shares are paid directly from friedcat to your Bitcoin address on file.

Beyond that, ASICMiner does not have a web page per se, but they keep everyone informed several times a week here:
https://bitcointalk.org/index.php?topic=99497.0

Like I said, be very careful about investing in Bitcoins and cryptocurrency stocks. There is no regulation, no recourse, and seldom any personally identifiable information.

And again, I am a current ASICMiner share holder, so keep that in mind as you read this.

EDIT: I've posted a more comprehensive and up-to-date answer here:
http://coin.furuknap.net/how-to-buy-asicminer-shares/

.b


Is there a special name for the block currently at the head of the chain? Just as we have the genesis block which is block 0, is there a special name for the block currently at the head of the chain? Obviously such a block would be observer dependent and never absolute but I am curious all the same.

The Bitcoin source code refers to it as the 'tip,' e.g., UpdateTip, SetTip, ConnectTip. It's sometimes referred to as the latest block; that's not totally accurate, since the latest block is not always the tip.


XPUB export from MultiBit HD wallet Is there a way to to export/copy wallet's XPUB from MultiBit HD wallet (windows)?

Not in the UI no.

You can work out the XPUB from your wallet words by making an offline copy of https://dcpos.github.io/bip39/ and then using that.

If it is a regular MultBit HD wallet it is the BIP 32 panel you want.

Use it offline for security of your wallet words obviously.


How to make genesis block transaction spendable? I read this question Why can’t the genesis block coinbase be spent? . It says because of some quirk (the genesis block coinbase transaction is not added to the global transaction database) genesis block coinbase transaction cannot be spent.

How to add this transaction to the global transaction database ? What changes are needed to make this transaction spendable ?

It would be trivially easy to make the change.  Just a couple lines of code to add the include the genesis block tx in the utxo.

Understand however the hard part is that would create a hard fork.  Unless the change became part of a majority of nodes it would violate the consensus rules. If that output was ever spent any node running older code would be split from any node running newer code as some nodes would see the new txn as valid and some as invalid.  This is true for any hard fork scenario.  For this reason it is unlikely that hard forks for minor or trivially reasons will ever happen.


How much would cost to mine a block with Google Compute Engine? Google has opened its Compute Engine and it has a price list. How much would cost to mine a bitcoin block with Google Compute Engine?

Even if it was a GPGPU cluster, you will not make a profit from the prices they are charging. Mining at this point is only profitable with FPGA, ASICs and certain GPUs pending power consumption.


How will Bitcoin be inflation free? In the research paper, the author(s) mention(s) the following:

Once a predetermined number of coins have entered circulation, the incentive can transition entirely to transaction fees and be completely inflation free.

What does this mean?
I understand that once the 21M Bitcoins are minted, the incentive will only be to earn transaction fees.
I do not understand the part of fees being inflation-free.

Inflation is newly mined coins added to circulating supply. When block rewards become zero and transaction fees are the only incentives for miners, there won't be any new coins added to circulating supply.
According to https://www.viewbase.com/inflation (In last 24 hours):
1031 BTC mined
Circulating Supply of Bitcoin is 18,504,668 BTC
% of newly mined coins(24h) is 0.006%
Annualized inflation rate is 2.03%


Pseudo code to find Bip39 checksum? I'm trying to find the checksum for a 12-word BIP39.
I can find the first eleven words just fine, but my 12th word is always off by a few positions.
For example, take the 128-bit entropy e84eaa26330ccbb2f866a1dc155e94ba.
In binary that is 11101000010011101010101000100110001100110000110011001011101100101111100001100110101000011101110000010101010111101001010010111010.
The first eleven 11-bit words are:
11101000010 (bin) => 1858 (decimal) => tribe
01110101010 (bin) => 938  (decimal) => inspire
10001001100 (bin) => 1100 (decimal) => maze
01100110000 (bin) => 816  (decimal) => gravity
11001100101 (bin) => 1637 (decimal) => smile
11011001011 (bin) => 1739 (decimal) => sunny
11100001100 (bin) => 1804 (decimal) => thunder
11010100001 (bin) => 1697 (decimal) => stage
11011100000 (bin) => 1760 (decimal) => swing
10101010111 (bin) => 1367 (decimal) => priority
10100101001 (bin) => 1321 (decimal) => pioneer

There are still 7 unused bits, the last ones: 0111010.
The SHA-256 hash of the hex string is 5355d54a3d673c4b1ac20b839ead09af3c6fea6dc24199b477f6ff64e7a68262.
The first 4 bits of that are represented by the first hex character, 5, which in binary is 0101.
I append those 4 bytes to my binary string:
111010000100111010101010001001100011001100001100110010111011001011111000011001101010000111011100000101010101111010010100101110100101
Now I have the last 11-bit word:
01110100101 (bin) => 933 (decimal) => input

But when I try to validate that against Ian Coleman's Bip39 I see the checksum should be 0011 (not 0101) and that would make the last word be
01110100011 (bin) => 931 (decimal) => inner

What am I doing wrong?


Are decentralized currencies absolutely critical If Ripple is not really decentralized and yet obviously effective, quickly adapted to use and successful, should it matter?  Does it not give more certainty and security in use especially with new currencies and ICO's set to launch?  I am quite new to the Cypto space and eyeing a potential ICO - Laxmicoin, which is working with the Reserve Bank of India pre-launch.  Is there any reason that receiving the RBI's approval and interaction would be detrimental to it's long or short term success?  India, being the World's largest democracy and most of the population outside of any possible banking facility, lends itself to immediate and enormous potential for cryptocurrency.

Please advise...

Even in the case where a centralized body is perfectly benevolent, and always acts in the citizen/user's best interest, the fact remains that mere existence of a position of power is a liability to the network. What happens if a bad actor gets access somehow? It doesn't matter how well-intentioned the admin is, if an unauthorized individual gets access to the controls.

Since the existence of a centralized power is an existential risk to any network, in the real world we see societies create rules and regulations around such institutions (such as the regulations surrounding central banks). In theory, the regulations help ensure that those in power can't just manipulate the system for their own gain: for example some big bank CEOs can't just create a few million dollars in their own bank account's without anyone noticing. We can have a separate debate on the effectiveness of this system, but at minimum this is how it is intended to work.

Bitcoin is an invention that allows for the creation of a financial network that doesn't have a centralized source of power, and thus does not need the same sort of oversight in order to be trusted. Instead the user can simply run the code, and understand that they are connected to the network, that the code's rules will be followed, and that the network's code is very difficult to change. Through this, the user can be sure that the rules that govern their value will not be manipulated, without requiring the oversight of some centralized position. Instead rules changes will only come through the nearly unanimous support of the network's users, a process which helps eliminate situations where individuals can push unwanted or unjust unjust changes on others.

If there is a centralized admin in a system of value, then users should demand some sort of auditing/oversight/regulation to ensure that they are not taken advantage of. Otherwise, the user must place great trust in the admin, and in the security of the admin's powers.


One seed phrase created two wallets with two script types I have a wallet on blockchain.com and it is saved with the backup phrase. Due to issues I was not able to buy anything there, so I created an account at coinbase. This lead to the usage of coinbase wallet. I imported the wallet with the phrase. Everything went well unti I added coins from coinbase. This new amount appeared only in the coinbase wallet.
So now I figured out using Electrum that I have created two wallets. One with with script type p2pkh and one with p2wpkh. Both summed togehter cointains my whole number of coins.
How can I proceed to put all in one wallet together?
Since support on blockchain.com is not able to help I want to have all at one place again.

How can I proceed to put all in one wallet together?

Decide which wallet you want the coins to end up in
Open that wallet, copy a receiving address from it
Open the other wallet, send all funds from it to the address you copied above (be sure to double check that the address you paste matches!)
Wait for transaction confirmation. Once confirmed, all your funds will be in available in that one wallet

It is not technically impossible to have a wallet handle addresses that are different script types, but I'm not sure I know of any wallets that include this functionality.


how can I hardcode a private key in bitcoinJ - ECKey constructor? Can someone please explain how to use the following constructor (listed here):
ECKey(BigInteger priv, org.spongycastle.math.ec.ECPoint pub)

Say my private key is: priv = "L4...5".

How do I get the big integer representation of it (in other words, and if I understood correctly, is there a function to go from check58 to biginteger?) , and

what about the second parameter?

Thanks

If all you are after is getting an ECKey object for that private key, then Bitcoinj has a DumpedPrivateKey class for just such an occasion.

import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.DumpedPrivateKey;
import org.bitcoinj.params.MainNetParams;

public class Example {

    public static void main(String[] args) {
        String priv = "L4...5";
        ECKey key = DumpedPrivateKey.fromBase58(MainNetParams.get(), priv).getKey();
    }

}

If you would like to use an ECKey constructor explicitly, then you should be able to get the code you need from here:

  https://github.com/bitcoinj/bitcoinj/blob/release-0.14/core/src/main/java/org/bitcoinj/core/DumpedPrivateKey.java#L70-L91

With respect to the constructor you listed, it is a protected constructor, so it's probably not one you would be looking to use. It lists a private key and public key parameters. The private key may be null if the ECKey instance is only going to be used for verifying signatures, not actually producing them. The public key must not be null, and it saves time by not needing to re-compute the public key, which is a CPU intensive operation.

Note that most of the public ECKey constructors are deprecated. The preferred way of creating the ECKey objects now is to use the static factory methods.


local bitcoin nodes in a same vlan cannot sync I have two local bitcoin nodes, node1(192.168.105) and node2(192.168.1.101). Firstly, I start node1 to connect the bitcoin network to download some blocks. Then I delete the static dns seeds in file chainparam.cpp for both two nodes. So they both cannot connect to the bitcoin network.

I started node1 with “./src/bitcoind -datadir=/bitcoin_block -listen=1" and node2 with "./src/qt/bitcoin-qt -datadir=/bitcoin_block". And in order to connecting node1, using command "addnode 192.168.1.105:8333" on node2 through the debug window/console.

The status in node2 shows,

We can see that node2 has connected to node1, but cannot sync blocks from node1.

I checked the node2's debug.log and found "Ignoring getheaders from peer=0 because node is in initial block download". Then I changed the nMinimumChainWork value to a more smaller one and provide -maxtipage when starting node2 to make the following check failed(suggestions from Altcoin connecting nodes). But it still won't sych.

"chainActive.Tip()->GetBlockTime() < (GetTime() - nMaxTipAge)".

Is there anyone can give some advices here? It really stuck me here. Appreciate your help.

Then I delete the static dns seeds in file chainparam.cpp for both two nodes. So they both cannot connect to the bitcoin network.

They can still connect to the Bitcoin network without the DNS seeds. The DNS seeds are not the only way to connect to the network; there are numerous fallbacks, with DNS seeds themselves being a fallback too.

-datablock= is not a valid command line option. Did you mean to use -datadir?

Check in the debug window of both of your nodes; does node1 have a number of blocks that you expect it to have? Does node2 already have blocks that it downloaded very quickly and you didn't realize it?

Instead of using the addnode RPC, try using the -addnode or -connect startup options to connect your nodes.


How are new bitcoins created without monetary inflation? As bitcoins are mined are older bitcoins retired? If not, how is monetary inflation prevented? Wouldn't the additional bitcoins cause the overall value of bitcoins to be deflated?

Bitcoins are created at a predetermined rate. Until this rate drops to 0 (around the year 2140), the supply of bitcoins is increasing. If this isn't offset by destroyed/lost coins and increased demand, some amount of inflation will occur. However, I'd expect the inflation rate to be low (if positive at all), and getting lower.

Once all ~21 million bitcoins are mined, no more will ever exist, so inflation will cease entirely, and only deflation can occur (again, as bitcoins are lost or intentionally destroyed). There are currently ~12.7 million bitcoins in existence, so at most, inflation will make 1 bitcoin today worth ~1.65 bitcoins in the future.


Correlating BTC price changes with recent use in commerce Is any data available on the amount of bitcoin used in actual commerce, as opposed to investing in bitcoins, during specified time periods?

(I'm wondering whether the recent increases in dollars-to-bitcoins ration are correlated with amounts used in business via things like BitPay or otherwise.)

That's the thing about a pseudonymous digital currency -- there's little information that can be gleamed from the blockchain data.

There are some metrics reported in aggregate by the payment processors and others.  For instance, last month BitPay shared during a discussion that they had surpassed 10,000 transactions since their launch over a year earlier.  They didn't provide the number of bitcoins as well or give the average amount per-transaction.  They are probably the largest payment processor but even that amount is pretty insignificant.

This data will probably be most accurately obtained through user surveys and from there extrapolate.


SegWit witness commitment merkle root location BIP 141 defines the commitment structure here
What i am unsure about is the location of this data. I know it will be in scriptPubKey.
Does this mean Coinbase tx will have more than one output?
Also is there a testnet block with an example of a Coinbase tx with witness commitment?

The witness commitment is in an OP_RETURN output of the coinbase transaction. This means that the coinbase transaction will likely have more than 1 output (although not necessarily as a miner could send the block reward to the OP_RETURN output, but they would be stupid to do so). Here is a testnet block with a witness commitment: https://live.blockcypher.com/btc-testnet/block/00000000000007972a6f786179cb42dbc59f167aafd757b203e6c2eb80d49455/. All testnet blocks should have one as segwit has activated on testnet.


(Ripple + wire transfer) x Banking (loans) multiplicator = 2x debt crisis? if Ripple users would use % loans uncontrolled way?
For example:
system (gateway) have 100 bitcoins, the quantity is limited, bitcoin holders have issued 100 loans for 1 bitcoin each with 10% rate  (IOUs+10%), and then somebody lend this 100+10% to somebody for 10% more,how it would possible to return 110+10% bitcoins in real form?

hmmm....If we talkin about dollars its simple, dollars have unlimited supply and can be multiplied infinite, as about bitcoin.. maybe XRP would take role of Dollar as fiat money and bitcoin gonna be a reserve?

*sorry for poor english

First, I need to point out that this wouldn't be typical use of Ripple. Typical use would be where users trust gateways and all balances are fully backed by the gateway. There's no loans and no credit except to gateways.

But, if people do extend credit to each other, unless you specifically agree to do so, there is no obligation to return an asset to any real form. Typical "loans" in Ripple are actually even exchanges of IOUs. The IOUs are redeemable inside the Ripple system and are only redeemable outside the system if agreed. The rates are initial discounts, not interest rates.

If I have a really good payment network and you want access to it, I might trade a $10 IOU to you for a $10.50 IOU from you (more precisely, I would agree to accept your IOUs at a 5% discount). The "interest" is prepaid as an initial discount. There's no need to settle or pay anyone back because the exchange was an even exchange. We both considered my $10 IOU approximately equal in value to your $12 IOU (because of my superior liquidity.)

If you max out your credit, I now have full access to your network (because I hold your IOUs) but you have no access to mine (because I won't accept any more of yours). To get use of the pathway again, you have to reduce the balance to below the limit. If you don't, I can just do it myself by returning your IOUs to you in exchange for other IOUs you hold -- you've already agreed to accept them when you issued them.


Determine address balance using bitcoin core I'm having a hard time figuring out how to compute the balance of a given bitcoin address using only the standard RPC API. I would like to extend this logic to bitcoin clones as well so the solution should use standard API calls only (e.g. only calls listed here https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list )

Can you think of a way of doing this?

AFAIK, this can't be done in any reasonable way with Bitcoin Core and its derivatives.

The only way I know to do it with Bitcoin Core is to use importaddress or importmulti to add your address(es) to the wallet as watch-only, but this requires a full blockchain rescan in order to compute the balance.  This takes several minutes to hours depending on the speed of your hardware.

(Note that the bitcoin.it link you gave is obsolete and only covers the API up to version 0.8, so you won't find these commands listed there.)

You'd need to use some other software that actually indexes all transactions in the blockchain by their receiving addresses.  This is what a block explorer does, for instance.

We have had a lot of other questions similar to this, so maybe there are some suggestions there: https://bitcoin.stackexchange.com/search?q=get+address+balance


Private Keys in my Bitcoin Wallet? What are 'Private Keys'? and where do i find them in my wallet? How do I know it is a private key?

Depends on your wallet.

A Bitcoin private key is a 256bit (32bytes) random number (there is a max limit, but lets don't go into the details).
Often, wallets export them as a WIF encoded base58check string which looks like L1esWYsDL8nBeTRmGjUiDru54nXS4wF811n3e7mbvoSjM2zZWJ6w.

Sometimes, wallet use HD (look up BIP32 if you are interested).
Then the root private key starts with "xprv" and look like xprv9s21ZrQH143K4bhMhuUKZnW9DW5Dx9mwGQseMNdoECsaCGdhL9N8jR6KG5c3UTYrKPTkRNEBfeX7LjE2VjScyLZYA3XqRpyYbhnZHnsUepS

Search after "export private key" or "dump wallet", etc.


Java library for Bitcoin Client Application are there Java libraries for Bitcoin available to develop client applications?

BitCoinJ

In addition to @D.H's answer, BitCoinJ provides the following for developers

open source through Subversion
easy to use Java API
easy to integrate via Maven
access to either release or snapshot editions depending on your risk profile

BitCoinJ also uses the Bouncy Castle encryption algorithm implementations. Some of these were missing or poorly implemented in Android which necessitated the inclusion of these libraries into BitCoinJ (currently via the Maven Shade plugin to allow updates to Bouncy Castle to be introduced when they occur).

These inclusions makes it a very useful library to get started with than simply rolling your own against the JSON API of the standard client.

Disclaimer: I'm a contributor to the BitCoinJ project so I'm a bit biased regarding it's utility.

BCCAPI

A transaction and balance monitoring API for Java.

From the website:

  The BCCAPI (BitCoin Client API) allows you to create a light-weight
  secure Bitcoin client in Java. The BCCAPI connects to a server that
  holds the block chain, and which tracks the client’s wallet balance on
  the clients behalf. The server only has knowledge of the clients
  public keys, and is in no position to spend funds owned by the
  client’s wallet.

This could be useful if your application does not require the client to spend coins through your system.

Off topic: A note on Bitcoin clients in Java

Although it's not a library as such, you may benefit from looking at the source code for the MultiBit project to get you started in creating a Java Swing based Bitcoin client based on BitCoinJ with internationalisation and QR code support.


Is MultiBit secure? And hong long will MultiBit import .aes.json take? Two questions:

Is MultiBit secure?
I opened a wallet in blockchain.info, and I want to import .aes.json to MultiBit, hong long will MultiBit import .aes.json take? I waited too long.

There is currently a bug in the 0.5.9 code that prevents it from loading blockchain.info wallets. It is fixed in the develop code and will get into version 0.5.10 (which will probably be released after the Bitcoin conference now). The older versions work fine - version 0.4.23 is in https://multibit.org/releases . You could just use that version for the import.

Is MultiBit secure ?
Security for bitcoins has several aspects - here are the main ones:

Is it open source ? Yes.
Can you trust the developers ? Well that is for you to decide but I've been working on it solid for over a year now and code it 'in the open' not pseudonymously.
Can you check the downloads are the correct ones ? This is important now that Trojans have started appearing. Yes. Download from https://multibit.org. Check the binary against the PGP signatures. The Mac version is also signed with a Mac developer cert and soon I'll start doing the same with the Windows version. Not enough? : build it directly from the code.
Do you control the private keys ? Yes, there are stored locally.
Can you encrypt them ? Yes.
What about malware and keyloggers ? Until we get hardware wallets bitcoin clients in general are vulnerable to an attack by malware and keyloggers combined. You need to practice 'Safe Computing' on the computer you have your bitcoin on. If you are dealing with serious amounts of bitcoin sign your transactions offline with either Electrum or Armory rather than MultiBit.


How do I set up a Lightning Node on Mainnet using windows? I want to set up a lightning node on windows. I have found lightning-app which seems to work only on testnet. help me finding a good guide to set up a lightning node on windows.

the reason I am insisting in the frustrating windows platform is to make it familiar with other people showing it really works on mainnet and setting it up for non-programmers. but I have found some guide on medium which shows how to set it up on testnet.

Try Eclair.

It has a nice GUI, runs on Windows, and just a few days ago they have announced a new version that officially supports mainnet usage.

It requires a Bitcoin Core node to runs alongside it, and a little configuration.


Can I mine with both AMD gpu and AMD integrated graphics at the same time Right off the bat I'm not planning to mine bitcoins but i would like to have this knowledge for some other cryptocurrency. I have an old pc with AMD A8 cpu that has integrated graphics and AMD Radeon HD 7890. I want to know is it possible for me two mine with both integrated and dedicated card at the same time.

Im running an A-10 and a gtx260 and i can use both to mine seperate/combined coins, shouldnt be any different for you? :)


How much do you gain from minting a proof-of-stake coin on multiple wallets? Is there a theoretical gain from mining the same wallet/coins for pos on multiple computers, and if so, how much is it?

There is no theoretical gain. It would basically be multiple computers doing the same calculations and arriving at the same result.

Look at https://github.com/ppcoin/ppcoin/blob/master/src/kernel.cpp#L290-L312. These are the things that are included in a PoS hash:

//   nStakeModifier:
//       (v0.3) scrambles computation to make it very difficult to precompute
//              future proof-of-stake at the time of the coin's confirmation
//       (v0.2) nBits (deprecated): encodes all past block timestamps
//   txPrev.block.nTime: prevent nodes from guessing a good timestamp to
//                       generate transaction for future advantage
//   txPrev.offset: offset of txPrev inside block, to reduce the chance of
//                  nodes generating coinstake at the same time
//   txPrev.nTime: reduce the chance of nodes generating coinstake at the same
//                 time
//   txPrev.vout.n: output number of txPrev, to reduce the chance of nodes
//                  generating coinstake at the same time

These will be the same on two different wallets, so you'll just be doing the same calculation and getting the same result on two different computers.

  One possible theoretical gain is that blocks could be propagated from different nodes at many locations, and the blocks would spread much more quickly.


Will expensive mining equipement have any worth in the future? With more and more people picking up advanced ASIC miners, the difficulty is going up while the remaining coins are going down. If miners continue joining at this or a faster rate, the limit might be reached much sooner than originally expected.

I worry about purchasing any mining equipment because I don't want to have a $2,000 investment that can not recoup its cost within say, 10 years - or at all.

So is it even worth buying newer mining equipment, or is it better to stick with whatever is around?

UPDATE: To clarify, I'm not asking about how an ASIC mining rig can be reused. I am well aware that it has a single purpose and cannot be reused. I'm asking if it is even worth spending a lot of money on such a thing.

TL;DR. Bitcoin profitability is about choosing between buying BTC outright (Coinbase, or Bitstamp) or buying hardware ASIC miners and paying the ongoing electrical fees.

Edit:
To keep mining expenses low, you will need the cheapest form of electricity.  This usually means coal in most regions. "Clean coal" doesn't exist.

10 years from now is a long time, and you should expect additional transaction fees by then, plus many more (different) incentives to mine.

As of late summer 2013 the ASIC market is saturated in my opinion, and the difficulty spikes will continue to reach into 2014.  That means the value of BTC must appreciate for most people on the network to get an ROI.

Either one or more of these things will happen:

People will mine coins, pay a lot for electricity, for years to come just to get a ROI
Sell the machine at a loss, invest in Bitcoin
People who buy Bitcoin will cause the price to increase, thus making mining profitable
Mining companies will go out of business (or sell a different product) and whatever ASICs are made now will be the only ones in the game for a while.

Example

Assume that the network hashrate (competition) is so high that in order to make a profit, miner #1 has to mine for 2 years and also wait for the BTC to be valued over 900 USD. (Note: BTC hit $1000 per coin on 11-27-13)  After a lot of time and expense (not to mention heat, noise, and an angry wife) he cuts even.

Now assume that in the same time period, person 2 buys BTC at the current Mt Gox rate: $140.  (Two thousand dollars worth of coins).  The price of BTC only has to increase for him to make a profit.

So the question is

  Why are people buying mining machines when buying Bitcoin outright is lower risk and a better reward?

The answer is so they can ride the next mining wave... more on this in a second

The Good News

If you already purchased the miner, you should be fine if the market figures out that buying Bitcoins is "safer" than mining, and has a better chance at making a profit.

Once buying BTC becomes as popular as mining is today, then the price will increase.  If the price increases, demand for ASICs will increase as well.

Bitcoin is about riding the wave of either buying BTC outright or buying miners.  Each action perpetuates the other, so I'll bet the mining storm of 2013 will cause BTC to rise and everything will be alright in the end.


Testnet difficulty change Has something changed recently in testnet?
Today I've been seeing new blocks appear every 1-5 seconds instead of the usual 10-20 minutes

Testnet has a built in functionality that changes the difficulty to 1 if the mining process takes 20 minutes or longer.

This question explains the dropping of difficulty to 1.

So while the difficulty is 1, the blocks are being formed rapidly until the difficulty reaches to a value which takes 10 minutes.


Where to find old versions of bitcoin-qt from 2011-2012 Where to find old versions of bitcoin-qt from 2011-2012 for download? I cannot find anything on the source code repository and all links I've found on forums are dead.
Is anyone able to assist finding the very old windows bitcoin-qt downloads?

You can find the first release of bitcoin on this old bitcointalk thread offered by Hal Finney himself https://bitcointalk.org/index.php?topic=68121.0
For the more recent version, circa 2009 you can dig the official github repo releases https://github.com/bitcoin/bitcoin/releases


Private Brain Key Generation and Public Address Not Matching Java I am trying to generate a public and private key set from a input string in Java. (Yes I am aware this can be a dangerous practice) I am using bitcoinj for a outside library.

I currently have:

 //public key generation from private key
 static String getPublicKey(byte[] privKey) {

    Address address = new Address(MainNetParams.get(),
        Utils.sha256hash160(ECKey.fromPrivate(privKey, false).getPubKey()));

    return address.toString();

  }

 ///hash string to generate private key from string
 static byte[] sha256(String base) {
      try{
          MessageDigest digest = MessageDigest.getInstance("SHA-256");
          byte[] hash = digest.digest(base.getBytes("UTF-8"));
        return hash;
      } catch(Exception ex){
      throw new RuntimeException(ex);
      }
    }

 //encode private key as string to display
 static String privToString(byte[] hash) {

      StringBuffer hexString = new StringBuffer();

      for (int i = 0; i < hash.length; i++) {
          String hex = Integer.toHexString(0xff & hash[i]);
          if(hex.length() == 1) hexString.append('0');
          hexString.append(hex);
      }

      return hexString.toString();

  }

When I run the following:
Seed String: icecreampaintjob

I get the following:

Public: 1KdoiXMYFn2qa8uGGiNqfrwFRDu3j2qQNA

Private: dba1e3e22415c56af772dee422add21b7382ea35f2af77852a8069d02e47ecf4

Using bitaddress.org to cross verify I get:

Private: 5KV1o7tRK8pNqrPNYyi38nrik9r2Y85sjdgFDttnDiT1uZrQ1fj (DOESN'T MACTH)

Public: 1KdoiXMYFn2qa8uGGiNqfrwFRDu3j2qQNA (MATCHES)

What am I missing?

As bitaddress.org BrainWallet says in its display

Private Key (Wallet Import Format):
5KV1o7tRK8pNqrPNYyi38nrik9r2Y85sjdgFDttnDiT1uZrQ1fj

Wallet Import Format is the usual base58 armoring applied to the privatekey value with 'version' 0x80.
See https://en.bitcoin.it/wiki/Wallet_import_format or in more detail https://en.bitcoin.it/wiki/Base58Check_encoding .
This is basically a duplicate of Is there a way to generate a brain wallet from the command line or console? although that uses bash+dc rather than Java.

Not tested, but it looks to me like VersionChecksummedBytes(0x80,bytes).toBase58() does this.


How do I deploy Qbit Ninja Server? How do I deploy Qbit Ninja Server developed by Nicolas Dorier on a production server?

sorry there is no documentation.

The console application QbitNinja.Console.Listener is an app which connect to a trusted full node and push the data into Azure Storage. Due to latency, you should run that on a VM hosted in azure in the same region as your storage.

The website can be deployed as a Azure Web App, it only query the data indexed by the Listener.

If you have basic knowledge in ASP.NET and Azure, this is easy to setup. If you do not have, I advise you to start by learning about how to deploy a web app on azure.


What are the minimum and maximum lengths of a Mainnet Bitcoin address? I'm getting mixed answers on this question. For example, this source says addresses vary between 27 and 34 characters in length. The Wiki says 26-35 characters. Neither source cites something that will let me independently confirm the figures.

What are the minimum and maximum lengths of a Bitcoin address on mainnet, and how are these numbers derived?

The wiki is correct! The source you linked must have assumed that the address with the smallest encoding has version_byte=00, data=20*00, checksum=94A00911
$ encodeBase58 00000000000000000000000000000000000000000094A00911
1111111111111111111114oLvT2

Which has length 27. This address is valid and has been used on the blockchain! But it is not the shortest address.
I wrote this short bash script to find the minimum length address. It found that there were a total of 266 address of length 26. For anyone who is curious, these are the 266 addresses with length 26.

The maximum length address has version_byte=00, data=20*FF, checksum=FA06820B:
$ encodeBase58 00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA06820B
1QLbz7JHiBTspS962RLKV8GndWFwi5j6Qr

Which has length 34. This has also been used to receive coins, as can be seen here.


Walletnotify hits twice, immediately So I've read most of what is tagged with walletnotify, but haven't found a solution. I know walletnotify is supposed to run twice, one for the unconfirmed transaction and again, when it reaches 1 confirmation. For me, it runs twice, right off the bat.

bitcoin.conf:

server=1
daemon=1

maxconnections=12
maxuploadtarget=20
rpcuser=xxxx
rpcpassword=xxxx
testnet=1
rpcallowip=52.86.xx.xx
walletnotify=/home/scripts/transaction.sh %s
keypool=10000

transaction.sh:

#!/bin/sh
F=notify_log
D=`date +"%Y%m%d%H%M%S"`
echo ${D} - ${1} >> ${F}

Produces an output of:

20180126015435 - cf59f4c18a80773164c7efdf2a77722099722b3a61274f940aea52cbd600db2b
20180126015435 - cf59f4c18a80773164c7efdf2a77722099722b3a61274f940aea52cbd600db2b

Same TXID, same timestamp. But why twice?

walletnotify will execute every time you either

1.receive bitcoin
2.send bitcoin
3.when a bitcoin gets its first confirmation.

@Dawg are you transfer payment in your wallet it self ?
if yes then OK , if not try to send/receive the payments from other bitcoin node then you can observe clearly ,Cheers


I’ll pay whomever can help me Bitcoin Cash from blockchain wallet to Coinbase wallet with Bitcoin address I've read now a 100 or so questions here with no clearcut answer nor update after they were given advice. I had money in my Bitcoin Cash wallet on Blockchain. I wanted to send the money to my Coinbase account/wallet. No idea how I mixed/messed this up but I accidentally used my Bitcoin wallet address instead of Bitcoin Cash address.  I'm the owner of both accounts/wallets. It shows confirmation with Blockchain that it was sent (52 confirmations). I am too unfamiliar with the process with blockchain and coinbase to understand a lot of what people write as answers. I located the exact "address" that I accidentally used for the transfer from Blockchain to Coinbase. I called Coinbase and they basically said I'm dead water and it's gone (as most of the posts i've read on here state).  Is there a solution?  PLEASE help. >>>>I’ll gladly pay someone to help me figure this out<<<<  whomever can help me get a solution to this, I will gladly and guarantee to send them some of the proceeds

Talk to Coinbase Support center they will surely help you because it's impossible to transfer your credit without there help


What is the signature digest for Segwit outputs (Assume there's no OP_CODESEPERATOR)

For standard P2PKH, the signature digest is generated this way:

NewTransaction

settle the TxOuts well
set all TxIn scripts to empty
insert the Previous Locking Script into the TxIn you are signing
append hash type code to the end of the transaction
SHA256 twice this transaction
Be a digest.

For standard P2SH, the signature digest is generated this way:

NewTransaction

settle the TxOuts well
set all TxIn scripts to empty
insert the Previous Unlocking Script's Redeem Script into the TxIn you are signing
append hash type code to the end of the transaction
SHA256 twice this transaction
Be a digest.

I learned those above from here. As for those above, I have written programs and successfully signed and submitted Bitcoin transactions to the blockchain.

But when it comes to Segwit, I don't know what the digest should be. For P2WPKH output, I tried to use the same method to get the digest as P2PKH, but it failed. Blockchain told me my signature was wrong.

For signatures in P2WPKH and P2WSH spends, the sighash algorithm is described in BIP143.

It is very different from the one used in legacy spends.


Why was the transaction fee more for a 20 mBTC transaction than for a 25 mBTC transaction? I just created a transaction to send 20 mBTC. The transaction fee was more than for a previous 25 mBTC transaction that I sent. Why is that?

I'm using the Bitcoin Wallet App, vers. 5.24 by the Bitcoin Wallet developers.

Transaction fees in Bitcoin are not dependent on the amount of value transferred, but on the amount of blockspace purchased.

When you try to send a transaction, your wallet will select a subset of the available unspent transaction outputs in your wallet to fund the transaction. In this particular case, it could have selected a larger number of inputs to fund the 20 mBTC transaction, and a smaller number of inputs to fund the 25 mBTC transaction. It could also be that the transaction fees just changed significantly between the two transactions which happens almost regularly over the course of the day or week.


I have a old version of Bitcoin QT on Apple Which I think is about 3 years plus old but it was on my old computer which died. I have now recovered the drive at the bitcoin-qt application but it won't run on my current computer either due to the operating system or some other issue. The problem is that I don't have the wallet.dat files as I never generated that back on my old computer, so really need to run the old application in order to generate the file. Any suggestion on how to proceed? Is this an issue of finding an old version of the operating system and run the application file there or what other approaches should be taken?

Any help would be much appreciated

I don't have the wallet.dat files as I never generated that back on my old computer

It's not clear to me what you mean by this. There is only one wallet.dat file (plus any backups for safety). It starts empty when Bitcoin QT (currently Bitcoin Core) first runs, and after that the wallet.dat file accumulates your Bitcoin transactions which determine its bitcoin balance. The transactions are stored in the blockchain, which Bitcoin QT initially downloads from peers on the internet and then subsequently updates whenever it is running.

It seems that you cannot boot from the old drive. Can you access it at all to see and possibly recover files from it?


Is it safe to share bitcoin address and signature generated from electrum wallet Some bitcoin airdrops are asking to prove ownership on bitcoin address by sharing signature.

My question is if one shares bitcoin address and signature is there any risk of a attacker to compute the private key with this knowledge.

Note I am using electrum wallet to generate the signature

My question is if one shares bitcoin address and signature is there any risk of a attacker to compute the private key with this knowledge

While signing, the public key becomes exposed. The primary assumption is "It's impossible to find the private key which relates to a known public key", and this assumption isn't likely to be disproved (in other words, cracked) in the next 10 years.

The process of signing a message to claim airdrops is absolutely safe, as you can move your coins to a different address after claiming your airdrops.

The only risk is your privacy: They'll know how much money you have. If that's an issue, you can just mix your coins after you're done.


Why should a miner choose the longest blockchain if another chain has a higher expected reward? Why did miners/pools choose the longest chain for continuing it?
Because with this strategy they have the highest expected bitcoin reward.
The expected bitcoin reward is (new generated bitcoin (b) + transaction fees (t)) * probability (p) the block will not become orphaned.

Since today b + t is clearly dominated by b and b is kind of constant, today miners maximize p by mining for the longest blockchain. But what about the days when b gets close to 0? Then, right after a completed block, b and t are 0. Thus, a clever miner should ignore the latest block, since even with a small p he will end up with a higher expected reward.

But once miners become aware of transaction fees and will not build on the longest chain this could cause serious trouble? Did I forget something or are these assumptions right?

I think it's conceivable that this could happen. But under realistic cases, I don't think it actually will. If you don't mine on the longest block, the probability that your block will ever be part of the longest block drops drastically. Unless a block you mine becomes part of the longest chain and stays that way, you never get any fees or reward at all.


Pairing pattern of txids in merkle tree For constructing the merkle tree txids are paired and hashed. ¹
But how are these txids paired? Does it happen chronologically or is there a certain pattern of pairing?

Transaction order in the block

Currently, there are only two requirements for the order of transactions:

The coinbase transaction is always first.
Intra block dependencies must preceed, i.e. if Transaction A and Transaction B are both in the same block, and Transaction B spends outputs of Transaction A, A must be listed before B.

It is likely that in the future a correct order for transaction will be introduced, as this will allow proving the absence of a transaction in a block with logarithmic effort, and will allow more efficient block data propagation through IBLT. Right now, transactions are propagated in the network before confirmation, and then again as the content of a block. With a deterministic transaction order and IBLT set reconciliation, each transaction would only have to be received once instead of twice.

Building the Merkle Tree

The transactions are inserted into the Merkle Tree in the same order they are listed in the block. If a block only contains the Coinbase Transaction, the Coinbase's transaction ID is used as the Merkle Root.
Otherwise, a binary tree is created from the transactions by pairing transaction hashes on the first level, then pairing resulting hashes on each next level until only one hash results, which is then used as the Merkle Root. If there is an odd number of hashes to be paired, the last hash is paired with itself.

Further Reading

The Developer Reference has additional details. The image is from the Developer Reference as well, and hence licensed MIT.
Antonopoulos covers Merkle trees in detail in his book, also providing examples of how it is used to prove transaction presence in blocks.


Mnemonic seed BIP 39 HD wallet with vanity address Can we create a mnemonic seed BIP 39 HD wallet with vanity address for LITECOIN, if yes, how?

Yes, this is possible. You will need to create a random BIP39 seed and derive keys/addresses, and check if the address has the pattern you desire. Repeat the process until you find a seed that produces your vanity address.

Here's a solution using Node. Being javascript, this will run slowly, but it's what I know, and it will eventually get the job done.
The script finds an address that has the search term either in all lowercase or all uppercase.

var bip39 = require( 'bip39' );
var bitcoin = require( 'bitcoinjs-lib' );

var searchTerm = 'newb';
var searchTermLower = searchTerm.toLowerCase();
var searchTermUpper = searchTerm.toUpperCase();

// Use a BIP44 derivation path for coin #2 (Litecoin)
var path = "m/44'/2'/0'/0/0";

var words, address, seed, root, i = 0;
do {
    // A value of 128 gives a 12-word phrase, and a value of
    // 256 gives a 24-word phrase
    words = bip39.generateMnemonic( 128 );
    seed = bip39.mnemonicToSeed( words ).toString( 'hex' );

    root = bitcoin.HDNode.fromSeedHex( seed );
    address = root.derivePath( path ).getAddress();

    if ( ++i % 100 === 0 ) console.log( 'Tried ' + i + ' seeds...' );

} while (
    address.indexOf( searchTermLower ) === -1 &&
    address.indexOf( searchTermUpper ) === -1
);

console.log( words + '\n' + address );


Just received a payment twice from coinbase Edit: Looks like the error was with my wallet. When I contacted support, they said to have the wallet rescan the block chain. After doing that, my balance went back to 0.

I'm new to bitcoin, but something happened recently that confused me.

It seems one of two things has happened:

A. I received the same payment twice from coinbase.
B. I managed to completely forget a payment made into my wallet from another source.

Possibility A seems very unlikely... but I did receive a payment in my wallet on the 16th that BlockCypher says occurred on the 11th. (I can show the screenshot if anyone cares.)

Here is the rundown of all the transactions (in order) I know of.

I bought 0.02 bitcoin at coinbase.

On Nov 11 I sent 0.01 bitcoins to my desktop wallet. Transaction here.

On Nov 18 at 13:05 I sent most of that 0.01 to nice hash. Transaction here. (This seems strange to me now... I sent 0.00948.... I would have thought I would have just sent the full 0.01 I got from coinbase.)

Then I decided I would send some more to nice hash, so I withdrew the rest from my coinbase account. Transaction here.

After receiving it in my wallet, I sent everything in my wallet to nicehash. Transaction here. The version of the transaction at nicehash (receiving) is here.

So at this point I had (minus miner fees and such) sent 0.02 btc from coinbase to my wallet and then from my wallet to nice hash.

Then, right after I sent this money to Nice Hash, I see a receiving transaction in my wallet, but it is the original transaction from Coin base... the money I thought I had already sent to nice hash 6 days earlier.

So (as far as I can recall), I only paid for 0.02 bitcoin, and yet I have 0.01 bitcoin in my wallet and I have deposits into Nice Hash for 0.02.

I'm hoping someone who knows how to read the blockchain can indicate where the extra 0.01 came from. Unfortunately, my wallet only shows the two transactions from the 18th.

What I see in the transaction record is a bit different from what you describe.

I see that account 1FT4bog... received 0.01 on November 12th.
That same account spent virtually all of that (0.009292) on November 19th.

I do not see the duplicate transaction you describe.
I do not see that your account received 0.02 or even 0.03.


How are transactions verified with only the Bitcoin address, not the public key? I understand how asymmetric cryptosystems and digital signatures work:

You generate a (private key, public key) pair. You never share the private key, you make the public key ... well, public.
You have a set of functions:

encrypt(public key, plain text) = cipher text
decrypt(private key, cipher text) = plain text
sign(private key, plain text) = signed text
verify_signature(public key, signed text) = is_signature_valid_bool

However, in Bitcoin, the addresses are hashed versions of the public key. There is no way to "undo" the hashing. Hence I'm uncertain how transactions are verified.
I guess the question then is what is actually transferred to whom / stored, when I want to make a transaction. I assumed:

Input Bitcoin addresses
Output Bitcoin addresses
Signature of the transaction with all input address private keys (I guess in order of the inputs)

... but then I don't see how the validation is done. So I assume you sent your public key(s) when you create a transaction. This would explain why you shouldn't use any address again after you spent money from it. The point that confuses me is that I don't see any public keys here
The next unclear thing is the order. Is there an implicit order in which the signatures have to be applied? I assumed this would be done with Script, but I don't see this in the block explorer.
Can somebody shed some light on it?
Non-Answers

How Blockchain transaction verification takes place?: The accepted answer just says "when a node hears about a new transaction, it checks to make sure that the signature is valid". My question is about how this is done without the public key.

When you spend from a Bitcoin address, your transaction includes both the public key corresponding to the hashed address you're trying to spend from, as well as a signature that can be verified with that public key.
Your link is to a block, which is not signed itself. However, let's look at a transaction from your block: https://www.blockchain.com/btc/tx/b8f925d09c647904e428d902c8404fc91e5dbe53773b82d717cf13374785ca20
Scroll down to 'inputs', and under Sigscript, 3045022100c89735ddbb5e231044610590c086d41f1e871067987087ed48e041f8999314830220011deba08ad9a67ddafe51dc530f3f60c8974373bf2f25953a89c139d238216201 is the ECDSA signature, and 023aa5b3f24a2b8fc8f64b69ba383b148892deef94cf060288cc99e81be0f9722e is the public key corresponding to the address.


Holding Period Algorithms and the Blockchain According to this interview, taxation holding periods in the United States for cryptocurrency can be determined by FIFO (First In First Out), LIFO (Last In First Out), or a more flexible option called Versus Purchase or Specified Asset, which allows the owner to declare which specific coins they wish to be considered to have spent.

My question is, do these holding period algorithms have to correspond to the actual UTXOs being spent on the blockchain?  Does using FIFO entail that you have to program your wallet to spend older UTXOs before newer ones, and vice-versa for LIFO?  Does Specified Asset require the owner to actually keep track of which UTXOs their wallet is spending?  These details are otherwise at a level of technical understanding far deeper than what a regular user would need to operate a wallet, and the UTXO choices wallets make are typically chaotic.  Are these details essential to holding period algorithms, or can spent coins specified for tax purposes diverge from spent UTXOs in the blockchain history?

My question is, do these holding period algorithms have to correspond to the actual UTXOs being spent on the blockchain?

This is likely a question best answered by a qualified accountant, or tax lawyer.

I say this because there are many nuances to it: if you spend half of your oldest UTXO, to sell it for cash, then what do we say about the change output? It is a brand new UTXO, but clearly you bought those coins long ago. Similarly, how would the age or origin of a coin-consolidation UTXO be calculated? What about outputs from coinjoin-style transactions? What happens if I just want to update my cold storage system, and want to move coins to new addresses? etc.

I hope these examples help highlight the difficulty of applying existing regulations to a new system like Bitcoin. If you are looking for tax/legal advice, the best course of action is to ask a professional, not a stranger on the internet.

  Does using FIFO entail that you have to program your wallet to spend older UTXOs before newer ones, and vice-versa for LIFO?

A wallet using such a system would be bad for your privacy, UTXO-management, and fee-management, plus it still wouldn't answer the questions I mentioned above. So I doubt that any reasonable regulation would require such a thing.


Can you see live trade data on the blockchain? I am reading a lot about quantum trading, and machine learning, and am looking for data sources to train my algorithms. I an curios to see if there is a way to see live exchanges on the bitcoin blockchain? For example if someone is trading bitcoin for ethereum or vice versa on bittrex, how would I go about seeing all of this data on the chain? I know it exists, but not sure where to look.

Short answer is: No.

Exchanges do not post trades to blockchains, confirmation would take too much time.
Instead they keep funds in their own wallets (often offline) and settle transactions in their systems only using blockchain when a user wants to withdraw cryptocurrency.


Generating a Bitcoin Address QR code with current USD price embedded? I'm creating a Bitcoin QR link with my website, but I want to be able to just link to a page that generates the QR code with the current USD price equivalent of BTC in the QR. I tried blockchain.info, but it only displays the QR code and I can't embed a price into it. How can this be done? I'm trying to use it on checkout where I can pass in a BTC address + USD price to the QR code generator and the user can just pay the exact amount needed without having to lookup how much to pay.

I know bitpay does this, but they also log every transaction to the government. So I rather just use a service that doesn't log anything.

You can't include the USD amount, but you certainly can include the btc amount in the QR code. The QR code essentially embeds a text like this:

bitcoin:1ArmoryXcfq7TnCSuZa9fQjRYwJ4bkRKfv?amount=0.005

Note the amount here is the amount in BTC. You can generate a QR code for that text using gobitcoin.io. If you just want to insert an image, you can use googleapi.com to generate it. For example, a url like this:

https://chart.googleapis.com/chart?chs=250x250&cht=qr&chl=bitcoin:1ArmoryXcfq7TnCSuZa9fQjRYwJ4bkRKfv?&amount=0.005

will generate a QR code like this: