Clarification of BIP32 hierarchical deterministic multisig scripts

OK, I got it working with pybitcointools.

The command, bip32_hdm_script, as one can infer, returns hex of the P2SH redeemscript using the specified BIP32 master public/private keys (which is no different to using mk_multisig_script(pubkey1 pubkey2 pubkey3 2) for a 2-of-3 P2SH). Likewise, bip32_hdm_addr returns the P2SH address one gets from the redeemscript.

The catch is we're dealing with paths and such, and the function has issues with object types.

Let's use master private keys seeded with 0,1 and 2, respectively...

b32mprivkeys = [ bip32_master_key(str(x)) for x in range(3)]
gives ['xprv9s21ZrQH143K2FsoUgfptxnkXbTjWSyu7oPKz2BtJm5yWC8pZMtxbx66FhZoY2e6Fwz2rZ4zPZrgpNJHRd68RtQNcFFVbwGf7Vapo4spoqL',
 'xprv9s21ZrQH143K2r9LvVthYjmsCLwZGpAc4uAAeovjhf7vaAbiunLgRdp8DAo4fSGUMuYQzzGfNGkdsR9xq6vcaKQSTa2VQx7o31N3kxcZi9k',
 'xprv9s21ZrQH143K2AV64RkNhLQEHTphnaGZqrGBhXTw9gBTMfvDAPiKFWpkBmt9otxA2X14bRS6mPdxohX4QCP3PMi8TG7KvCriGcsQHwDHVfT']

Signing with master private keys won't work directly, let's get the master pubkeys:

b32mpubs = map(bip32_privtopub, b32mprivs)

Now, in this example, we want to descend to path 0/1, in a 2-of-3 multisig. This is represented by an int, 2, and a tuple (only!) of the path, so (0, 1).

redeemscript = bip32_hdm_script(b32mpubss, 2, (0, 1)) = 5221029057ffd5c48f95c46c5e12b837cd0e4a7538dfa8ab9eb3479593724a6109ffb4210316776496822873767c6a91efe85a55871fc4a944c1d1ccab52cebd386cef29d4210318ae5429f67dbf61f54ae947f38637f4bffa1e252922b431eeed397cac49a22953ae

Now, we use bip32_hdm_addr to get the P2SH address.

>>> bip32_hdm_addr(redeemscript)
5221029057ffd5c48f95c46c5e12b837cd0e4a7538dfa8ab9eb3479593724a6109ffb4210316776496822873767c6a91efe85a55871fc4a944c1d1ccab52cebd386cef29d4210318ae5429f67dbf61f54ae947f38637f4bffa1e252922b431eeed397cac49a22953ae

Note, FWIW,
>>> bip32_hdm_addr(redeemscript) == scriptaddr(redeemscript)
     True

AGAIN: Do not try signing with master private keys using bip32_hdm_script, lest you return a redeemscript, which when deserialised, gives:

slice(            # we want the privkeys only
       deserialize_script(bip32_hdm_script(b32mprivkeys, 2, (0, 1))),
       1, 4)

See how the keys from the redeemscript are 33 bytes long? And don't start with 02/03/04? That'll make an unusable P2SH address, so beware this pitfall!


what is the size of information contained in one bitcoin?

I want to store one bitcoin in my pendrive and how much free space do I need to store that information?

TL;DR: 32 bytes.

Bitcoins are not pieces of data, Bitcoin is a unit of measure.
To store any amount of Bitcoin in a pendrive you just store a private-key on the pendrive. That is a 256-bit number. It is exactly the same size for 0 Bitcoin, 0.00001 Bitcoin, 1 Bitcoin or for 21,000,000 Bitcoin.
To store the full history, since the beginning of time, of transfers of control of money denominated in Bitcoin, you need about 300GB and growing. But this is public information, you don't need to store it yourself as you can always obtain a copy from other Bitcoin nodes. This data is a journal of transactions called the blockchain.
Of course, you can't really point to any particular place or thing and say Bitcoin are stored there. That isn't really what is happening.

The 32 bytes (256 bits) is the smallest amount of space you will need. If you want to represent that number as printable ASCII or Unicode characters you'll need to choose an encoding scheme like Hex or Base58 etc which will increase the storage requirements.
You can store 21,000,000 Bitcoins in the space needed to store a set of letters and numerals the same length as this example:
E9873D79C6D87DC0FB6A5778633389F4453213303DA61F20BD67FC233AA33262
For convenience you will most likely install a file system such as FAT on your pen-drive. The file system will have overheads and a minimum allocation unit.

1 bitcoin = 100000000 sats 100 sats = 1 bit

Those "bits" are a completely different thing to the 8 bits in a byte.

In December 2017, BIP-176 also proposed "Bits" be used as a standard term for 100 (one hundred) satoshis or 1/1,000,000 (one one-millionth) of a bitcoin.

That's nothing to do with the units of computer storage.
Just like its nothing to do with the "bits" that horse-riders put into the mouths of horses.

not 100 Satoshi, and you cannot store 8 of these in a byte


How to set up a private chain/local testnet : reverse engineering the blockchain code

The question slightly exceeds capabilities of this q&a forum. Maybe better to search bitcointalk.org, there these type of requests get often discussed. Join one of the discussions there!

Anyhow, we need developers, and people with fresh minds.
Here my short shot at bitcoin, because we are in bitcoin q&a forum. You would probably want to create an altcoin of it. For sure the relevant info and link to the code is on bitcoin.org.

To accomplish your goals, you would have to have an idea and sometimes excessive knowledge on the following:

Information Security
Overview of current crypto coin technologies
Finite Fields
Elliptic Curves
Elliptic Curve Cryptography
Signing/Verifying Messages
Parsing Transactions
Signing Transactions
Creating Transactions
Script parsing and processing
Address construction/Private Key WIF Format Construction
Extended Keys (XPriv and XPub)
Parsing Blocks
Validating Proof-of-Work
Difficulty Calculations
Merkle Tree Construction
Merkle Proofs
Network Message Parsing

and maybe

Segwit
Lightning
Altcoin
...

The list can be for sure extended :-) So you choose to go for a steep learning curve. From what I read in your message, I think you are not (yet) there, but that's not an issue. You will probably want to read books like Andreas' "Mastering Bitcoin", and some more. They will bring you up to speed.

If you think of on the environments (like Ethereum or IOTA), I doubt that many devs are here to support.

  1) decide which existing blockchain would resemble the most with what
  i have in mind in terms of consensus algorithm

this is s.th. we can't help you with, as you haven't presented anything. Do you want to use the community's power & efforts to bring your project forward, but don't provide input to the community by hiding your logic and ideas? In general: we are very curious here for new ideas :-)

  2) download if from github

see the links on bitcoin.org

  3) establish a dev environment

You take a linux machine, and install the software, compile it, and see how you go. Alternativly you can try your luck in other OS, but support is way better on unixoide systems. Also the usage of virtual machines is very attractive.

  4) run different tests and let my brain do it’s magic

again, this is up to your mind howto. But there are testcases deliverd with the software, so you can find relevant code for it, adopt it to your requirements, and go.


Recovering LTC coin sent to a BTC address

I sent my LTC to my Trezor BTC wallet. There is a Trezor recovery function that will recover it if it was sent to a Trezor address.

Hope that helps anyone with a Trezor out!


How to understand the first reply of a node

Easiest way to understand the response of other nodes IMO is using Wireshark and follow the below steps:

Install Wireshark

Capture packets according to the network you will be using on this system when Bitcoin full node connects with the network.

Launch Bitcoin Core

Stop capturing  packets once the node is connected to few peers

Filter captured data in Wireshark with keyword "bitcoin"

Check the details of version packet sent by other node

In the middle section you have all the details in readable format and last section is bytes view. Once you select any information in the middle section, relevant info will be highlighted in the byte view as the selected bytes.

According to my understanding, src/clientversion.cpp decides the version message in Bitcoin Core and src/init.cpp helps in sharing this information.
There is one more tool for conversion of such data but I have not used it enough. I think it can be helpful while experimenting with Bitcoin: https://github.com/gchq/CyberChef


How much will I earn by running Bitcoin-Qt?

Transaction fees are earned only by miners.  Running Bitcoin-QT, you will relay transactions and blocks for other people, but this does not earn you any fee.


How much internet traffic and bandwidth does mining with a pool need?

1 Meg Internet can connect 150 S9.  1S9 could use upto 300M per month of data


How do I exchange a cryptocurrency with another?

BTC-e handles a few different alt coins as well as BTC, USD and EUR.


Is mining difficulty leveling out (Spring 2015)? How does this affect the economics of Bitcoin?

It's pretty easy.
The first asics where based on 90's technology, current asics are almost cought up now to recent chip technology.

So the asic industry has camped 15 years of tech advancement into 2 years.
Every couple of months the new asics where more than twice as fast. That caused the rapid hash increase.

Now that they are caught up with current tech we will go back to 10% efficienty increase per year again. Like in the gpu days. Back then the difficulty raised very slowely because gpu's also had a 10% efficienty increase per year on avarage.
When gpu's came to the scene you saw the same rapid growth that flattned again when everybody had switched to gpu's. The only reason it was just a short period is because retail gpu's where allready in line with the chiptechnology of the time.

Now that asic efficienty improvements are in line with the industry the only way to increase hashpower is to have more machines instead of ever faster machines.

All that you are seeing is growth in hashes per watt flattning out, and with it difficulty growth flattning.


How does Ripple synchronizes its ledger?

There are two separate issues. One is initial synchronization assuming you don't know anything. The other is how servers advance the ledger in synch.

For initial synch, you monitor the network and watch for signed validations from validators you trust. You check the timestamp on them and if they are current, you can then begin tracking the ledger chain. Once you know what they are claiming the current ledger is, you can fetch any data you're missing, walk the hash chains and transactions, and convince yourself that the ledger they are claiming is valid is in fact justified by the transactions attached to it and that it hooks up to your last ledger, if you have one.

Once you are in synch, you can participate in the consensus process. You will see live transactions relayed, you will see proposed transaction sets, you can send your own proposals. When you see a consensus on a transaction set, you apply it to the last ledger, and you then have the next ledger. You can then sign it and send a validation.

The actual timing of the ledger close is a bit complicated. If there are no transactions, a ledger will typically close every 20 seconds. If there are any unconfirmed transactions, the ledger will close two seconds after it opened and the network will try to form a consensus on them. This two seconds gives nodes a chance to finish processing the previous ledger before they need to start processing the new one.

The actual synchronization occurs using a sophisticated delta algorithm. The ledger is a tree so if a branch hasn't changed, you will discover that without having to traverse that branch. Ledger nodes that you need can be fetched from the network and servers will also predictively return nodes they think you will need based on the nodes you said you did need.

For initial fetching of large amounts of history, the server can request a "fetch pack" from any server that has the history. This contains those ledger nodes the server knows are unique to that particular ledger and help to reduce the number of queries needed.

All validated transactions, all ledgers, and all states the network has ever had form a giant hash tree. Once you know the hash of the current ledger, you can walk the hash tree to find any of those things securely and provably. Validations are not in this hash chain though. They are stored separately and individually signed.


How could a time warp attack be prevented?

The simple solution is a soft fork that requires each block's time be equal to or greater than the time of the previous block on the block chain.  That is, time on the block chain can't go backwards.

If time can't go backwards, then the attacker can't artificially lower difficulty except by mining blocks with times in the future, and the network already rejects blocks more than 120 minutes into the future.

This proposal is a soft fork because non-upgraded miners will accept a more difficult chain whose times only increase or stay the same.  If implemented the same way as BIP34, the supermajority of hash rate would be upgraded before the new rule was applied, minimizing disruption.


Those tagged addresses are only for blockchain.info. They are not part of the Bitcoin blockchain, they are local only to blockchain.info. So you would need a service like blockchain.info that maintains a database of addresses that are tagged, but those tags would only apply to that service only. AFAIK, there is no such service.


Can I get the wallet in bitcoind to use P2SH segwit (on testnet)?

addwitnessaddress is what you want

create it, fund it and spend coins from it - then check your transactions on any blockexplorer that they are in segwit format


For the next time:
Start using a wallet that uses native SegWit addresses bc1.... If you had been spending from a bc1 address and had paid the same feerate your transaction would have confirmed instantly.


By current agreement Segregated Witness will only activate after it reaches 95% of the miners signaling readiness.

Sending Segregated Witness transactions before that would be foolish, as if they were to be included in a block, anyone would be able to spend the outputs before Segregated Witness is enforced. They are however, non-standard to current versions of Bitcoin Core.

If the 95% threshold is not achieved for an extended period of time, there might be a proposal to lower the threshold.


Why don't bitcoin nodes invalidate new blockchains that don't contain all the data of the old blockchain?

The problem with this proposal is that it relies on data that is external to the blockchain (namely, data that is in another branch of the chain).
The validity of a block should be a function only of its contents, and the contents of anything the block commits to through hashes. Specifically, that includes all ancestors of the block, as the block header contains the hash of the parent block, and so on. This means that nodes can independently determine validity, without needing assumptions about what data is available to whom.
More concretely, your proposal has the following problem: there is no "initial" chain, and "replacement" chain. Some nodes will see one first, and others will see the other first. This happens normally, when a single-block fork appears due to two blocks at the same height being found approximately simultaneously. It also happens during initial synchronization with the network: a node could be connected to an attacker who provides a rewritten chain first, and only later connects to an honest node that gives the "real" chain.
In both these cases, the rules must be so that eventually all nodes agree on which chain is the real one, or at least the probability for disagreements to remain should decrease over time.
If you require that a replacement chain contains all transactions the original chain has, then nodes who saw "the other" chain first will always reject the real one, as from their perspective, it is the real chain that is trying to replace the chain they already had.
And as forks occur naturally, this would be a disaster: if two blocks are created at the same height, with different transactions (as there cannot be any guarantee that two miners in different geographical locations have identical mempools; this is simply a result of the finite speed of light), nodes that see block A first will reject B as an invalid replacement, and nodes that see block B first will reject A as an invalid replacement. The result would simply mean that any network fork becomes permanent, and the network no longer converges.


Security wise what stops me from canceling an unconfirmed transaction?

So what stops me from doing the same thing with bigger, riskier transactions?

Because anyone accepting a bigger, riskier transaction should know enough to wait for at least a single confirmation.

Restaurants and stores all know that they will be subjected to a certain amount of theft and fraud, but since the amounts are so small, it's mitigated by their business volume.  Preventing easily-fraudable transactions from getting too high is the reason credit cards and debit cards have limits.

If you were to buy a house, however, you'll notice that the means of payment is a much slower and complex process than it is to buy a sandwich.  You don't just swipe a card at the realtor's office and walk out with the keys to a house.

Bitcoin isn't much different.  A zero-confirmation transaction is enough for a barista to hand you a cup of coffee, but not enough for someone to let you drive off with a new car.  For that, they would make you wait for at least one confirmation (about 10 minutes with a proper fee) or for 6 confirmations (60 minutes with a proper fee).  I should point out that this is still much faster than traditional financing in these situations.

Once even a single confirmation has occurred, it will now cost you a non-negligible amount of money in hashing power to reverse the transaction.  Every new confirmation compounds that amount.  In other words, unless the transaction is extremely large (think government budget sized), you would be losing money by attempting the fraud...and it wouldn't even be guaranteed to work.

In short, your own incentives prevent you from attempting fraud.


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


bitcoin-cli commands like createrawtransaction not working with json on command line

When looking at the Bitcoin Developer Reference I saw an example where they use two additional '' before and after the list of inputs in comparison to you. For your input, I also got "Error parsing JSON", but with

bitcoin-cli -testnet createrawtransaction '''[{ "txid" : "12b8e7ede4992f4d30f93idj3085746951d945e39f40becebd7c290af8c2e7ad", "vout" : 0 }]''' '{"mxh3H416KCRoBDiweSESew5YJyAk1nxLrN": 0.025, "mkrzDhhZtzQm8zgckSs4fMNrvtNJ66zaFe": 0.0245}'

it parsed correctly.


Fingerprinting Bitcoin client, from public information

Disclaimer: I should probably add this as a comment because it doesn't answer the question, and just gives a one pointer. I can't add comments yet

The OpenBitcoinPrivacyProject is constantly working to gather as much information of new types of attacks on privacy.

You can search in their github page how do they test for wallet privacy.

https://github.com/OpenBitcoinPrivacyProject/wallet-ratings/blob/master/report-02/threat%20model.wiki

I think this pointer is relevant because one of their tests try to detect just what you are looking for.

  A blockchain observer can derive the type of wallet used to create a
  transaction by observing idiosyncrasies in the manner in which the
  transaction was composed.


Does Armory work with a pruned copy of the blockchain?

No, you'll need to make space for a full copy of the blockchain somewhere. AFAIK, Armory rescans the blockchain in order to build its own database only after Bitcoin Core has fully synchronized. Therefore, Armory needs access to a full copy of the blockchain which is currently about 118GiB. Armory's database itself then will take more than 20GiB additionally.


Multiple input address to a single output address in one transaction?

can I send BTC from A1 AND B1 to B2 in a single transaction thus
  incurring a network fee only once?

Absolutely. A transaction may contain multiple inputs and multiple outputs. The trick will be to get the wallet to do this for you. It will need to be aware of both address's private keys, and be able to let you select which inputs to use. Alternatively, you could construct the transaction manually.

See http://en.bitcoin.it/wiki/transaction


This looks like a bug in Electrum's software.

What you can do is manually convert the encoding to match Testnet's encoding.

Go to http://lenschulwitz.com/base58 and enter the master public key into the Base58 Decoder
Take the hex and change the first four bytes (first 8 characters) to match the testnet prefix: 043587CF.
Remove the last 4 bytes (last 8 characters) from the hex string.
Copy the modified hex and go to http://www.fileformat.info/tool/hash.htm. Enter the copied hex string into the Hex String field under Binary Hash and click Hash.
Scroll down and copy the SHA256 hash. Enter that copied hash into the Hex String field under Binary Hash and click Hash.
Scroll down and copy the first four bytes (first 8 characters) of the SHA256 hash.
Append the four copied bytes onto the end of the modified hex string from earlier.
Enter the full modified hex string (with changed prefix and changed suffix) into the Base58 encoder on http://lenschulwitz.com/base58 and Encode it. The result will be a tpub which is valid.


It seems that this functionality has not been implemented yet in Multibit. The only way to check individual balances is to via blockchain.info.  A real pain if you have 100 addresses.

Also it's not possible to specify which addresses to spend from when making a transaction from a wallet that has multiple addresses.  So need to have multiple wallets with loads of passwords - torture.

It is supposed to be possible with Bitcoin to use addresses once and then discard them.  But with multibit this isn't feasible yet in practice.

These features will come soon either to Multibit or another wallet.  They are badly needed.


How much Bitcoin volume is for purchasing stuff versus trading/speculation/investment?

It's been estimated (with many assumptions) to be somewhere around 1-4% of the total trade volume. This seems bad until you learn that the speculation market for USD is $5 trillion a day.


C-lightning does not save logs by default. One can ensure that the logs are saved to the drive by including log-file=<file_name>.log in the config file. When staring lightningd you can include the level of logs that the file has to capture by including --log-level=LEVEL, where LEVEL can be io, debug, info, unusual, or broken.


Why does blockchain.info report "Estimated Confirmation time" not as 10 minutes?

You're correct; the expected confirmation time from any given point in time is always around 10 minutes (it may be a little more or less when the network hash rate has changed since the last difficulty adjustment). This question looked at that exact issue.

Note that a retailer (or other transaction acceptor) doesn't necessarily need to wait for a block to be solved in order to accept a payment though. More info here:

How has the problem of waiting for confirmations been eradicated?
How do I safely accept bitcoins without waiting for confirmations?


Generate Bech32 addresses to receive customer funds

As I currently understand it, older clients will not be able to send to a Bech32 address. Is this the case?

Yes. Bech32 addresses are a completely new address type and format. Because it is new, many clients currently do not have Bech32 support implemented or have not yet released a version supporting it.

  It sounds as if I should be creating P2SH-P2WPKH addresses for accepting deposits.

Yes. For maximum compatibility, you should use P2SH-P2WPKH. Later you can transition to using Bech32 once more wallets implement support for Bech32 and it becomes widespread.


Why is BIP-147 (Dealing with dummy stack element malleability, part of segwit) necessary?

BIP 11 is not a consensus rule, but a recommendation on how to use multisig on the network.

BIP 147 is correct in describing the existing network consensus rules: OP_CHECKMULTISIG and OP_CHECKMULTISIGVERIFY pop one element more off the stack then needed, and ignore that element. BIP 147 changes the rule to make these opcodes not ignore the element, but require it to be a 0. To be compliant with BIP 11, transactions already had to put a 0 zero there, and in practice everyone always has. But there was no requirement that transactions follow BIP11 - it was just a recommendation for better interoperability. With BIP147 it becomes required to have a 0 there for every transaction to be valid.

The reason for changing this is malleability: currently, anyone can take a valid transaction that uses any of these opcodes, and take the 0 and replace it with anything else, without invalidating the transaction.

Ideally, we would want to fix the bug entirely, and make OP_CHECKMULTISIG and OP_CHECKMULTISIGVERIFY  not pop off an unneeded stack element. However, that would be backward incompatible, and thus only apply to new transactions if we don't want to break existing software. The approach in BIP147 applies to all multisig transactions.


There was a longer discussion thread in bitcointalk, I proide two references:

https://bitcointalk.org/index.php?topic=2333913.msg23758008#msg23758008

https://bitcointalk.org/index.php?topic=1682183.msg21389041#msg21389041

(Both threads are worthwhile to read in it's entirety).
In short: before nodes talk to each other, they verify the capabilities. And a segwit node would reduce the information for a non-segwit node, so that he can understand the transaction details.


When you set up a trade on Shapeshift, you presumably pick which currency you wish to purchase, and what currency you pay with. You would then provide your withdrawal address to be credited in the purchase. Given that you have received an email that tells you that your purchase went through, I would expect that the bitcoin were sent to the bitcoin address that you provided when you set up the purchase. Check whichever wallet you copied your address from.


Is it possible to run bitminter on 2 computers with one account?

You can use separate worker accounts if you want separate statistics for your machines. Otherwise just run all of them under one worker account.

If some of your workers are slow they may show as zero hashrate at the website. This is because pool websites estimate your hashrate based on how often you send in proofs of work (aka "shares"). For slow workers this does not happen very often and the website is unable to make a good hashrate estimate. As long as you see the worker statistics for accepted proofs of work going up everything should be fine. View the worker stats, wait a while, refresh the page - if the stats went up, it is working.


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

A fee may not be required at all, if the priority of the transaction is high enough. Generally 1 BTC, one day old, is enough age and balance that you can send without a fee.
If any of the individual payments are below 0.01 BTC, a minimum fee will always be required.
The minimum fee, when required, is 0.0005 BTC per 1000 bytes of total transaction.
The contribution of each input and each output to the total size is somewhat consistent, it only varies largely if there are compressed keys (standard for newly generated addresses on a recent client version), some examples:

A) 1 input/1 output (sending exact balance of one input) = 191 bytes
B) 1 input/2 output (sending money from single input with some change) = 258 bytes
C) 2 input/1 output (consolidating two address balances to one output) = 404 bytes
D) 12 input/2 output (sending from many inputs with change) = 1851 bytes

The easiest way to empty a wallet is to attempt to spend the entire balance with the transaction you desire, attempt to send it, and look at the "exceeds your balance after a 0.0xxx fee is included" message. Subtract the fee from the amount you are sending, and you should now be sending the entire wallet balance including the fee.


What is a good mining pool/payout model for infrequent mining?

There are multiple approaches to pooled mining, each with its own benefits and detriments. Assuming you are a dedicated miner who does not pool hop then the scenario you describe should be an "edge case" that should rarely if ever occur. That said, common payout schemes include:

PPS - Pay Per Share. Each submitted share is worth certain amount of BTC. Since finding a block requires  shares on average, a PPS method with 0% fee would be 50 BTC divided by . It is risky for pool operators, hence the fee is highest.
SMPPS - Shared Maximum Pay Per Share. Like Pay Per Share, but never pays more than the pool earns.
ESMPPS - Equalized Shared Maximum Pay Per Share. Like SMPPS, but equalizes payments fairly among all those who are owed.
CPPSRB - Capped Pay Per Share with Recent Backpay.
Prop. - Proportional. When block is found, the reward is distributed among all workers proportionally to how much shares each of them has found.
PPLNS - Pay Per Last N Shares. Similar to proportional, but instead of looking at the number of shares in the round, instead looks at the last N shares, regardless of round boundaries.
Score - Score based system: a proportional reward, but weighed by time submitted. Each submitted share is worth more in the function of time t since start of current round. For each share score is updated by: score += exp(t/C). This makes later shares worth much more than earlier shares, thus the miner's score quickly diminishes when they stop mining on the pool. Rewards are calculated proportionally to scores (and not to shares). (at slush's pool C=300 seconds, and every hour scores are normalized)

The important factor is that you avoid Proportional payout systems as they are vulnerable to pool-hopping so you will probably lose some portion of your revenues to hoppers on those pools. For your concerns, SMPPS, ESMPPS or PPLNS would be good choices, but there are other factors to consider and it is ultimately up to you to choose a payout scheme and pool that best fits your needs.


Can anyone without knowledge of encrypted tech use bitcoin?

If you just want to use Bitcoin, it is no harder than using a credit card or online-banking. I suggest reading up on some safety best-practices in order to protect your funds, and to use two-factor authentication.

We have put together a collection of frequent questions new users ask. It is to be found here: I am new to Bitcoin, how can I get started?.
It is essentially a bunch of pointers to yet other questions, but should help you find answers to questions that you are concerned with now. Don't worry, you don't have to read all of them at one time or even at all.

If you want to understand how Bitcoin works under the hood, it is more complicated. However, when you think about it, so are credit cards and online-banking. ;)


CPU Mining with a large EC2 cluster - worth the effort?

CPU mining for Bitcoins is almost never worthwhile since the advent of GPU mining. If your EC2 instances are free you're welcome to try but there's a better alternative.

A decent CPU won't get you but 3-5 MH/s of Bitcoin mining power, which at current difficulty and exchange rates will net you about 0.0046 BTC per day (worth about a penny at current rates). On the other hand, that same CPU will net you perhaps 3 kH/s of mining power on one of the sCrypt based forks, I'll use Litecoin (LTC) for this example. Mining LTC on that same CPU will net you about 3.06 LTC per day which, at current exchange rates, will net you about 0.0153 BTC, worth about 4.5 cents per day. It's still not a lot, but at present CPU mining on CPU-friendly forks is much more profitable than CPU mining Bitcoin directly.

As for whether your 50 c1.medium instances would be worthwhile, if (for the sake of easy math) we assume each can produce somewhere in the neighborhood of 2 kH/s of Litecoin mining (decent guess, a 1 MH/s BTC CPU tends to put out about 1 kH/s on sCrypt based variants) then that's a combined 100 kH/s worth about 102 LTC per day, 0.51 BTC per day, or about $1.53 per day. Since I'm assuming the cost of 50 c1.medium instances is more than $76.50 per month, I don't think it would be worthwhile for dedicated mining. If, on the other hand, you already pay for these instances for other purposes and the addition of mining is essentially "free" then an extra $76.50 (or 25.58 BTC) per month isn't too bad.

Finally, yes, all fifty of your instances could work together on a single account in a mining pool. This is so common it actually has nomenclature: each of the running instances would be called a "worker" and while some pools allow you to create many workers, that's really just for your own stat tracking and isn't necessary at all. Each instance can certainly submit shares under the same account without error.


How are transactions collected into new block?

The mempool as it is called, stores transactions that are propagated by the peer to peer network.  Miners have the ability to select which transactions they include in the block.  It is beneficial for the miners to collect as many transactions as possible so they can obtain the most amount of fees that they can.


Can the Bitcoin network be used as a timestamping service?

Yes, the bitcoin network can be used as a timestamping service

Here is an article about it
https://www.strongcoin.com/en/blog/using_the_blockchain_as_a_trusted_timestamping_service

Here are additional instructions:
https://bitcointalk.org/index.php?topic=52715.0


How to check where I recently sent some Bitcoin Cash using Copay wallet

how do I check where I have sent them?

View Recent Transactions.

If they are not there, you may be able to refresh the history from the Copay servers

  "Settings" > "Wallet" > "More Options" > "Transaction History" > "Clear cache"
  "Settings" > "Wallet" > "More Options" > "Wallet Addresses" > "Scan addresses for funds"

You can paste the address or transaction ID into any BCH clockchain explorer (example) to check another view of the transaction in a different copy of the blockchain ledger.


Could BitCoin network be destroyed if blockchain would get corrupted?

The answer would likely be no.

Since blockchain is anyone that has fully synced so it would take the attacker for a long time to destroy every single one of the blockchain. Bitcoin node also can reject an bad data (and temporary ban them) so that it does not mess up the blockchain.

Even if attacker managed to attack it, bitcoin core developer would likely to update their bitcoin core for a higher security before attacker can even finish attack all the blockchains.


You get this error because Bitcoin has tried to validate the script, and failed, because not all of the signatures necessary were added in the previous signrawtransaction. You can also tell this because complete is false.

You need to take it to clients that have the other keys necessary, and run signrawtransaction on the transaction there too.


Can I download blockchain updates from somewhere?

There's not, keep your client open or use a 3rd party wallet which doesn't require you to run a bitcoin client (blockchain.info wallet or coinbase)


How does a miner verify a transaction which is spending an output of another transaction in the same block?

While a miner is building a block template, they are maintaining a "virtual" UTXO set to keep track of the consumed UTXOs and the newly created UTXOs. A transaction can only be included in a block once all of its inputs are available for spending, so this approach is also sufficient to achieve the required topological order of transactions.


How to test bitcoin distribution mechanism

As Nate Eldredge suggest, you could use the Bitcoin Testnet. This is a separate Bitcoin fork that exists especially for testing purposes.
You can easily get some testnet coins from testnet faucets.

Besides that, do you know that it is possible to create a transaction with multiple inputs and multiple outputs? So instead of creating many transactions, you could combine them into one transaction and only pay the fee once.


Cryptocurrency with small block size limit or large block time

I am not aware of any cryptocurrency that has block times of greater than 10 minutes, but I am very familiar with the desire to limit growth of the block chain.

Monero recently increased its block time from 1 to 2 minutes in part for the reason you mentioned (but also in part to reduce the # of orphan blocks which occur more frequently when block times are very short)

Monero uses an adaptive blocksize that automatically scales based on blockchain usage.

https://www.reddit.com/r/Monero/comments/45b8qn/my_journey_to_finding_monero_and_some_questions/czwlcdb

A quadratic penalty is imposed such that block subsidy = base subsidy * ((block size / median size of last 400 blocks) - 1)², with the penalty being applied after you build a block larger than the median size. The maximum block size is 2*median size. Because subsidy is based around the number of coins in existence, the 'burned' subsidy is deferred to be paid out to future blocks.


Can malicious payer deanonymize payee in Zcash?

tl;dr Alice can reveal payments she made to Bob. She cannot reveal payments that others made to Bob, or reveal what (if anything) Bob does with the ZEC that Alice sent.

Revealing the pre-image of the note commitment only proves that Alice knows the pre-image. It does not prove that Alice sent the transaction, because the proof is replayable: once revealed, anyone can take the randomness and note data, and show it to someone else.

In order for Alice to prove to someone that she sent the transaction, she can do the following:

Write a message that contains:

The private key esk used to encrypt the note (randomness and value) to Bob.
Bob's payment address.
A challenge string chosen by the person Alice is convincing.

Sign the message using the private key joinSplitPrivKey corresponding to the joinsplitPubKey that was originally used to sign the transaction.

The signed message is proof that Alice currently has access to joinSplitPrivKey (because the challenge string is fresh). Assuming that joinSplitPrivKey is never revealed, Alice is indistinguishable from the person who created the transaction (i.e. either she or someone with her spending keys made the payment). This is what we call a payment disclosure, and is how e.g. you would prove to an exchange (or a third party dispute resolution service) that you did indeed pay them.

What you are describing is fundamentally the same issue that messaging apps have with end-to-end encryption: someone with intended access to the data can accidentally or intentionally reveal it. Removing this potential privacy leak would by definition mean that Alice cannot see some or all details about her own outgoing transactions, which is either a contradiction (in the Zcash model, Alice needs to be able to calculate a commitment from its pre-image in order to create valid transactions), or a completely unusable payment system!

Note however that even though Alice can prove that she sent a transaction to Bob, she cannot reveal anything about what Bob does with the note he received (because she does not have Bob's spending key, and thus can't calculate the nullifier that will would be revealed at spend time). Alice's ability to reveal information is limited to information she was ever able to view.


Is the process of indexing transactions by assigning a transaction id necessary, or is it a scalability issue?

The reason you have to explicitly state which previous outputs should be claimed by a transaction is simply that you do not want to give users on the network a blank cheque. Say you wanted to transfer 1 bitcoin to from any output available to address A to address B. You would then create a transaction that looks like this:

amount=1|to=B|sign(amount=1|to=B, sign_with=A)

This transaction would be broadcast to the network and result in the desired result. The main problem is that if you have more than the 1 bitcoin you'd like to spend, there is nothing to prevent the owner of address B to create more transactions that give him all of your bitcoins.

The second problem arises with the change from that transaction, if you do not have outputs that sum exactly to 1 bitcoin, you implicitly create a new output for the change. This brings us to the last problem: picking outputs to spend may not always produce the same outcome. If there are multiple combinations that the new output to B can be constructed then nodes in the network would have to agree on which outputs to spend, which again would require transaction IDs.

Having the owner of the coins specify which ones to spend simplifies all these problems.


How many confirmations is enough if block creation rate is volatile?

Shorter answers:

The number of confirmations you "should" require for a transaction is entirely up to you.

OK, that's not particularly helpful, I know.  For me, looking at the current environment, I'm not planning on doing anything that would justify forcing a wait for any more than 2 confirmations under normal circumstances*.

The level of security that you get by waiting for n number of confirmations is basically constant.

If at some point in the past, you made an informed decision that n number of confirmations was "good enough", then n should be just as good enough today, possibly better.

Longer answers:

When I make the claim about 2 confirmations, I'm betting against the existence of an entity X who would be able to make the following sequence of events happen (YMMV):

X sends me some number of Bitcoins in a transaction that spends some output A.
That transaction is included in a block accepted by the network at height h (confirmation #1)
A block is accepted by the network building on top of that one at height h+1 (confirmation #2)
I do the thing that entity X paid me those Bitcoins to do.
An alternative chain of at least two other valid blocks, including heights h and h+1, is announced to the network and spends output A to some other place, probably owned by X.
The newer chain is built upon (most likely, but not necessarily, by X him/herself: miners, especially those that got the coinbase rewards from the honest chain, will tend to work on the honest chain for no other reason than it's what they saw first), locking in the double-spend.

Building off the previous note, n confirmations sets the bar for being able to successfully pull off a double-spend attack at a level that increases exponentially with n.

If I think it's unrealistic to expect someone to be able to reliably and cost-effectively do this under normal circumstances* at n=2, requiring n=3 feels a bit paranoid, and don't even get me started about n=6.
Furthermore, even if someone were capable of doing this, they would have to stand to gain more from their victims than some significant proportion of the block rewards before even attempting it.
The opportunity cost of a failed attempt is the sum of all the block rewards that the would-be attacker could have received if he/she participated in the network honestly.

Some thoughts about major hashrate increases and lucky bursts:

Even if the network hits an extremely lucky streak and several blocks are mined in the course of a very short time, the expected amount of work it would take for an attacker to reverse a buried transaction stays the same.  In this way, lucky streaks (and overall increased hashrate) by honest nodes actually increase security, whereas lucky streaks are required for an attacker with <50% of the network hashrate.

Where an increase in network hashrate becomes a bigger concern is when this increase tends to favor a single entity (which could itself be a group of entities).  As this entity gets a higher and higher share of the total network hashrate, reversing transactions buried 6 confirmations deep in the chain becomes a more and more realistic proposition.  According to the calculation from Satoshi's original whitepaper, an attacker with 45% of the network hashrate would have a 30% chance ((.45 / .55) ** 6) of being able to "catch up" from being 6 blocks behind and reverse your supposedly "confirmed" transaction.  So, on average, with those odds (which are high enough to make a lot of people on-edge), this attacker would have to stand to gain more than 70% of the rewards from 6 consecutive blocks in order for this attack to be worth it.

Why is n=6 the recommendation?  I don't know.  My out-of-the-blue guess is that this made a lot more sense back at a time when someone with a lot of extant general-purpose CPU/GPU power could more easily generate blocks than today.  Today, since so much of the honest network hashrate is running specialized computing devices (ASICs), the network hashrate has risen so dramatically that it's unfeasible to expect there to be an untapped reserve of computing power that can come out of the blue and overtake the network at large (which is why I've said "possibly better" above).

Why would MtGox wait more than 6 or even 8 confirmations before accepting incoming transactions?  I don't know, but it doesn't surprise me; that organization never really struck me as having a deep understanding of Bitcoin, despite how important it was to their business and despite the apparent fact that they were running bitcoind with in-house customizations.

*Normal circumstances assume there's no network anomaly going on like the hard fork of March 2013, we're not talking with HUGE transaction volumes, and I have no reason to believe the major mining pools are collectively out to get me.


How to figure out litecoind has finished synching the chain?

Try $ litecoin-cli getblockchaininfo

Note: "There is no way for checking whether syncing is done, simply because it isn't known." See https://bitcoin.stackexchange.com/a/10443/60443


How to test 12 words passphrase for a Bitcoin address?

By passphrase I assume you mean the mnemonic.

If your wallet software supports creating multiple wallets, you can just make another wallet and just use the same mnemonic. Instead of creating a new wallet, you restore a wallet from the seed. To your software, it will be another wallet because it is stored in a different file.

Or you can download another wallet software and restore your mnemonic to a wallet with that other software. Note that that wallet must support using a mnemonic and uses the same format. Most wallets use BIP 39 mnemonics, however Electrum does not so you cannot restore an Electrum mnemonic to another wallet.

You should see the same addresses either way.


Bitfinex - Market order that uses all available

This is a shortcoming of the Bitfinex API.  For example, say you have 0.5 BTC and you'd like to buy as much ETH as you can with it, you need to calculate how much ETH it might work out to and then pray the order book doesn't change between the time of your calculation and the time of the order. The feature to use all available funds isn't a good solution.  Imagine you have 1 BTC but only want to use 0.5 BTC to buy ETH.

Instead, Bitfinex needs to change their system to allow the user to specify the amount of the currency they are using to market buy with.  Or, reverse the tickers so that ETHBTC becomes BTCETH when trying to market sell BTC for ETH.


Is it true the genesis block reward can't be spent forever?

There is no technical constraint causing the genesis block's reward to be unspendable forever.

It is a bug that has now become the accepted standard.  In the future the genesis block reward could be spent but clients must be updated to fix this bug or they will reject blocks containing a valid input referring to this transaction (4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b).

Other clients outside of bitcoind, like btcd, also mimic this bug so they don't risk a fork if Satoshi ever decided to spend these coins.  Seeing that Satoshi isn't around much fixing this bug isn't exactly a priority and there is a good chance that this might never be "fixed".


Cryptocurrency with addresses that cannot collide?

"My question is, what is the solution to this going to be?" there is no solution. it is by design that collisions can be found. i really think that people who are searching for collisions are using their computing power quite inefficient because the gains are probably very small. so mining would be more profitable.


Bitminter - no rewards when more work was done?

When a block is found the 10 latest shifts get paid. Finding blocks is a random event. Sometimes we find the next block quickly, other times it takes longer.

Sometimes it happens that it takes a lot of work before the next block is found by the pool. With PPLNS what then happens is that some of the work is not paid at all. The opposite happens when many blocks are found in quick succession. The same work gets paid many times and the pay is extremely good. Over time this evens out.

This is the nature of mining. If you were mining solo instead of in a pool the variance would be much greater. You could find a block and get 25 bitcoins after a few seconds. Or it could take you several years.


Yes, you are right. There are no "coins". There is only an ability to write some data (transactions) into one global file (blockchain).

But it is possible sometimes to track who is an author of transaction. For example, I am buying something in online shop (with delivery) and paying bitcoins for it. Now the shop knows my name and my address (for postage). The spending transaction has a "change address". If I use the same address for change - the shop owner would also know (with some probability) the amount of bitcoins in my wallet! Some people may think that this is not good, especially if they have large amount of funds.


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.


jsonRPCClient.php states its served a 401 error response

I think this is related to this open issue.

https://github.com/bitcoin/bitcoin/issues/9661

I was running bitcoind on Ubuntu 16.

I had the similar issue when I had rpcuser and rpcpassword in the config file. All I got is 401 error when I called the jaon-rpc api.

I found a workaround by providing -rpcuser=REPLACED -rpcpassword=REPLACED when I launched the bitcoind.

Hope this is useful.

One more thing, instead of debug from your rpc client in PHP. Maybe try it with curl first. HTTP 401 clearly is an authentication issue, using curl is much easier for debugging.


A crypto-currency for supporting informal education?

It is possible. However, there are a few difficulties. Normally, cryptocurrencies are based on a proof-of-work (PoW) scheme which involves computing data which is hard to find but easy to verify. A collision-resistant hash function such as SHA-256 or Scrypt is an example of this, and is used as PoW for a majority of existing cryptocurrencies. Unfortunately, there isn't really a cryptographic way to verify that someone has been legitimately tutoring for a period of time, so the currency will have to be issued by a central authority (i.e. you).

This means that you will have to hold a significant portion (perhaps all) of the coins in the beginning (in cryptocurrency circles, this is called a "premine"). If you hold all the coins, then you would be well-advised to choose proof-of-stake (PoS), where people leave their wallets open and are rewarded coins at a rate dependent on their current holdings (called "minting"), which incentivizes people to secure the network. (Otherwise, there would be no miners to process transactions since there's no incentive to do so, and the coin would be dead.) Alternatively, you can premine something like 10% or 50% of the coins, leaving the rest to be mined just like Bitcoin or Litecoin on a decreasing schedule. Here PoW miners are willing to secure the network for you because of the block rewards.

The issue with premined cryptocurrencies is that many people don't trust a single entity with all those initial coins, so they are unlikely to gain much value. Thus your tutors might not be willing to work for essentially worthless coins. And besides, since you're going to have a lot of central control due to your premine, you might as well just create an in-house currency, kept track of on your servers, rather than a cryptocurrency. Maybe eventually have a online store where users can buy stuff using that currency.

Another alternative is to ask for Bitcoin donations (possibly from the students), and then pay tutors with that (or even have students tip tutors directly).


What is my goal | Objectives when mining?

Basically, you are solving a puzzle. A puzzle is to come with a nounce(number) which when added with the block header and hashed, hash should start with some number of zeros.

Higher the number of zeros, difficult it is to come with the nouce for the given block header. According to the current hash power in the network, network adjusts the difficulty.

Implementation would look something like this:
1) Generate block header for the given set of transactions
2) Get the current network difficulty level ( number of zeros hash should start with )
3) Plug in random numbers so that : hash( nounce + blockheader ) starts with given number of zeros
4) Form a block and include nounce in the blockheader ( So that other node can verify your work )


Why do you use Bitcoin addresses instead of public keys?

Yes, you could send bitcoins directly to the public key: in fact, both Pay-to-PubKey (P2PK) and Pay-to-PubKey-Hash (P2PKH) were introduced in the first Bitcoin release.
IIRC, P2PK is still used for Coinbase transactions sometimes, today.

P2PK transactions are slightly bigger for outputs but significantly smaller for inputs.

One advantage of P2PKH is that addresses are shorter than public keys. This allows addresses to be represented with 34 characters in Base58check.
If there were a standard to present public keys in Base58check, they'd probably have 51 characters. Arguably, it is easier to type a character jumble that is only 34 characters than one that is 51 characters.

But really, addresses get used because there is a standard for them and there is none for public keys. Why that is so, I don't know.

All credit to Pieter, who has provided the knowledge to amend my errors. ;)

Also see this related question: Why does the default miner implementation use pay-to-pubkey?


How do I reduce the loglevel on rippled?

You can put the following in your rippled.cfg file:

[rpc_startup]
{ "command" : "log_level", "severity" : "error" }


You can find a list of compatible wallets on BIP44's Github page.

  Mycelium Bitcoin Wallet (Android)
  Copay
  CoinVault
  Samourai Wallet
  Coinomi
  TREZOR
  KeepKey
  Ledger Wallet
  21 Machine Wallet
  Trust Wallet

According to MetaMask they also support BIP44, although they are not on the list above.


When launching cgminer with scrypt parameters, Windows gives an error message. Why does this occur?

I've seen this problem a few times, it could be just about anything unfortunately.  I would try changing your thread concurrency, and intensity values.  Some people have also recommended different drivers.


API for top bitcoin addresses sorted by available balance

This should works: http://www.tokenview.com:8088/address/richrange/btc/1/100
API documentation: https://tokenview.com/en/api


You would only need to use Alice and Bob's UTXOs to transfer 1.5 to Dennis. You would then get a new UTXO worth 0.5 sent to you as change (minus network fees). This would leave you with your origional UTXO worth 1 BTC from Charlie and a new UTXO worth 0.5 BTC from your transaction to Dennis.


How do I see what version of bitcoin core my wallet uses

In the Multibit data directory, there is a file called log/multibit.log. When you connect to a peer, it will write something like this to the log:

20:01:26.124 [bitcoinj user thread] DEBUG o.m.c.b.BitcoinPeerEventListener - Connected to peer:
client version: 70002
local services: 1
time:           1424228484
my addr:        [xx.xx.xx.xx]:51127
their addr:     [xx.xx.xx.xx]:8333
sub version:    /Satoshi:0.10.0/
best height:    343977
delay tx relay: true

The 'sub version' field contains the version in a human readable format. The 'client version' field contains a machine-readable protocol version.


How can I accept bitcoins on my website?

There are a number of ways one can go about accepting Bitcoin on a web interface. Keep in mind as you review these options that Bitcoin is still a young technology and many of these options aren't what you'd call "friendly" just yet. That said you do have quite a few options depending on your level of expertise and technical requirements:

Use a service like:

BitcoinPayFlow
BitPay

Use an existing shopping cart interface

There are existing plugins for Ubercart, Magento and many other popular e-commerce platforms. If you are looking to modify an existing site that happens to run on one of these platforms, this may be your best bet. If you've yet to start a site and don't want to write code yourself this may still be your best bet since you can choose your platform prior to implementation.

Roll your own using existing libraries

This is your best bet if you're using a platform that isn't currently supported or if you have difficult integration requirements that cannot be satisfied by existing e-commerce platforms like Magento or Ubercart.
Languages:

ASP.NET/C#
PHP
Python
Many others

Roll your own using the JSON API directly

This is only necessary if you are not using one of the half-dozen or so languages that already have pre-written libraries for interfacing with bitcoind. The list of languages may be short, but all of the major industry standards have been covered, so it's unlikely you will have to go this far.


Think of it like Internet.

Tim Berners-Lee could submit patent applications and be much richer, but he wanted everyone to use the Internet.

Satoshi could choose a strict license, but then there won't be that much users and merchants, and only one client. 3-4 devs, editing code would be illegal. This would cause node centralization and if an exploit was found an attacker would illegally change the code of the client and make 51% attack easily.

Main idea: Satoshi wanted everyone to use bitcoin, and allowed everyone to change the code that they're running. Thank you Satoshi for BTC freedom!

And now, they can't change the license, but you can be sure that if BTC had a strict license, the attackers (IYO) would still use changed code client with TOR and no one would be able to stop them.


What is structured fuzzing and is the fuzzing that Bitcoin Core does currently considered structured?

I'll use the definitions used in this presentation from Jonathan Metzman at Black Hat 2019 but obviously this is a relatively new field and so there may well be disagreement amongst researchers and academia on formal definitions.
In this presentation Metzman explained how the first rudmimentary fuzzers were completely black box meaning they knew nothing about the target they were fuzzing. They were also structure unaware meaning they knew nothing about the format that they were supposed to be mutating or generating and were just piping bytes from /dev/urandom etc.
The next generation of fuzzers were still black box but they were now structure aware as in when fuzzing for example HTML, they provided inputs that looked like HTML rather than just random nonsense.
Metzman believes current day fuzzers (e.g. AFL) are coverage guided, structure aware but they are unstructured. This is where Bitcoin Core is now in terms of fuzzing. I don't think there has been any experimentation with structured fuzzing (I will update if wrong).

The reason why AFL has had such a large effect and this technique as well, is because unstructured fuzzing allows people to use it without actually understanding much about the format that they are actually fuzzing. But because it is coverage guided the fuzzer generates progressively more interesting inputs and that’s why it is actually fairly good at finding bugs.

Metzman believes the next generation of fuzzers will be structured. They won’t just do the general purpose mutations that AFL does on inputs. They will do format specific ones like deleting expressions from programs rather than just flipping bits. They will also allow you to fuzz where you think the bugs are going to be.

With structured fuzzing you are almost becoming part of the fuzzer
where you see code that isn’t being covered and you make a decision
whether you think it is worth covering that code. Then you make the
fuzzer cover that code.

You will be able to do this by writing custom mutators where you define the function that will be called to mutate test cases rather than the default mutator. Currently you can write custom mutators with libFuzzer.


Why does Zcash show a circulating supply of only 4 million?

Yes, that's correct. The details can be found here: https://bitcointalk.org/index.php?topic=1664832.msg16714736#msg16714736

And in 2050, only approximately 23% of the total supply will have been mined, according to this


Do you need to download the entire blockchain in order to mine bitcoins?

If you are solo mining, then you need the entire blockchain since each block you mine references the hash code of the last block in the chain.  If you don't have the last block yet, then the network will reject your mined blocks since there will already be later blocks in the blockchain.

If you are mining in a pool, then you don't need the blockchain or bitcoin-qt.  Just point your miner at the pool and start mining.


Why do most exchanges still have not implemented segwit bc1 addresses to save block space?

The primary reason is the lack of incentives to actually migrate their entire system. Lower transaction fees is the most direct benefit that SegWit provides. I'm not discounting the other myriad benefits that SegWit brings to the table, but for exchanges this is the most rational one. Below is a chart that shows the average transaction fees used by all the pending transactions in the mempool.

As can be seen, the transaction fees isn't that high for the exchanges to get the transactions confirmed. This is because the mempool congestion isn't high enough. Below chart shows the mempool size (aggregate size of the transactions waiting to be confirmed).

The small decrease in transaction fees that can be achieved with the help of SegWit doesn’t justify the monetary or time costs required to upgrade all wallets to the new standard. Replacing legacy addresses and migrating them to Segwit is a very cumbersome process for exchanges. For centralized exchanges, the largest cost cutting come from batching (aggregating many outputs into a single transaction) which they do when sending bitcoins from individual account's address to the centralized addresses. This underscores the exchange's decision of not moving to SegWit since the fees for getting transactions are already low. In future, if we see mempool congestion like we saw in latter half of 2017, we are most likely to see migration to native SegWit addresses.


When does client decide to stop/cancel proof of work algorithm?

Now lets say another node guessed it faster than me, how do I know when I should stop my proof of work algorithm?
When do you start trying to guess the next proof of work?

Whenever a node successfully solves a proof-of-work it immediately broadcasts it to the whole network. So whenever you hear a block that you are trying to solve you should stop and start mining a fresh block on top of the newly received block


If your transaction from April still has no confirmation, it would be feasible to create another transaction that spends the same input to yourself. You could hope that your new transaction would be verified first, which would invalidate the other transaction and salvage your coins.


How does exchanges like bitrex exchange coins so fast ?

Exchanges work with promises. If you deposit 100 USD, they promise to let you withdraw 100 USD later. If you trade for e.g. BTC, they only change this promise to letting you withdraw BTC. Exchanges accomplish this by swapping promises between users.

There are no actual transactions on the blockchain (except you deposit or withdraw to or from the exchange). That is why you e.g. can buy 0.5 NEO, where NEO on the blockchain is not divisible.

This is also why technically you do not own the BTC as long as they are on the exchange.


Loyalty programs for Bitcoin transactions

The difficulty with such a scheme would be identifying the customer.

Certainly, the loyalty program operator can monitor incoming transactions to addresses registered by participating merchants.  But the public blockchain shows only the address from which the payment was made.  The question is how to use that address to identify the customer who should be given points.

If the customer made all their payments from a single address, they could simply register this address with the loyalty program in advance.  However, most wallet clients don't work that way; users hold their coins in many different addresses, and new addresses are created (for change) every time another transaction is made.  (The thought is that this makes it harder to tell who a given address actually belongs to, and improves anonymity.)

So a customer would either have to register a large and constantly changing set of addresses (awkward) or would have to take steps to ensure that payments to the merchant were always made from one particular address that they had registered (not easy to do in most clients, and might require extra transactions and fees to move the coins to the proper address before making a payment).

There is a similar issue in that merchants should also want to use a large number of different addresses for incoming payments.  If all incoming payments go to the same address, it makes it easy for a competitor to see how much business they are doing.  Also, for safety they may not want to hold all their coins in a single address, so if all incoming payments go to a single address, they would need to make extra transactions later to spread them across other address.  So ideally, each customer makes their payment to a unique address.  Thus, it's not as easy as having each merchant register a single payment address.  They would probably want to pre-generate a large number of addresses and register all of them.


How to recover deposit to incorrect address

Log into Luno and click on transactions.

This should list the deposit that you did to gatehub. In my example in the screenshot this is a transfer I did to the waves platform

If you click on that transaction in the list it will show the transaction number of this deposit. The transaction number will be hyperlinked so you can click on it and it will launch a new page that allows you to view the transaction in the blockchain explorer. Check your transaction in the blockchain explorer and see how many times it has been confirmed and whether it has been added to a block.


What would be required to disincentivize mining pools?

It doesn't matter if a mining pool has 100% of the total mining power so long as that mining pool can't choose which transactions its users work on, prevent them from submitting blocks that they find, or choose which blocks they build from. No change is needed to the Bitcoin protocol as far as I know. Only the protocol used between pools and their clients needs to be changed.


Convert byte string into a base58 string using Base58Check encoding

I think maybe this one?: 800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D507A5B8D

Yep!

  and I don't know how to convert its bytes to a "big integer" (keep in mind that I'm trying to learn and therefore need to do all of the math myself instead of simply having an existing programming command or web tool do it for me).

First, you need to convert it to an integer. Let me give you a simple example that you can use to test your program:

hex = fb4d9a
dec = 16469402

How do you get an integer from hex? It's like reading a base ten number, only it's base 16.

hex = fb4d9a
           ^ one's column
          ^ 16's column
         ^ 256's column (16*16)
        ^ etc.

Once you figure this out, upgrade your program to handle 'big integers.' Some programming languages have a limit on how big of numbers they can handle. In C, you can't put five billion into an int type variable. Some languages, like Python, can handle big integers without any help.

The number you get for the hash you referenced should be 63680997318088143281752740767766707563546963464218564507450892460763521488675430192536461.

  I'm not sure what "hash" it's referring to.

It's the same one you just referenced. In this case, there are zero leading zeroes, which means that the output address should not start with a one.


Can you specify more than one output index in a transaction's input?

It looks to me like each input to a bitcoin transaction has an index that specifies only one output from the input its spending.

That is correct.

  Is there a way to specify more than one output index, or do you have to create a second input line that contains the same input ID with a different index?

You have to add an extra input, which repeats the txid.

  It seems like that second way is wasteful of blockchain space - I would have thought there would be a way to simply specify multiple indexes.

It is wasteful, but only slightly. In your hypothetical system, you still need a signature/scriptSig/witness for each of the coins being spent (unless you also want to incentivize key reuse), which are generally larger than a repetition of a txid.

  Is there a way to do that?

No.


Computer broke, how to obtain the private key?

First, backup your wallet.dat file (if you don't know where it is stored, check this: https://en.bitcoin.it/wiki/Data_directory)
Analyse the crash, read the error message.
Quit Bitcoin-Core, try to temporarily move your data-directoy and let bitcoin-core create a new one.
Quit Bitcoin-Core, replace the newly created wallet.dat file with your old one (after you made a backup)
Start Bitcoin-Core again
If you don't want to wait until your full-node is synced (can take a couple of days), export your private key by opening the Development Console (ctrl - D in 0.13.0) and type dumpwallet <path + filename>


What are the additional benefits of having a blockchain behind a web service?

It has a blockchain behind it for one reason only: buzzword compliance.


How is it possible that transactions can be added to a block currently being mined?

You're thinking that mining a block is a single long computing process, like computing the trillionth digit of pi or something like that. This is wrong. Each attempt at solving a block takes almost no time at all, and each attempt is independent of the others. Miners make many attempts every second. Each attempt has a very small chance of solving the block. It's a lottery, not a race. Modifying the block between attempts isn't a problem.

Another common misconception related to this is that everyone is working on the same block. This is also false. Every miner works on a different block.


Try not to reuse keys/addresses.

Just call getnewaddress 200-times (RPC call in a loop).

Maybe call keypoolrefill afterwards (and do a backup again if you don't use HD [Core >=0.14]).


how do i know which key has mined bitcoin?

You have to load the keys into software which can scan the blockchain and search for transactions that belong to them. The simplest way to do this is to just start Bitcoin Core and let it sync. During the syncing process, Bitcoin Core will also be scanning the blockchain for any transactions that belong to any wallets that are loaded, so once it is synced, you will see any transactions (and thus Bitcoin) that belong to you.


Mining: GetWork, Get Nonce, ???, Submit Hash?

In KC705_experimental, the readme says the device should return 0E33337A and two other results. It just so happens the bit of test work described in the readme has three different solutions to it.  A mining script should return all three solutions to the server.

fpgaminer, the author of the KC705_experimental code, has written an addon for the Modular Python Bitcoin Miner project (MPBM) to mine using KC705 hardware.  If writing your own mining script you may want to refer to his work.  You can find more information here:  https://bitcointalk.org/index.php?topic=9047.msg2019538#msg2019538


How can I enable more GPUs in Ubuntu for poclbm?

lspci lists PCI devices. ./poclbm.py lists OpenCL devices. If the former finds the device but the latter does not, your second GPU must not be registering as an OpenCL device.

Ubuntu 11.10 has a notorious reputation for multiple-GPU bugs. (See here and here.) I personally have had issues with 11.10 mining that were resolved simply by switching to another release. I would suggest you instead use Ubuntu 11.04 (Natty Narwhal); it is generally regarded to be the most reliable Ubuntu version for mining.

If that is not an option, or installing 11.04 doesn't fix the problem, try the following steps:

Uninstall whatever version of Catalyst/SDK you have (make sure to remove all configuration files) and install
Catalyst 11.6 and SDK 2.4.
Run aticonfig -f --initial --adapter=all again. Make sure it runs without errors.
Run aticonfig --list-adapters. You should see two.

Those steps should fix any configuration issues. If your problem persists, it's either a hardware issue (or an Ubuntu 11.10 issue).


Can the number of transactions per second ever overwhelm the network?

There are three parts to this:

The miners have to verify each transaction that will go into the block and all transactions that are in the block they will be basing their own work on
Each client needs to look for transaction destined to their own addresses, which can get hard if you have a large address pool
Since all transactions are broadcast the network itself could potentially be flooded.

The first two are pretty simple to solve since most computers already can process up to 100 transactions a second (resulting in roughly 10*60*100=60'000 transactions per block) and this can be pushed by investing in larger hardware to do the processing, and offloading verification to trusted third parties.

The last part is harder to solve as it results in possibly O(n^2) messages going around the network. Here a more structured network might do the trick, but all attempts so far to create a structured network have been dismissed.

Last but not least the blockchain grows linearly with every transaction which uses diskspace on every client. This has been partly solved by Satoshi in his paper.


Are people incentivized with BTC to run nodes?

Are these people incentivized to run nodes?

No. Their reasons for running a full node varies. Some of them want Bitcoin to succeed. Some of them are merchants and run a full node as part of their business. Some of them have spare computing power, and don't have a strong preference as to how it's used.  It's worked out reasonably well so far.

  If not, why not?

It's extremely challenging to prove that you're running a full node. This code pretends to be a full node, though it really just forwards requests it can't answer to other nodes.

  If so, do node operators make some BTC from transaction fees, etc.?

No. Miners receive transaction fees, although it's not a substantial part of the overall block reward. (Most node operators are not miners.)


Bitcoin (and other coin) mining seems very inefficient

So how about a system where each pools/miners broadcasts the work they are currently doing, so that other miners know not to start working on those blocks?

There is no need for that; there is never any duplicated work. Since every block has at least the pool's/miner's payout address, which is:

hashed into the coinbase txid,
hashed through the Merkle tree,
hashed into the Merkle root,
hashed into the block header

all pools are always searching non-overlapping sets of block candidates already.


Why is so expensive to buy Bitcoin with Credit Card?

It is about the blockchain. A transaction goes in to a block and gets stacked on the blockchain. This process takes a lot of cryptographic processing power, which is done by miners. This process becomes practically irreversible as more block go up the chain.

So the power of bitcoin is its guarantee a transaction is becoming irreversible and definitive as the blockchain grows. This means, you buy Bitcoin it is yours. Yes, if it is still in the exchange they hold the private key to respend your BTC, but they won't hold the lock forever.

Chargeback is one thing. A stolen credit card another. Credit card fraud is at large scales currently. All this is putting a big administrative overhead on the exchanges. Users will have to do all sorts off verification to prove the credit card is really theirs. So, that 10% is the administration fee for all that, plus risk mitigation. Also I believe, that withdrawal is restricted anyway, regardless of this fee.


It seems possible the "approval email" was a fake and that you clicked a link in that email which led to a fake website that tricked you into giving your account credentials to a thief.

what shall I do?

Report the theft to blockchain.com and ask for their help.
Report the theft to your local police.
Accept that your money is gone and almost certainly will never be recovered.
Perhaps do some research on the differences between custodial-wallets and non-custodial wallets and on the differences between hot-wallets and cold-wallets. Investigate the prices and availability of hardware wallets.
Do not respond to unsolicited messages from people saying they can recover your money - they are conmen who will later invent false fees you need to pay them.


Continuous integration setup using bitcoind regtest on travis-ci

v0.11.0 and after:

Check and make sure that your daemon version is v0.11.0 or greater. If it is, the generate method should work.

Pre v0.11.0:

The setgenerate true method should be used.

In a standard network (such as testnet or main), setgenerate true will turn mining on indefinitely. In regtest, it just mines one block. You can also do

setgenerate(TRUE, 10)

To mine 10 regtest blocks. The second parameter is called the generation limit.


Why I haven't received my transfer from BTCGuild?

According to the Blockexplorer, you should see all of those transactions when you reach block 163971. Your client probably needs to finish synchronising with the network, as the first transaction is the newest one. If you see the second transaction, then you still have about 7 days at most to synchronise. Just leave your client on for a couple hours and you should see your last 0.2 Bitcoins arrive.


I had named my script bitcoinrpc.py and had the import bitcoinrpc. Naturally it couldn't find the package. Renamed the script and it works.
Lesson: DO NOT have a file of the same name as the package you are trying to import.


I suggest you download and install electrum. Then run and select "standard wallet" in the first step > "I already have a seed" > then enter your seed words. If your seed is a valid electrum seed it should let you proceed to the next step. If it is not then click on options and check bip39. Then see what message is displayed next to the options button. If it says "bip39 checksum ok" you can proceed to the next step where you choose the legacy p2pkh option because that is the most likely address type. Then follow on-screen instructions for the rest.

If the above doesn't work then I suggest you look at your filesystem to learn what wallets you installed in the past. Also look at your email archives in case you used a blockchain.info wallet. Make a post about what you find on the bitcoin talk forum technical support subforum or /r/bitcoinbeginners subreddit and post a link the comments so we can help you further.


bitcoind rpc interface, generate method deprecated in version 0.19.0 (latest)

generate was deprecated and removed in favor of generatetoaddress.


how do I get list of all "used" addresses in bitcoinj

This seems to get change addresses:

public List<String> getChangeAddresses() {
    List<String> ret = new ArrayList<>();
    int issuedKeys = wallet.getActiveKeyChain().getIssuedInternalKeys();

    for (int i = 0; i < issuedKeys; i++) {
        ChildNumber childNumber = new ChildNumber(i, false);
        List<ChildNumber> childNumbers = new ArrayList<>();
        childNumbers.add(ChildNumber.ZERO_HARDENED);
        childNumbers.add(ChildNumber.ONE);
        childNumbers.add(childNumber);
        ECKey key = wallet.getKeyByPath(childNumbers);
        ret.add(new Address(params, key.getPubKeyHash()).toBase58());
    }
    return ret;
}


How to discover startup flags or command-line options for bitcoind?

On Linux, get the process id of bitcoind and read  /proc/<pid>/cmdline.

On Windows, use wmic path win32_process where "name = 'bitcoind.exe'" get commandline


Updating a lightning node to latest version

Generic update procedure from v0.4.0 to v0.4.1:

stop LND
delete macaroon files in LND directory (to prevent this issue)
install new version exactly like before (as documented above)
start LND
unlock wallet with lncli unlock to create new macaroon files

In case you are following my RaspiBolt guide, you might want to copy the macaroon file to the admin home directory again: sudo cp /home/bitcoin/.lnd/admin.macaroon /home/admin/.lnd/ (see more details here)


The term single member is not correct. Hyperledger blockchains, such as Hyperledger Sawtooth or Hyperledger Fabric, are private blockchains or permissioned blockchains. You need permission to join the blockchain network. They are usually setup by consortiums (an example would be to track fisheries or other marketplace goods as it moves from harvester or producer to wholesaler to market to consumer).

Since the blockchain is permissioned, it does not usually use digital currency to function.


The transaction fees in Ripple are simply destroyed. There is no mining.

We had to use ripples because we couldn't use dollars, both because dollars in Ripple can only be represented as debt (Who would owe them to the system? Who would they go to?) and because Ripple is intended to be cross-currency (How would you manage exchange rates?).

The beauty of ripples is that the network can destroy them and they require no central authority. In the future, if ripples become unusually scarce or plentiful, the XRP cost of transactions can be adjusted by consensus.


What is the utility in the cgminer statistics

The Utility defined as the number of shares / minute

Its the number of shares your miner is contributing per minute. If you're looking at the overall Utility values, its the combined number of shares all miners are contributing per minute.

Reference: https://bitcointalk.org/index.php?topic=28402.0


How Does the SPV merkle path form of multiple transactions in Merkle block looks like?

bip37 has fallen out of use, and isn't a default option in Bitcoin Core anymore, so therefor filtered blocks aren't really a consideration for new designs. You could conceivably have a format for describing multiple transactions and their intersecting (or not) paths within a block, but this was never supported by the Bitcoin p2p protocol.


transaction (s) not going through due to low fees selected

Your tx seems okay now (3 confirmations when I wrote this answer): BlockChair explorer
Next time before resorting to paid service, you can try free BTC Accelerator such as BitAccelerate.


Is there a way to see the precise time of when a transaction was sent out?

While Murch answers the technical side of it already, what you're trying to do is simply not possible. There is no provision in Bitcoin to know the exact time a transaction was broadcast (short of running several nodes that connect to enough of the network to attempt to deduce the first broadcast time).
If you're trying to protect yourself against price fluctuations, your best bet would be to have a system that requires a certain number of confirmations within a time window of your choosing (say, 30-60 minutes). If you have not received BTC in that time period, you can cancel the order. If you receive it after the window has closed, you simply refund the BTC back to the customer and ask them to place a new order (or let them use that BTC amount as a credit against their new order).
This ensures that you only have to sell BTC for fiat within a certain window of time, and if the BTC transaction occurs too far after the order is placed, you return the BTC, without touching fiat at all.


Segwit addresses like the one you posted are case insensitive. Assuming your wallet is up to the spec, it should be able to send the BTC just fine.
If you have a transaction ID, look it up on an explorer to see if it has been confirmed.
If you don't have a transaction ID, and you have the private keys for the wallet, you should simply be able to make another transaction.
If this is a custodial wallet like an exchange or other wallet service, you will need to contact them.

To elaborate a little on the question in the title:

base58 encoded addresses (1... and 3...) are case sensitive - however, getting the casing wrong will result in a checksum error, and a well designed wallet will not let you send a transaction to an incorrectly entered address
bech32 addresses like the one involved here are case insensitive but, as pointed out by Murch, must be entirely uppercase or lowercase - a compliant wallet should reject a mixed case bech32 address.


A few security-related questions: how do I automate a web service as much as possible without storing private keys on server?

Set up a cold storage machine, not connected to the internet but with boitcoin installed. Generate a bunch of addresses on the cold storage machine.

Using a USB drive, copy the addresses from the cold storage machine to the online system's database.  No need to do anything with the private keys.

When needed on the online system, just send to 1 of the addresses in the database.  This can be totally automated.  You don't need a private key to send to an address.


Can I find miner's payoff record in the Block Chain?

How are miners identified for a given block? And, how is this piece of information in the block chain?

Miners are only identified if they choose to identify themselves. That is usually done by adding a message to the scriptSig of the coinbase transaction, or by taking credit for mining the block on a website.

  Is "coinbase transaction" stored as part of a block, and thus records the gross reward for mining such block? Or, what element/record within a block is recording the amount of "reward"?

Every block has a coinbase transaction. The coinbase transaction is always the first transaction in the block. The sum of the amounts of each output of the coinbase is the reward that the miner claims. The reward must be equal or less than than the current block reward plus the transaction fees. If a miner claims less than they are entitled to, the extra money is gone.

  transaction fees are free-floating voluntary residuals from normal transactions, to be collected solely by the miner who consolidated the block. Then, how are transaction fees "paid" to the miner? It seems that there needs to be another entry of record nested within in the block denoting the amount the miner has declared. How may I identify this record?

Each transaction has inputs and outputs. The sum of the amounts of the inputs minus the sum of the amounts of the outputs equals the transaction fee.

A miner is entitled to claim the fees of all of the transactions in their block. They claim this by increasing the reward they claim to the block reward plus the transaction fees.


bitcoind synced more blocks than in the blockchain?

You requested the amount of blocks in the testnet. In the 'real' blockchain, there are currently 309913 blocks, which is in agreement with your blockcount.

Change

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

into

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

So no need of removal of anything. Everything is perfectly fine.


What's the blocksize limit after segwit and how do legacy nodes deal with segwit transactions?

Segregated witness therefore takes advantage of this opportunity to raise the block size limit to nearly 4 MB, and adds a new cost limit to ensure blocks remain balanced in their resource use (this effectively results in an effective limit closer to 1.6 to 2 MB).

https://bitcoincore.org/en/2016/01/26/segwit-benefits/#block-capacitysize-increase

The maximum block size is 4,000,000 bytes (4 MB). This is because the block weight calculation is base size (in MB) * 3 + total size (in MB) = block weight (see BIP 141). Since the only units are MB, the block weight's only units are also MB, thus the maximum block size is the same as the block weight.

In theory, you can get pretty close to 4M, by having transactions that consist almost entirely of witness data. In practice, that won't happen for normal financial transactions, closer to 2M.
https://bitcoin.stackexchange.com/a/54949/

SegWit simply lets you verify non-witness transaction data without downloading (then discarding) the witnesses, which solves the problem of light clients having to download things they don’t care about and can’t verify anyway.

https://blockstream.com/2017/07/31/en-segwit-myths-debunked/

When Segwit transactions are sent to Legacy nodes the witness data is stripped. The key is that these “stripped” transactions are still valid transactions on Legacy nodes, which gives us a savings over non-Segwit transactions. Thus, more transactions can fit into the block sent to Legacy nodes without going over the 1,000,000 byte limit.

Segwit nodes get Segwit transactions and blocks that include the witness data using alternate network messages. The new network messages are defined in BIP144 as part of Segwit. The Segwit blocks which include the witness data can be over 1,000,000 bytes. Legacy nodes, as mentioned, receive the same blocks and transactions, but with the witness data stripped. This is a way to make Segwit a soft fork.
The Segwit blocks are restricted by something called Block Weight. Block Weight is a new concept introduced in Segwit, and it’s calculated on a per-transaction basis.
Each transaction has a “weight” which is defined this way:
(tx size with witness data stripped) * 3 + (tx size)
Segwit transactions are transmitted to Legacy nodes without witness data, so this formula will always result in blocks communicated to Legacy Nodes that are less than or equal to 1,000,000 bytes. Again, this is why Segwit is a soft fork.
https://link.medium.com/3lvCPzo5q9

Size vs Weight: What is block weight and how is it different from block size?


You might want to check out this great comment by Pieter Wuille:

  There will never be more than 20999839.77085749 BTC.

  Reasons for this number being lower than the often-cited "21 million":

  The subsidy scheme (50 BTC per block, halves every 210000 blocks) is rounded down to satoshi's (0.00000001 BTC), which results in slightly
  less already (20999999.9769 to be precise).
  Due to an obscure rule in the original software (which is hard to change now), the 50 BTC generated in the Genesis block are actually
  unspendable, so only 20999949.9769 are left.
  There have been two occurrences (blocks #91842 and #91880) of duplicate coinbases, where the coinbase transaction of a block had the
  same hash as the coinbase of an earlier block, causes the generated
  coins to be "overwritten" in the database. This was made impossible
  later using BIP30 and BIP34, but the coins of those blocks are
  permanently lost (two times 50 BTC).
  Some times, miners have not claimed all fees/subsidy they could in a block, for example block #124724 only claimed 49.99999999 BTC subsidy
  instead of 50.01.
  Soon, with the introduction of provably-unspendable outputs (OP_RETURN), some will not be considered part of the set of spendable
  coins anymore (a total of 0.00835434 BTC currently).

Similar topics:

How Many Bitcoins Are Missing?
Bitcoin disappearence rate
Why doesn't Bitcoin return lost coins back into the block reward?
What could be the consequences of many bitcoins being lost out of circulation if people lose their wallets?
https://bitcointalk.org/index.php?topic=109117.0


Strange BTC rate behavior when buying bitcoins

I can't say for sure, but two options come to mind:  a)  the "price" of financial assets are the current bid/ask and general average of closed transactions.   You might have been on the high end of the average. You should verify the deal details before purchase/sale.  b) some exchanges charge a premium to the parties, again, know the details before you commit


The specification for BIP34 was created to fix a vulnerability where it was possible to make two transactions with the same TXID. To fix this a nonce was added coinbase transaction, where the height of the block must be encoded in the first bytes of the first transactions input. The definition is for when that soft fork became enforced.


MtGox websockets api returning "400 Bad Request"

It seems that the client should send the Origin header in opening handshake to the MtGox server.

If you use current websocket-sharp, you should do like the following before connecting.

ws.Origin = "http://websocket.mtgox.com";

Could you try?

Update:

Could you try again the following code?

static void Main(string[] args)
{
    var ws = new WebSocket("ws://websocket.mtgox.com/mtgox?Currency=USD");
    ws.Origin = "http://websocket.mtgox.com";
    ws.OnOpen += (sender, e) =>
    {
      ws.Send(
@"{
    ""op"": ""unsubscribe"",
    ""channel"": ""d5f06780-30a8-4a48-a2f8-7ed181b4a13f""
}"
      );
    };
    ws.OnMessage += (sender, e) =>
    {
        if (!String.IsNullOrEmpty(e.Data))
        {
            Console.WriteLine("{0}", e.Data);
        }
    };
    ws.Connect();
    Console.ReadLine();
    ws.Close();
}

It seems that an exception has occurred when the client is receiving ticker type data in a while.

I'll investigate a little further.

Update:

I've found out the cause of the exception, and fixed websocket-sharp.

Could you try your code with current websocket-sharp?


Building a small block explorer for fun, stuck with node

You want to use the RPC Protocol to get blockchain info. RPC is usually disabled by default, so you need to enable it. You can do this in the bitcoin.conf file in .bitcoin folder where you've installed the daemon.  Alternatively, you can run the daemon with the -server flag, see  command line arguments. Now, you will also need to set RPC authentication in the conf file as well. The -txindex flag will allow you to search for any tx by hash using getrawtransaction command, which may be useful depending on how you utilizar the RPC protocol.

Example bitcoin.conf

The line to add is:

server=1

How to use:

RPC documentation


Could a miner set a maximium transaction fee rate?

Yes, miners can choose exactly what transactions to include in their candidate blocks, including the choice to not include anything at all.
Of course, if a high fee paying transaction is available, and one miner chooses to not include it, other miners still can. This is only untrue if an entire cartel with sufficient hashrate that is actively performing a 51% attack chooses not to include a transaction - in that case, it can be censored as long as the attack lasts.


You can use colored coins to do voting on the Blockchain.

You can start by creating "Vote coins", and issue as many of them as you have registered voters. Then you ask the voters to generate a Bitcoin address, and that they give it to you.

You then send 1 "vote coin" to each of those addresses. You designate two or more addresses, one for each candidate/proposition. Finally the voters have to send the vote coin to the address representing the proposition they want to vote for.

When the vote is closed, you simply look at the "vote coin" balance in each of the two addresses.

The votes are secret because nobody can tell which address belongs to which voter.

Coinprism is a web wallet that lets you issue, send and receive your own colored coins. It's quite simple to use.

For secrecy, the voters could go to the voting office, the officials verify that the voter is allowed to vote, the voter writes down his address on a piece of paper, and slide it into a sealed box. At the end of that registration process, the voting office has a box with 100 pieces of papers with each an address. They can then send the "vote coins" to those 100 addresses, without knowing which belongs to whom.

Of course, this is just an illustration, it's possible to achieve the same without requiring people to travel using the equivalent process implemented as open source software.


Can i send bitcoin from non-segwit address to segwit address?

Yes, you can.

The transaction will just not be a SegWit transaction, and not receive its benefits (including lower fees for a given confirmation speed).


That "information" being shown is effectively useless and therefor isn't made available in any consumable form. What is being shown is the GeoIP lookup of the node that a block or transaction was relayed to Blockchain.info, and the frequency at which that location appears in their database. It doesn't reveal the location of the originator of either inventory item, or provide anything worth knowing about the state of the network or its users.

http://getaddr.bitnodes.io/ shows the approximate locations of many (but not all) listening Bitcoin nodes, which is about as close to reliable data as you can get for this sort of network.


How does Coinmarketcap calculate volume?

It connects to the api of the exchange and returns the traded volume.

The volume of the exchange is the sum of all coin's volume in that exchange that is returned from the exchange API.

The volume of the coin is the sum of that coin's traded volume that is returned from all exchange's api.