What the maximum number of txout in a transaction? I know the maximum transaction size is 500Kb.

I also know there is a maximum for sigop in a transaction (20,000?).

What I'm interested in is what is the maximum number of txouts you could include in a single transaction.

There is no practical maximum number of outputs in a transaction. The number of transactions can be up to 264-1, or 18446744073709551615. The transaction fee would be more than the total bitcoins to ever exist.


What the difference between SendToAddress and (CreateRawTransaction + SignRawTrasaction + SendRawTransacrion) RPC methods? Can I create, sign and broadcast transaction using sendtoaddress RPC method? And what the between sendtoaddress and (createrawtransaction + signrawtransaction + sendrawtransaction) RPC methods?

SendToAddressis a convenience method that handles input selection and building the transaction for you. You don't get any control over which inputs are selected.

Using the CreateRawTransaction + SignRawTrasaction + SendRawTransaction methods, you can control the exact composition of your transaction, and set the inputs, outputs, and fee with a very high precision.


how do i identify the location of a transaction? I have an old coinbase account and can't figure out for the life of me where I would have sent the coins.  What is the best way to determine the owner or location from a bitcoin address?
14vRCiVnT4Su1akXrKmUUa3Ucf971pJXsB

The address you linked to only has 2 transactions for a total received of .01 BTC, which was later sent to 1Facb8QnikfPUoo8WVFnyai3e1Hcov9y8T.

Remember that the address you linked may not be the only bitcoin address you had available in your coinbase account. A wallet can provide many addresses.

Transaction info:
https://bitcoinchain.com/block_explorer/address/14vRCiVnT4Su1akXrKmUUa3Ucf971pJXsB

As for figuring out the owner/location tied to a bitcoin address as far as I understand this is not a built in feature of bitcoin. Unless the owner has publicly attached this address to a name somewhere there is not really a way the average person can find out who owns it or where they are from.

I'm sure a hacker/government could find a way to monitor transactions on the network and gain your IP but I don't think that information is made available for the average user.

This thread may help clarify: How do I see the IP address of a bitcoin transaction?


How to do mass payouts in my application to multiple addresses at once, or very quickly? Let's say it's pay day--I've accumulated a lot of bitcoins, and sent them all to a single address. I now want to pay a lot of addresses from this "pool" of coins, say anywhere between 100 and 10,000 addresses. What is the best way to do this in a way I can use with PHP, and with which client would be the best fit? I'm currently familiar with bitcoind and electrum.

The problems I see happening is:

If I make them one after another, I would have to wait for a confirmation between each each transaction.
If I somehow send them all in one transaction, I would need to a) mess with raw transactions, and b) possibly hit a limit on the transaction size.

Is it possible to do this without using raw transactions? And how do I check to see how many addresses I can send to at once without hitting the max transaction size? If I DO have to deal with raw transactions, is there any library in PHP that helps me build them easily?

Thank you.

In Electrum you can use the CSV import feature to make bulk payments. It can accept either a CSV file or CSV entered into a text box. The rough format is:

ADDRESS, 0.12345
ADDRESS, 0.12314

This feature has been merged into the 1.9 version that is not released yet, but you can use it already.

https://github.com/spesmilo/electrum/pull/282

Example:

1PkeTTctdh2CvhW3fQLs93PWP9qupWV68X, 5
3NujXLC3LxNsmk2wr69CLBuXGfhXeenUyu, 5
1CNAnSb7d1XCA4AXBH2gip3mi8dNTQxzeo, 1
1LSBFJ1An9orRMU6Bz3NS1y3jr1eH9AexE, 1
16qRyDVZVpptJb4HZzv5rWkjqtJWVRjDep, 1
1PkeTTctdh2CvhW3fQLs93PWP9qupWV68X, 5
1Nnad832Zyob64wGbju49CC5RFbACAfCNZ, 1
1J2gFYBnf8K2wHJDndgr3iN1nPoZumHXap, 5

The amount is in the unit your Electrum is configured. In my case, for example, it is in mBTC. Be careful with this!


How Can I speed up decrypting? I have a recovery company retrieving my scammed bitcoins. They have moved them directly to my brand new wallet but the decryption process is very very slow. They say I should purchase more bitcoins and deposit them in my wallet to create history. Will that speed up the process?

You are likely being scammed again.

The vast majority of bitcoin recovery companies are scams. The ONLY scenarios in which coins are recoverable are if you mistakenly sent them to another address in your wallet (such as an address after the gap limit, sent BTC to an LTC address, ETH to an ETC address, and so on), or if your wallet had a catastrophic derivation issue that resulted in it giving you non-standard addresses which normal wallet software cannot find.

Pretty much anyone else claiming to be able to recover coins that were stolen in scams, hacked from exchange accounts, sent to scammy brokers/investment/mining operations, etc. is also a scammer, trying to capitalize on your loss to extract more funds from you.

Cut your losses now, and do not give these people any more funds.


how to transfer money from mobile wallet to bitcoin wallet is there any way to transfer money(INR,in this case) from a mobile wallet(like Paytm,mobikwik,etc) to any bitcoin wallet(zebpay,xapo,unocoin,etc).
if not...is there any other ways to do this kind of stuff..?

You can always use https://btcxindia.com/ to transfer INR from your bank account/credit card to BTC.


How can I retrieve the mnemonic words from my bitcoin core wallet? I studied with Aaron Jaramillo's Libbitcoin tutorial.
And I have a question regarding mnenonic word.
In that tutorial, I should use testnet for making raw transaction.
And I should make wallet from mnemonic words from my testnet wallet.
But I cannot find my mnemonic word from bitcoin-qt.
Please let me know, how can I get my mnemonic words from bitcoin-qt.

BRs.

How most HD wallets work is that they take (or generate) a mnemonic, the mnemonic is used to generate the HD wallet master key, and the master key is used to generate the keys in the wallet. Bitcoin Core doesn't yet support the first part of that: it generates a random master key without using a mnemonic. So there is no mnemonic.

If you would like to get mnemonic phrase, you can generate one here
or using electrum.

Note: electrum mnemonic phrase is not supported everywhere.


Lightning close-channel transaction example? From this article, I can understand that a punishment-based bidirectional payment channel (the type used by Lightning) would contain roughly this bitcoin script as one of the outputs:

OP_IF
“+7 days” OP_CHECKSEQUENCEVERIFY OP_DROP
<Bob pubkey> OP_CHECKSIG
OP_ELSE
OP_SHA256 <sha256(Bob secret)> OP_EQUALVERIFY
<Alice pubkey> OP_CHECKSIG
OP_ENDIF

I guess there are some block explorers that let you visualize the real script being used in a transaction, so can anyone point me to a real LN transaction (in mainnet) that follows the template above?

Thanks

The actual script implemented on Lightning Network is a little bit different from what you quoted. This is the script below and the specification is here

OP_IF
    # Penalty transaction
    <revocationpubkey>
OP_ELSE
    `to_self_delay`
    OP_CSV
    OP_DROP
    <local_delayedpubkey>
OP_ENDIF
OP_CHECKSIG

I've created that transaction on Testnet as the following,

Txid:
4f8d776c85b1fc15c1125e7043a9aee70e33f0793b472823e3946a8de075bec4

Rawdata:

6321026644cb387614f66421d14da3596c21cffa239011416c9adf3f351ee8551a9fc767029000b27521029654f80732769d7c435a184a3559f12178315526c53bbf003349390811c7590a68ac

Decoded by here

{
    "result": {
        "asm": "OP_IF 026644cb387614f66421d14da3596c21cffa239011416c9adf3f351ee8551a9fc7 OP_ELSE 144 OP_CHECKSEQUENCEVERIFY OP_DROP 029654f80732769d7c435a184a3559f12178315526c53bbf003349390811c7590a OP_ENDIF OP_CHECKSIG",
        "type": "nonstandard",
        "p2sh": "35M7MGVGd3ajyiTMvriUiyUM3H2cT5sgb4"
    },
    "error": null,
    "id": null
}


Has Apple stated its view on legality of apps using alternative electronic payment systems? An article entitled "Why Apple is Afraid of Bitcoin" discusses Apple's interest in online payments. It also talks about the removal of 2 Bitcoin apps, Blockchain Wallet and BitPak, from the appstore.

  The explanation given by Apple was that “apps must comply with all
  legal requirements in any location where they are made available to
  users.” Apple further stated, “it is the developer’s obligation to
  understand and conform to all local laws” and the developer was
  referred to the legal department for an exact explanation of which law
  it violates. Clearly, they will not be able to cite a law as no laws
  prohibiting bitcoin currently exist in any jurisdiction.

Though the author of the article claims that no laws prohibit Bitcoin, Apple obviously disagrees but was very unhelpful in explaining which law it might be referring to. Has Apple discussed its stance regarding legality of apps using Bitcoin or other alternative payment systems?

As I read here Google does not allow 3th party merchanting services:
https://stackoverflow.com/questions/10217727/apple-android-3rd-party-merchant-services

I'm quite sure that Apple wouldn't allow them either.

Although, by law, Bitcoin is not considered as a payment, since law does not recognize Bitcoin as a currency.

So by the rules i don't think they can ban you for using Bitcoin, but as we all know, Apple just decides itself what it allows and what not.


why is the double spending problem is a problem in cryptocurrency? The bitcoin original has the "double spending problem." But in a transaction using standard currency (dollar), the double spending problem is not a problem. Why is this a problem in crypocurrency?

With physical dollars, double spending is not an issue.  You either physically possess the dollar or you don't.  Once you give the dollar to someone else, it can't magically reappear in your wallet.

Non-physical dollars, such as a bank account, solve this problem by centralized trust.  Your bank is trusted to decrease the value in your account when you transfer money from it, and increase the value when you transfer money to it.  These transactions are audited against the records of the institutions the bank interacts with (other banks and financial institutions), which helps ensure the accuracy, but at the end of the day it is trust in your bank that prevents double spending.

Cryptocurrencies are digital, and digital assets can be copied perfectly.  This had always been a problem for creating a digital currency.  Let's pretend that a certain image was used as a digital currency.  What prevents you from copying this image millions of times, and double spending it?  This is the problem Bitcoin solves by using a blockchain.  It is able to verify that a digital asset is only transferred once, and do so without a centralized authority like a bank.  Without trusting anyone in particular, you can be sure that a payment you received was not (and never will be) received by someone else as well.  Just like being handed a physical dollar.


Why invest in mining hardware if the difficulty continues to climb at an exponential rate? From the FAQ :

  Creating a block is a proof of work with a difficulty that varies with the overall strength of the network.

So with these purty graphs there is a continuous exponential trend in increasing difficulty due to the combined total of network's computation strength.

My question is, now that the difficulty is shooting up like a rocket this year, why bother investing in any type of miner hardware?  Feels like the difference between buying $100 worth of lottery tickets and buying just $1.  The odds of winning the lottery are so low that buying $100 still leaves you with very low odds and you out of that much more cash.

The mining difficulty is going up very fast. You are correct. But the mining industry is also stimulating the Bitcoin economy significantly. See this news story, for instance: KnCminer sells $3M of bitcoin mining equipment in 4 days

My best answer to your chart is another chart:

From: https://blockchain.info/charts/miners-revenue

Even with the bitcoin difficulty skyrocketing and the hash rate of the network steadily climbing, the math says it all.

  (number of bitcoins mined per day + transaction fees) * market price

Now mining at that scale is not for everyone, that is where hashing data centers come in to the picture.  If someone wants to mine some of this currency but cannot afford to buy the expensive gear that is required to keep pace with all of these numbers, cloud services will allow little guys to play ball at whatever prices they can afford to pay.


Derive next HD segwit address from xpub/ypub I've been using the smartbit api to derive the next receiving address for a while now. However it only works for Legacy addresses and not Segwit addresses. I now have a Ledger Nano s and need a similar api to obtain the next address in my HD wallet without having to open Ledger Live. Is there such a service? If not, how can I calculate a series of addresses using the xpub / ypub only. (Javascript if possible)

There is https://iancoleman.io/bip39/ Enter your xpub into the BIP32 Root Key box and in the BIP141 tab select the derivation path and address type.


Unable to find Lightning Node I have successfully installed and synced my lightning node (Raspiblitz). I see my public ip on port 8333 has 8 conns.
However, when I check my node on 1ml.com my node is not found.
I did forward port 8333 and 9735 on my router.

Should I connect to a peer or create a channel before my node is visible for the outside?

You need to have a channel. Otherwise there won't be any node announce messages with the gossip protocol. Lightning network explorers can't see you without a node announcement message.

The fact that you need a channel to announce your node is a measure to fight SPAM in the gossip protocol. It is described in BOLT 07. Even if you have a channel it takes some time until your node announcement has propagated through the lightning network and being processed by 1ml. So bring some patience


Smart Contract token Ones tokens are issued by smart contracts on a existing blockchain, for example Bitcoin and distributed to the community, who and in wich currency the transaction fees will be realized ?

This is highly implementation specific.

For common token platforms, namely Bitcoin and Ethereum, fees for transactions must be paid in Bitcoin and ether respectively.

Your contract or token mechanisms can impose a further fee in your token, or another token, but the platform itself requires the transaction cost to be paid by the native currency.

There are various proposals (1, 2), mainly for ethereum, that would allow tokens to be used to pay base transaction fees as well. However, these will require a hardfork, and are not currently usable.


Can i trace a hacker by collecting data from Bitcoin api? In Japan, MtGox, the biggest bitcoin exchange went down and went bankrupt due to hackers.

So I'm working on a project in my College to enhance security of bitcoin transactions using the data mining concept on data collected through Blockchain API.

Is it possible to detect anomalous patterns and thereby to detected the presence of a hacker to then report it to the responsible authority?

To begin with, the Blockchain.info API is probably not the place to look for detecting anomalous activity on the Bitcoin network.  By consuming the API rather than running your own node(s) on the network, you will only receive pre-processed data.  It's like having someone chew your food for you.  It's best you run your own node.

Furthermore, hacking in general is not something that can be easily detected.  What you can do is search for occurrences of a particular exploit, once you know that a vulnerability exists.  For example, let's pretend you know about a vulnerability that can cause a double spend attack.  You know that in order to exploit this vulnerability, an attacker would need to broadcast 2 transactions simultaneously from opposite sides of the network, each spending the same UTXOs.  In order to detect this, you would need to have multiple nodes on the network that could detect the broadcast of each transaction (remember that nodes that already heard of one, won't broadcast the second because of the double spend).  Your nodes would have to communicate back to you, where the double spend attempt could be detected.

Keep in mind that the above example is an extremely naive double spend attack, that the Bitcoin network easily handles, but it exemplifies the complexity of your problem.  The MtGox exploit you mention used transaction malleability to trick a recipient into thinking they would get paid, when in fact they wouldn't.  It works because only one of two broadcast transactions will ever get into the blockchain.  Simply looking at the historical data in the blockchain will reveal only that a valid transaction went through...nothing suspicious.  You need to monitor an attack in real time to be able to detect it.

One more thing that you may have a problem with is reporting any activity to the "respective authority".  I think in your sample, you mean MtGox.  In order to do that, you would have to be able to identify who the victim of the malicious activity is.  That is not something easily done in Bitcoin, since users are pseudonymous.  You would need some way of mapping addresses to this "respective authority" in order to be able to do proper reporting.

To sum up, you need to:

Identify an exploit you want to track, not just general suspicious activity
Learn what needs to be detected for that particular exploit
Monitor the network directly, rather than consuming an API
Identify the victim so that reporting can be done (would be easiest if you are just monitoring cases where you are the victim)

Best of luck


Whatsminer event code E011 I have a whatsminer M3 working for the past 2 months with no problems at all, but yesterday it started acting strange since it is restarting every 15 minutes, all temperatures are fine between 80 to 85deg celsius, and I noticed that there is an event with the following data

Event: code E011
Event cause: Slot-0 Zero HS 1620 seconds
Event action: Zero HS warning
Event count: 3
Event source: System-monitor

I have searched everywhere but I couldn’t find anything, I also contacted Pangolinminer to no avail.

I really appreciate any help.

Thanks in anvance

Charles

Since the Whatsminer models aren't as common as some miners you probably will have to contact the whatsminerd company and ask them.


Is this the proper way to use Bouncy Castle to generate a Bitcoin compatible key? I'd like to use Bouncy Castle to generate the keypair for use with all *coin variants.

Is this the correct implementation to get the correct ECC curve that the *coin variants use?

    Org.BouncyCastle.Crypto.AsymmetricCipherKeyPair GenerateKeys(int keySize)
    {
        var gen = new Org.BouncyCastle.Crypto.Generators.ECKeyPairGenerator();
        var secureRandom = new Org.BouncyCastle.Security.SecureRandom();
        var keyGenParam = new Org.BouncyCastle.Crypto.KeyGenerationParameters(secureRandom, keySize);
        gen.Init(keyGenParam);

        return gen.GenerateKeyPair();
    }

Below extract should answer your question.

public class ECKeyPair implements Key
{
    private static final SecureRandom secureRandom = new SecureRandom ();
    private static final X9ECParameters curve = SECNamedCurves.getByName ("secp256k1");
    private static final ECDomainParameters domain = new ECDomainParameters (curve.getCurve (), curve.getG (), curve.getN (), curve.getH ());

    private BigInteger priv;
    private byte[] pub;
    private boolean compressed;

    public static ECKeyPair createNew (boolean compressed)
    {
        ECKeyPairGenerator generator = new ECKeyPairGenerator ();
        ECKeyGenerationParameters keygenParams = new ECKeyGenerationParameters (domain, secureRandom);
        generator.init (keygenParams);
        AsymmetricCipherKeyPair keypair = generator.generateKeyPair ();
        ECPrivateKeyParameters privParams = (ECPrivateKeyParameters) keypair.getPrivate ();
        ECPublicKeyParameters pubParams = (ECPublicKeyParameters) keypair.getPublic ();
        ECKeyPair k = new ECKeyPair ();
        k.priv = privParams.getD ();
        k.compressed = compressed;
        if ( compressed )
        {
            ECPoint q = pubParams.getQ ();
            k.pub = new ECPoint.Fp (domain.getCurve (), q.getX (), q.getY (), true).getEncoded ();
        }
        else
        {
            k.pub = pubParams.getQ ().getEncoded ();
        }
        return k;
    }

}

Check out https://github.com/bitsofproof/supernode for more details.


How good a "take off" on the block chain is Factom? An advertisement for Factom says that it improves on "speed, cost, and bloat." And it apparently provides a decent "proof of existence" for people who want to "copyright" their work.

What is it that Factom can and cannot do, especially with reference with the original block chain? Put another way, what are its advantages and disadvantages?

Factom provides a general purpose data layer secured by the Bitcoin blockchain.

Factom is a protocol run by a set of Federated Servers that allow users and applications to create their own "chains" of entries, which are really just whatever data the users and applications wish to track.

Factom then secures those chains by hashing them together with all the other data from other users, and a single hash is written to the Bitcoin Blockchain every 10 minutes.  Once data is entered into Factom, it cannot be changed, modified, reordered, or deleted.

One way to look at Factom is that it allows applications and users to create whatever data structures they need, then secure those structures with the blockchain.   So Factom provides a way to create audit trails that cannot be modified in any way.  Or ways of insuring entries in databases are both 1) secure, and 2) entered on a certain date.   Ways of creating audit trails for traditional banking that are as transparent and unalterable, and secure as the blockchain.

Because the history cannot be modified, Factom provides some interesting security features.  Identities can be verified and validated, and secured by time; nobody can insert a fake identity into the past.

The use cases are many, and go far beyond copyright.


Could you open a lightning channel in a confidential transaction? On an elements sidechain (e.g. liquid) could you open a lightning channel with a confidential transaction.
You could probably open a payment channel but could the channel 'speak' to other channels?
Or is lightning network possible on liquid but only in unblinded transactions?

Short answer: yes.

However that depends on the question if liquid supports segwit and creation of a lightning network. I have not looked at the details of liquid but I believe it does.

The lightning network protocol itself is pretty agnostic to the underlaying blockchain. If you look at the channel announcement messages defined in BOLT7 you will see that every message has the following data fields

[64:node_signature_1]
[64:node_signature_2]
[64:bitcoin_signature_1]
[64:bitcoin_signature_2]
[2:len]
[len:features]
[32:chain_hash]
[8:short_channel_id]
[33:node_id_1]
[33:node_id_2]
[33:bitcoin_key_1]
[33:bitcoin_key_2]

in particular the 32 Byte field [32:chain_hash] is supposed to state the hash of the genesis block (which could be the genesis block of the liquid network). In this way payments can be routed through channels supporting different assets (Bitcoin, litecoin, ...). I don't see any reason why liquid would not be supported.

Actually liquid would make more sense than other assets as 1 LBTC should still be the same value as one BTC. As for varying assets there is an issue pointed out by ZmnSCPxj last december regarding the problem with switching the asset during the routing process.


Bitcoin core v0.19.0.1 automatically prunes. I keep loosing the blockchain. How can I stop this? Bitcoin core v0.19.0.1 automatically prunes. I keep loosing the blockchain. How can I stop this?

I went into preferences and I de-selected the pruning. I also added the line prune=0 to bitcoin.conf. And in spite of all that when I booted my computer after a power outage Bitcoin Core desktop pruned my copy of the blockchain. At first when I booted my Mac Bitcoin Core showed me a screen asking me for the filesystem location for Bitcoin. I had to mount the USB external disk and enter its encryption password. As soon as I confirmed the file location it took it upon itself to prune. This problem is not limited to power outages. When I upgrade to the next version of the software it prunes again. How can I put a stop this?

Start bitcoin-qt with the -choosedatadir option. You'll get first startup dialog again. Uncheck pruning there if it is checked and make sure the datadir is pointed to where you want it to point to. Once you click OK, double check the settings that pruning is disabled. Then check for a bitcoin.conf file in your datadir. If it is not there, you are fine. If it is, make sure it does not have have a prune= line.

Bitcoin Core does not prune by default, but recent changes to the Choose a Data Directory dialog may automatically enable pruning.


Is it possible to collect bitcoins? (as a collectors item) Is there any analogy to collecting BitCoins as there is in the physical world?

For example, some notriety was given to the Pizza for bitcoin transaction here, and one of the answers was able to determine how diluted their wallet was with "pizza coins".

Is it conceivable that a "Bitcoin collector" may want to horde or save those bitcoins for historical value?

How would those bitcoins be traded and sold, without affecting the underlying bitcoin?

Well, first of all, there are the physical Bitcoins for one thing, which can be collected and traded neatly.

If you wanted to trade such historical Bitcoins, you'd probably need to follow some rules. For example, if you were interested in having pure Bitcoins and as close to the original transaction as possible:

Any Bitcoin that is a part of a given transaction, or a specific input is 100% pure and 0 removed.
Any Bitcoin coming from a transaction of purity p and removed status r is p% pure and r+1 removed.
Any Bitcoin coming from a set of transactions, one with purity p and quantity q1 and any others of total purity 0 and quantity q2, would be p*q1/(q1+q2) pure and again, r+1 removed.
You also have to take into considerations blocks that collect transaction fees for all of this, but I'd consider them to be 0% pure.

So, in the end you would be collecting your beloved Bitcoins to one or more addresses you
own and not spend them, you'd value transactions that are closer to the source and less diluted. If you'd want to flaunt your collection, you'd just show the unspent Tx list and sign some message with your private key. If you'd want to sell any collected Bitcoins, you'd just create a transaction from one of the unspent transactions, and hopefully not spend any coins on transaction fees, as that would make them more and more scarce.

I hope that covers everything. It was an interesting food for thought.


Unable To Find Transaction Outpoint I'm working on a project that involves constructing raw transactions and signing them locally before pushing to the network. I keep getting Unable To Find Transaction Outpoint 1a67415e9f892c31cdaec29f6bf7e8e7ffd5a7cdca52fc565ad345313f85b222:90463999.

Here's my tx hash

010000000122b2853f3145d35a56fc52cacda7d5ffe7e8f76b9fc2aecd312c899f5e41671aff5e64058a473044022052576f11b965d4b0a712b91e04377e25acebfad8093f3296deecb05ad429281502201ede7fb35f495985bb67d302465c6419fc1c683d26f7111d4e70cceac2dc86910141047920bd57b7b0dbf7ac242879ee1f1c4b87cbe30a1c31baa4d111850865042415d84f0a433174b3b17f41e280bfef85ff885dd8a1f25bf0823cfd77ec81bfc080ffffffff0101000000000000001976a914221382696ab041ff0bce2aceeea15132d9336fd488ac00000000

which decodes to

{
   "lock_time":0,
   "size":223,
   "inputs":[
      {
         "prev_out":{
            "index":90463999,
            "hash":"1a67415e9f892c31cdaec29f6bf7e8e7ffd5a7cdca52fc565ad345313f85b222"
         },
         "script":"473044022052576f11b965d4b0a712b91e04377e25acebfad8093f3296deecb05ad429281502201ede7fb35f495985bb67d302465c6419fc1c683d26f7111d4e70cceac2dc86910141047920bd57b7b0dbf7ac242879ee1f1c4b87cbe30a1c31baa4d111850865042415d84f0a433174b3b17f41e280bfef85ff885dd8a1f25bf0823cfd77ec81bfc080"
      }
   ],
   "version":1,
   "vin_sz":1,
   "hash":"a1981a142ba4966939d27e2cb78ae0a4d9550c91448105defdbed7ec71f2b351",
   "vout_sz":1,
   "out":[
      {
         "script_string":"OP_DUP OP_HASH160 221382696ab041ff0bce2aceeea15132d9336fd4 OP_EQUALVERIFY OP_CHECKSIG",
         "address":"147BM4WmH17PPxhiH1kyNppWuyCAwn3Jm4",
         "value":1,
         "script":"76a914221382696ab041ff0bce2aceeea15132d9336fd488ac"
      }
   ]
}

which seems to match the unspent ountput I see here: https://blockchain.info/unspent?address=1LCrg6DSqbcK5vh7XRAGEQA4jBpNigjwyV

So what am I doing wrong?

Your value for "vout" is invalid. The source transaction only has three, not 90464000.

 "vout": 90463999,

The real output you are trying to spend is 0. You confused tx_index and tx_output_n.


Is it feasible to derive the root key of an HD wallet from a large sample of child public keys? I'm considering the following architecture for a bitcoin-related service:

A BIP 32 HD wallet is created that controls all of the account keys for the web service. The private key is kept in cold storage, and the public key is stored on the server and used to assign bitcoin addresses deterministically to new accounts by deriving child public keys from the root public key.
Users can send money to the bitcoin address corresponding to their account in order to pay to use this service.
Money deposited by users is signed to my business account using an offline process that has access to the cold storage containing the private key

It wouldn't be difficult for an attacker to gather a large sample of child public keys (either by looking at the blockchain after I consolidate all of the micro-deposits) or by signing up for a bunch of accounts.

My question is this: Would having a large pool of these child keys make it easier to derive the private root key (since they are computed deterministically), or would there be no statistical advantage over attempting to brute force one of the child private keys (which can then be used to derive the root key)?

Thanks in advance. My understanding is that this is still secure, but I wanted to check with some of the experts here.

According to Mastering Bitcoin chapter 4 Hardened child key derivation, the master key is protected.

  As a best practice, the level-1 children of the master keys are always derived through the hardened derivation, to prevent compromise of the master keys.

So special care is made by wallets to protect that key specifically. Knowing the child indices, entropy, and child keys don't expose the master key as long as you keep the master key itself secure.

The chapter goes on to explain the normal child derivation's associated risks, but those are xprv keys.

Edit:

HMAC-SHA512

index   -->|HMAC-  |
master  -->|SHA512 |-->lt 256 bits --> + index + master --> child key
chain   -->|       |-->rt 256 bits -----------------------> chain

This is how I reimagined the diagram from chapter 4:

  The parent public key, chain code, and the index number are combined and hashed with the HMAC-SHA512 algorithm to produce a 512-bit hash. The resulting hash is split into two halves. The right-half 256 bits of the hash output become the chain code for the child. The left-half 256 bits of the hash and the index number are added to the parent private key to produce the child private key.

This didn't show the resulting addresses, but the text describes their
behavior as identical to random addresses.

Source Code

https://github.com/btcsuite/btcutil/blob/master/hdkeychain/extendedkey.go

170 starts comments describing how the IsPrivate flag is assigned.
 For a hardended child, it must derive from extended private key.

https://github.com/btcsuite/btcwallet/waddrmgr/wallet.go

2029 shows the BIP0044 HD structure
 being defined by using the 44 + hdkeychain.HardendKeyStart (upper 2^31 range) value

m/44'/<coin type>'/<account>'/<branch>/<address index>

https://github.com/btcsuite/btcwallet/blob/master/waddrmgr/address.go

316 newManagedAddressFromExtKey we know IsPrivate is true and calls newManagedAddress
 on 286 which generates the pub address using the same logic from public key at 301:

ripemd160( sha256( publickey ) )

where the publickey is elliptic-curve paired to prv

I believe the EC property is still what makes the resulting addresses irreversible.
Looking at the identifier notation, you can make guesses about common values:

m/44'/0'/1'/1/1

Assuming this is a very common HD wallet identifier, the other inputs are the root
seed and the pass phrase.

Collecting Significant Pool of Addresses

With the EC property, no amount of addresses collected can be reversed-hashed, then
reversed-EC'd to obtain the private keys.

So then the work could be to iterate through all possible inputs (seed, pass-phrase)
with the common
BIP0044 HD identifiers, and compare results to the collected addresses. Not trivial task.

Another layer of protection I can see, is to fan out at the child of the index:

m/44'/0'/1'/1/1/<here>

Import that public key to the online wallet. At each branch, you are increasing the
possible addresses by 2B. If the online wallet in turn generates a child per user,
that person only ever "collects" addresses for his/her branch; 2B addresses and
still they will not see addresses for a sibling user.
Reversing here only reveals the public key, another deterrent.


Question on getaccountaddress, getnewaddress, getAddressesByAccount I would like to get some feedback. I am new to the bitcoin development and I don't want to misunderstand something important before I start designing the application. I am working on bitcoin online-store integration. We are planning to show btc payment instructions to customers after order acknowledgment page so that they can send the payment from their private wallets.

We want to create one address per transaction. (take Transaction No = "abc"). My plan:

First call getaddressesbyaccount("abc"). If it returns blank address
list, then call getnewaddress("abc") to create new address for this
order. (Then create QR code and show to customer with expected
amount).
Otherwise, if the getaddressesbyaccount("abc") returns an address,
use that returning address.

This page says "getaccountaddress will return the same address until coins are received on that address; once coins have been received, it will generate and return a new address.".

I am planning not to use this function because if we expect 1 btc from the customer and he sends 0.5 btc, I don't want to create a new address. This is just to keep things simplified (1 address per 1 account). getaddressesbyaccount function returns a list of addressess associated with the account "abc".
I find getaccountaddress redundant for my needs. Is there any benefit to "getaccountaddress" creating new address if the current address has balance on it? Do you see any pitfall with my logic. Your feedback is appreciated.

Thank you,

I recommend that you do not use Bitcoin Core's internal accounting system because it is deprecated and will be removed in the future. Once it is removed, whatever code you have written that depends on it will be broken. Furthermore, the accounts system is not all that good.

I suggest that you instead maintain a separate database where you keep your own accounting system. That database would record each user's address and how much has been paid to that address. To figure out how much has been paid to each address, you would have a script that is called by -walletnotify which then looks up what address is being paid and how much for each transaction that you receive.

There are software that handle this sort of payment processing for you already that can be used with Bitcoin Core. One such software is BTCPay.


Armory Wallet With 2BTC Gone After 3 Years! HELP! I purchased 2 bitcoins with CoinBase online 3 years ago. I then sent them to an Armory wallet that I had on a server. Everything transferred successfully and I never thought twice about them disappearing. I have a paper back and an encrypted Armory backup of my wallet. I never made any further transactions.

I finally want to access my BTC in my Armory wallet. I started Armory and the program seemed to freeze many times without loading the block chain. I removed Armory and BitCoin-QT (now BitCoin Core). I installed the newest versions of both programs, downloaded the full block chain and restored my wallet using both the paper backup and the encrypted backup.

The balance of the wallet seems to be 0BTC no matter what backup I use. What happened to my 2BTC and how do I go about getting them back. I have full backup images of the server (c drive and d drive) before removing and reinstalling the software, if that helps.

I just can't seem to figure out where the heck my 2BTC went! Please help!

Here are all the details I could find.

My wallet after using my paper restore has the following two addresses.

Transaction #1 (small amount for testing)
Send to address:1CqmjgYj46vRqBxFvbt5WsqMudRShhGKmD
Transaction #: a821fac9e6216975fa8216045a3cd9ae500a82aa251988ca1f301c7287b74ab4

Transaction #2 (sent minutes after transaction 1)
Send to address: 16D1XkRHunUgSfuPDQZSPG42cAicTbSmzu
Transaction #: 5187441186fa834d8a27fb9302bbcb6d3993ff836e1918f8174d5b3266ffb21d

Transaction #3 (sent a month later)
Send to address: 1qjThyMzMrpy3m1esvXF32o3MHVixnxnA
Transaction #: 707e5f96d88134da5f5936b541df19faa9d7e5819d478bd5d533cbb2e9be62c9

Try searching the address at blockchain.info with the following link

https://blockchain.info/address/<your_addres_here>

It will give the current balance of that address, the transactions it was involved. Just in case if your bitcoins were transferred somewhere you would know.


What exactly are the rev00000.dat files? I've been looking at the on disk structured generated by the standard bitcoin-qt client. It looks to me that the rev?????.dat files are reverse application for blocks? So I imagine every single spent output is added to the reverse dat, so that they can be applied directly to the unspent pool during a rewind?

What exactly is stored, and what is the format?

Indeed, you can consider transactions to be 'patches' against the set of unspent outputs (the UTXO set): they consume some outputs, and they create some new outputs. Blocks are aggregated patches.

And indeed, to be able to undo the effects of a block on the UTXO set, a record with the reverse patch is written to the rev*.dat files (corresponding to the blocks in the same blk*.dat file).

The format is custom and very compact. For every transaction input (excluding the coinbase's, which does not spend anything) it contains the script and amount of the output being spent and whether it was created by a coinbase. If the output was the last of a particular transaction being spent, the transaction version and height in the chain it was created at are also stored.


Why did InstaWallet shut down, and what does this mean for Bitcoin? Title is pretty self-explanatory. Just went to InstaWallet's site and it is clearly shut down, probably for good...

Apparently someone got access to their database (another link)

The Instawallet service is suspended indefinitely until we are able to
develop an alternative architecture.
Our database was fraudulently
accessed1, due to the very nature of Instawallet it is impossible to
reopen the service as-is.
In the next few days we are going to open
the claim process for Instawallet balance holders to claim the funds
they had stored before the service interruption.

This probably means that one should be more careful when using online Bitcoin services. Most of these do not hire security consultants (or don't hire enough), as Bitcoin is still a fledgling market and they probably don't have enough resources to ensure foolproof security. I would probably trust Mt. Gox's security (not completely, just to a reasonable degree) as it is a rather big company, but smaller ones like Instawallet are always in danger of being hacked.
If you own a bitcoin service, hire a security consultant. The nature of Bitcoin makes it hard to pursue a hacker via the legal system, so if something is compromised, there's not much going back. So don't let it be compromised in the first place.
1. Sounds suspiciously like SQL injection


Synchronising official bitcoin wallet for the first time; at 95% started going backwards I.E. 9900 blocks remaining, 9904 blocks remaining and the total percent synced is decreasing. Is this normal behaviour? I'm on a mobile broadband connection but http connections are working just fine. It also says I have 8 active connections which I understand to be the maximum?

Thanks.

Looks like you were just unlucky in choosing your peers.

When connecting to a peer your client and the peer exchange a handshake message. Part of this handshake message is the height of the longest chain the peer has locally stored. Your client will then starting to download blocks until it catches up to the top of the longest chain. If the peers you connect to happen to be also catching up with the chain you will only see the length of their chains and will be unaware about the real length of the longest chain in the entire network.

Nothing to worry about, you will eventually have an accurate estimate of the real length: as soon as you connect to a peer with the longest chain, or one of your peers has caught up to the longest chain, your client will update its estimate.

Reconnecting also works as new peers are chosen. When you wrote your question, on October 24th, the longest chain was 204'663 blocks long, so the ~10'000 blocks or so were quite a long way off. Hopefully by now you caught up to the head of the Blockchain.


Cannot Making Outgoing Payments with blockchain.info API v2 I CAN't do Making Outgoing Payments :-(
i use blockChain api v2 with local nodeJS.
I work with Laravel 5.4. I have VPS server.
I installed local nodeJS service to handle the calls.
I started work of port: node blockchain-wallet-service start --port 3030.
Then I logined to my wallet.

 $url = "http://127.0.0.1:3030/merchant/$guid/login?password=$mainPass&api_code=$myApiKey";
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
$ccc = curl_exec($ch);
$json = json_decode($ccc, true);
 var_dump($json);

Here, I got a good answer:

array(3) {
   ["guid"]=> string(36) "xxxxxx-xxxx-xxxx-xxxx-xxxx..."
   ["success"]=> bool(true)
   ["message"]=> string(94) "This endpoint has been deprecated. You no longer
                             have to call /login before accessing a wallet"
 }

I can Create Wallet API, check balance, do Listing Addresses, do Generating a new address and do Address Management with positive answers.
BUT I CAN't do Making Outgoing Payments.
I got next answer:

 array(1) {
    ["error"]=> string(34)
    "Unexpected error, please try again"
 }

Who knews what would be the solution?
I must get Response:

 { "message" : "Response Message" , "tx_hash": "Transaction Hash", "notice" : "Additional Message" }

Thanks a lot!

https://github.com/blockchain/service-my-wallet-v3/issues/108
Please update your API version and see the link.


Keeping the blockchain index after Bitcoin-Qt upgrade Can this be done or do everyone updating their client everytime a new version is announced on bitcoin.org has to re-do the whole process over again?

On OS X, (probably with the other two OS's as well) blockchain data is kept on a seperate directory in ~/Library/Application Support/Bitcoin ; however a new version of the client needs to reindex the whole thing over again- which is a super time-consuming process..

Version 0.8 of the reference client changed the database format completely, in order to scale better. That meant a one-time rebuild that everyone had to go through, as converting the old database would have been error-prone.

With that change, the transaction index was made optional, and off by default. This is because for normal operation (verifying and processing blocks and transactions, and maintaining a wallet), such an index is not necessary.

An option -txindex (or txindex=1 in bitcoin.conf) was introduced to re-enable this transaction index (which is necessary for the getrawtransaction RPC call). It has to be specified when the database is created though, so at first run of a post-0.8 version, or when explicitly rebuilding the index (with -reindex).

This type of database format change is not expected to happen frequently.


What type of Bitcoin wallet is more secure than others? What type of Bitcoin wallet is more secure than others among Paper wallet, Physical bitcoin, Mobile wallet and Web wallet ?

This is similar to comparing apples to oranges.

Let's talk about keys, and not paper/physical/web wallets.

A key is only as secure as the weakest link that needs to be broken to access it. A key printed on a piece of paper locked in a secure bank vault is considerably more secure than a web wallet hosted on a shared hosting instance somewhere.

Security should be approached based on what you are trying to prevent against. Inherently, a web wallet requires trusting a third party, which is bad from the a security point of view. Although a well designed web wallet, following the best practices is less susceptible to being drained than a private key stored in your desk drawer during a home invasion, it is more susceptible to other kinds of attacks. Moreover, you rarely have a guarantee that the people who operate web wallets are not storing your keys in a manner that make them freely accessible to them.

For a secure wallet, you need to find a key storage method that protects against attacks you are likely to face. For most people, this can be as simple as using Electrum, or a hardware wallet. For a company or exchange with millions in funds, this will require much more work, and may involve multisig operators, bank vaults, split keys, and other security measures that would be overkill for a regular user.

There is no definitive approach to "most secure".


How can Open Transactions benefit Bitcoin? OT is being integrated into the Multibit client.

How can such integration benefit users? What are some things it enables?

Market exchange

OT includes bid/ask markets, allowing for trade between assets. And unlike most exchanges, the voting pools feature makes it impossible for the server to steal the coins.

Untraceable transactions

OT incorporates Chaumian blinding (untraceable cash), meaning it can provide anonymity and untraceability, similar to what the Bitcoin community strives for with existing mix services. (Bitcoin by itself is publicly-audit-able, which is a strength, but is also the opposite of untraceable. Its benefit is censorship-resistance, not untraceability, which can be added separately using OT.)

Instant settlement

OT has instant finality of settlement (instead of waiting 10 minutes to an hour for a transaction to clear.) This can be useful where merchants and and shopping carts are involved.

Micro-transactions

Micro-transactions will be more feasible on transaction servers than they would be on the blockchain.

Cash streaming protocols

Cash streaming protocols, in general, should become more prevalent and help to solve issues of resource allocation on mesh networks, anonymous networks, etc. Virtual Tahoe LAFS hosting and so on will eventually become more available, whether via OT or some similar system. (This would help protect the lives of Syrian bloggers murdered by snipers, and the lives of Chinese bloggers unjustly imprisoned to decades+ of hard labor--and to protect the anonymity of Mexicans who otherwise risk being disemboweled and strung from a bridge when following a "Real Names" policy.)

Operates securely on low-trust servers

OT cannot lie on your receipt. It cannot change your balance or forge any of your transactions. (Bitcoin also is like this, but it's still worth mentioning.) Combined with an auditing protocol, this makes it possible to run low-trust servers.

No transaction history

On OT, unlike most other systems, and unlike the blockchain, you will be able to prove which instruments are valid, and which transactions are cleared, without storing any transaction history, as long as you keep your last signed receipt. This is useful to all parties, and also reduces the cost of running a transaction server.

Full range of financial instruments

OT supports a full gamut of financial instruments, including cheques, transfers, cash, cashier's cheques, receipts, recurring payments, market offers and trades, and smart contracts (scriptable clauses - write your own.) You will have to decide for yourself how to best use these capabilities.

You could use OT to write a market exchange, or online wallet or personal wallet. (Of course these exist already, but I'm just saying...)

Smart contracts

OT makes it possible to create custom-scripted agreements between parties, to be executed on the server side.

You could use OT to offer escrow services. You could devise your own escrow contract in script form, and then OT will process it.

Client-side scripting

OT also supports client-side scripting, meaning that people can combine "Unix scripting" with "financial transactions". The possibilities are endless, but that part is really up to the developer community.

You could use OT to build a digital ticketing system, printing out tickets with QR codes or whatever.

In-game representations of real-world financial environments

You could use OT to build a full financial transaction system into an online game or virtual universe. (Gold duplication can get to be a real issue on games.) People on the game would be able to open accounts, withdraw and deposit cash, write cheques, trade on markets, just like people in real life. People would even be able to issue their own currencies, and trade in basket currencies.

Protection against online wallet fraud

At some point OT will support Bitcoin voting pools, meaning it would be impossible for any single server to just disappear with your Bitcoins. (A problem currently endemic to the Bitcoin world.) This will be a protocol between OT servers based on existing features in the Bitcoin script language (like multi-sign.)

This capability goes beyond mere auditing or proof-of-reserves, since it actually prevents a server--or a malicious employee, or a hacker--from stealing the coins.


Why Copay sends amount from address to address? I received a payment to my Copay wallet, and in some reason Copay regularly send it from address to an other address and so forth. I can see it in https://blockchain.info What is the purpose of it? Anyway the balance is slightly falling what irritates me a bit. Why? What is the purpose behind it? Because starting application, because updating iOS?.

If you receive a payment in your wallet, it should stay there unless you make any transactions yourself by purpose. Anything else would get me worried to say the least.


Block Header - Encoding/Serialization I have read that Previous Block hash takes around 32 bytes in the Block Header. Since it is a SHA256 hash which is 64 characters long, shouldn't it take 64 bytes as well? Similarly, Merkle root and other parameters.

Take a look at the following:
    010000009500c43a25c624520b5100adf82cb9f9da72fd2447a496bc600b0000000000006cd862370395dedf1da2841ccda0fc489e3039de5f1ccddef0e834991a65600ea6c8cb4db3936a1ae3143991

Length: 160

Apparently, it is x2 of what is actually written everywhere.

What kind of encoding is used here?

That is hex encoding, two ASCII characters per byte.

SHA256 output is 32 bytes, or 64 characters when hex encoded.


How to connect bitcoind mainnet node on AWS EC2 by using rpcjson? I'd like to access bitocind mainnet node on AWS EC2 from ruby. I've written as follows using rpcjson, however it cannot connect, then returned the error

client = RPC::JSON::Client.new 'http://rpcuser:rpcpassword@publicIP:8332', 1.1

Operation timed out - connect(2) for publicIP port 8332

publicIP is the Public IP shown on EC2 instance page.

On the other hand, when I wrote as follows in order to connect localhost testnet node, it has no problem.

client = RPC::JSON::Client.new 'http://rpcuser:rpcpassword@127.0.0.1:8332', 1.1

Could you tell me what is the problem?

Most likely, you'll have to open that port on your EC2 instance.


Can't receive payments from htlc.me Am testing LN with lnd 0.7 and autopilot on my testnet node
I can pay successfully invoices created by htlc.me
But when trying to receive payments, example :

lntb843700n1pwjyglqpp5laas3dxqgc5wx3dpl279spzlk9j96pmzp6fyyfkj9v0ju5l72jksdq0dp6xccewd4jjqvccqzpgxh7l8afrmnmuy9mz95mf6mr9mctedw4wxq3sy5gscvyuh55qp5zjnen78hehanr89qa20ptwfmdgk7rpgrt29y34affnwxv5eutgddgq8jh57x

Am getting :

Send Payment Failed
Payment failed to send. This can happen due to temporary network connectivity issues or an unexpected server error.

Also tried adding my node via "Request Peer Addition"

030bc9de6e201d2428eb80890d023d48ef752533453ec74b993b1fede28c178435@91.121.210.16:9736

And got :

Peer Connection Issue
Could not connect to peer :( Check that the address is correct?

I tried multiple times but still having the same issues
Port 9736 is open

It's an issue related to htlc.me
I can receive payments using lnd.fun website


Calculating address balance Is there some method how you can calculate the balance of an address without resorting to web-based API's? When I import a private key the rescanning of bitcoind takes hours. I know to get a balance you would need to iterate over all transactions in the whole chain, but maybe there is still some optimization possible.

You would need to use a client node that has a different architecture, from the satoshi's client.
Specifically, the client must be able to quickly browse through all the unspent outputs.

You may want to check this table for clients that support Multi-wallet.
Among them, there is a new client Gocoin. It is currently in a testing phase, and you need to build it yourself from sources, but if you have a PC powerful enough to run it, it needs less than a second to give you an unspent balance of any standard bitcoin address.


Why does Bitcoin Core not support showing the prices in USD or other fiat currencies? One of the major annoyances I have with Bitcoin is that the only wallet/client I trust to some degree, Bitcoin Core, for some reason only shows sums in BTC.
Every time I want to make a transaction, I have to copy and paste sums from it to my special, separate calculator to get how much money it is. And when it's time to make the transaction, and it displays the fee amount, I see it only as BTC. I then have to manually type the sum in (since it doesn't let you copy the fee part) to see how much the fee is.
This minor detail really causes a lot of frustration. I truly don't get why they won't just add this.
And I don't agree with those who would say that this would require it to rely on some central entity, etc. The Bitcoin network, transferring tons of data around the clock, could very easily be made to keep track of a small blob containing the top currencies' exchange rates against Bitcoin. It would not violate anyone's privacy to have that extra data shuffled around, and it would not be part of the blockchain, but simply the "RAM network", like all the other "communication signals". It's a very minor piece of data, and infinitely useful. It could even have multiple different ones and let you choose which one you want to use.
Why do they not want to add this feature?
PS: I'm not going to switch to a different wallet/client. Please don't suggest that.

Why do they not want to add this feature?

There is no "they". You can create issues or open pull requests to see feedback about a feature request from others.
Few reasons I would not want such feature in a bitcoin wallet:

Bitcoin Core wallet is an open source bitcoin wallet which is used by people from different countries with their fiat currencies. Lot of currencies and API for exchanges will be used to add such feature.

Bitcoin wallet doesn't need amounts mentioned in other currencies when it has its own currency which is BTC. I do not want to see amounts mentioned in EUR when I login to my bank account in India. Amounts mentioned in INR works better.


Set a public node to auto forge / mine / stake in NXT / Ardor without login via the gui? Installed nxt/ardor on my public server and would like to have it auto mine / stake with an account. How can this be done without having to login to the gui?

On your linux box you can type the following:

curl -d requestType=startForging -d secretPhrase="PASSPHRASE" http://localhost:7876/nxt

--

Without curl: wget -qO- 'http://localhost:7876/nxt?requestType=startForging&secretPhrase=sssecrrretPhPhPhphrrrassssse'

https://nxtwiki.org/wiki/The_Nxt_API#Start_.2F_Stop_.2F_Get_Forging

You can use startForging, stopForging or getForging in order to start forging with an account, stop forging, or check that an account is forging.


Bcoin wallet always has unconfirmed balance I have locally running bcoin node in testnet and acquired test bitcoins through faucet. Now, when calling balance check via bcoin cli wallet balance (when synchronization completed) I always receiving following result:

{
  "wid": 1,
  "id": "primary",
  "account": -1,
  "unconfirmed": 550722654,
  "confirmed": 550722654
}

I see that wallet contains amount but a bit confused that unconfirmed field contains the same value as confirmed one. Is it correct?

This probably helps you:

https://github.com/bcoin-org/bcoin/issues/163

  What we really needed was a "real-time" balance, and "confirmed" balance.
  So the simplest solution was:
  confirmed = what is on the blockchain
  unconfimed = what is on blockchain + mempool
  Essentially unconfirmed is your real-time balance. confirmed is your blockchain-secured balance.


Coinbase transaction data Can a coinbase transaction contain only data: 03 - length and 030303 - coinbase itself, or should the coinbase itself contain the height of the block?

https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki

  Add height as the first item in the coinbase transaction's scriptSig, and increase block version to 2. The format of the height is "serialized CScript" -- first byte is number of bytes in the number (will be 0x03 on main net for the next 150 or so years with 223-1 blocks), following bytes are little-endian representation of the number (including a sign bit). Height is the height of the mined block in the block chain, where the genesis block is height zero (0).


Mining Bitcoins on PC - Experiment, looking for advice or simple instructions I am absolutely new to Bitcoin and mining, I know that mining at home using a PC is not worth even the time and takes years to get any income out of it.
The thing is I need to mine at home using a PC for experimental purposes and education, so basically i just want to make something even like 0.0000001 bitcoin, and only bitcoin no other crypto currency.
I downloaded the Bitcoin Core wallet and downloaded all the years transactions to be up to date, where to go from there i have no idea, i found several miners but they are all confusing, I can't even find my address to start using the basic miners, so please could you give me a guide or a step by step instructions on how to proceed please? I need to do this alone not within a group (pool) of miners as most sites suggested.
Thank you

As has already been commented, this is really not possible. You cannot solo mine Bitcoin with a PC. Even with an ASIC, you cannot solo mine. You simply won't have enough hash power to even get (as you said) 0.0000001 BTC.

If you are really set on mining, I would suggest you look at other currencies, and GPU based mining. You will however, be required to use mining pools. That is a necessity. If you are looking for a very simple GPU miner, you may checkout MinerGate (note: I am in no way affiliated with MinerGate, and I have never used their product).


What causes synchronous price movement within and between crypto exchanges without matching trades? I have observed different crypto exchanges for quite some time now and analyzed the potential for different kinds of arbitrage. However, I don't quite understand what I am seeing.
Examples:

Observing Poloniex and Binance web socket streams for the same symbol, it seems like most of the time Poloniex lags behind Binance but it generally moves the same way. Interestingly, these price movements occur without any (visible) trades happening. What could cause this effect? Who makes money from this if there are no trades?
Triangular arbitrage rarely seems profitable within one exchange. I would expect that multiple symbols on a smaller exchange like Poloniex would need some time to return to balance after a major price movement. However, it seems like markets adjust faster than the real-time web socket API will let me look at the situation (1ms latency).

The attached image (sorry, didn't find a bigger one in my files) shows Binance (blue) and Poloniex (green) prices moving. There are no trades on Poloniex during this time.

My understanding is that prices displayed on exchanges is not based solely on the last filed order, but also on the existing orders, which change constantly as traders manually and automatically move their orders up and down. Given enough traders, we can expect that they examine and perhaps participate in other exchanges. Some trying to make arbitrage like you and others just trying to feel informed. Thus, we can expect that traders change their open orders on all the exchanges that they participate in, but based off their impression of price/value in reality, not just the published price on any individual exchange.
Theoretically it would seem possible that a perfect storm of too few traders that are also ignorant of price changes on other exchanges might not change their orders, leaving price on that exchange unchanged while it rapidly moves on others. In my opinion, such rare instances are really the only opportunity for arbitrage to be profitably worthwhile.  The whole point of a published price is to be as close to public perception as is possible. Should a new up-and-coming exchange fail horribly in that regard, they would lose trust of the few traders they already have.


Inequality in a Bitcoin World So let's assume at some point in the future bitcoin has replaced fiat currencies and we thus have a fixed money supply. Let's also assume we have increasing production and therefore deflation.

It seems that wealth could then be preserved simply by holding onto it without even taking some investment risk as one has to do today.

Wouldn't the effect of this be to make the wealthy extremely risk-averse?
Wouldn't this increase wealth inequality and make social mobility more difficult?

Footnote: Defending Some Premises

As one can see below, there is an extensive discussion below with @david-schwartz on whether the premise is correct in the first place. To keep this a bit more readable I'll update this post with what I think are his main arguments and my view on these.

Is (predictable) deflation even possible?

He argues that no such thing as predictable deflation can exist. I think that is incorrect. If you have constant monetary base and increasing productivity (e.g. technological innovation), you will have deflation. There is nothing contradictory about that.

Investment & Deflation

He also argues that if you don't invest you become poorer thus if the wealthy don't invest they won't remain so. But let's say you have 10% deflation and spend 8% of your money, then you are becoming richer every year (i.e. your purchasing power increases). This massively diminishes incentives to invest and it seems that would reduce social mobility (all else being equal).

As Bitcoin is a digital-specie currency, if it replaced all fiat currencies it would be the equivalent of reverting to a (digital) gold standard and can be answered in much the same way.

Firstly, a gold standard is deflationary. Explaining this again and again is tedious, so I'll summarise:

People provide goods or services to others and receive IOUs for other goods and services, redeemable on the rest of the world; this is the essence of money.
As more people interact and do so faster and faster, the money supply must expand to reflect the transaction volume; otherwise earlier unredeemed IOUs are worth more than new IOUs for the same goods and services.
A currency with a fixed limit (be it Satoshis or Gold atoms) will either not expand (everything has been mined) or will expand slower than the rate required by the economy for its money supply1.
Hence, either society cheats and detaches their promissory notes from an exact gold amount (fractional reserve banking and the like) and thus moves towards a fiat currency; or suffers the acute boom and bust cycles of purchasing power and liquidity depending on when hoarders hoard vs sell their stockpile. If you are that lucky. Strictly speaking, hoarders as rational actors would hoard forever and the entire economy would need to bootstrap from barter or a different currency.

Secondly, possession of a deflationary currency encourages hoarding if the society is forced to use only that currency.

A person with a large amount of deflationary currency will consider it an investment as its purchasing power will increase the longer they don't spend it (sell the IOU for goods and services). Everyone receiving the currency will do the same2. The economy slows down both directly through forgone purchases and indirectly through no investment in endeavours with a risk greater than zero.

  Wouldn't the effect of this be to make the wealthy extremely risk-averse?

The wealthy are already extremely risk-averse. This isn't as apparent in a fiat currency as those currencies reflect (however poorly due to manipulation) the underlying economy3 where inflation driven by productivity growth, population growth and the price/wage spiral requires equity to be put into risky investments that outpace inflation. Indeed this relentless hunt by the wealthy for places to park money without the risks of normal productive investment created the sub-prime mortgage and financial derivatives market. And the counter-reaction of deflationary cryptocurrencies, when in practice honest propagation of risk information would have prevented the same crash.

So yes, a deflationary currency would allow the wealthy to better express their existing risk aversion.

  Wouldn't this increase wealth inequality and make social mobility more difficult?

Yes.

Both inflation and deflation entrench existing wealth inequality as the countermeasures require discretionary wealth to begin with. But while inflation forces the rich to continuously re-inject their wealth into society to keep it4, deflation requires them to hoard their money unless they just want to give it away. A lower and middle classes (i.e. those without sufficient assets to thrive without working) must spend what they earn and thus are essentially subsidising the rich in a deflationary economy; at the cost of their own social mobility.

 1. A true post-growth society wouldn't need an expanding money supply. But then the key differences between specie and fiat currency would be irrelevant to an "economically static" society anyway. Money itself would simply be a token of energy or entropic appraisal with culturally-specific multipliers.
 2.  Except poor people living hand to mouth. Which is why widespread poverty is considered to be an excellent way to keep money circulating in an economy that would otherwise be deflating.
3. As more accurate currency price signals out-compete inaccurate signals over time due to exchange velocity and trustworthiness of face value; hence the slow and often belated but forward progression towards currencies that better reflect the global economy.
 4. This doesn't make them any poorer as they own, to use a trite Marxist phrase, the means of production. But it does circulate the money which is a good thing. Consider it the objective of lending the serfs ploughs to work their allotment instead of hoarding the ploughs uselessly in the castle.

Caveat:

There is no hard fixed requirement that Bitcoin remain a deflationary currency.

It is possible - though perhaps not likely - that exchanges and mining consortiums will transform  into (or be purchased as) off-blockchain central banks with the capacity to manage Bitcoins as a fractional reserve or outright fiat currency.

TL;DR

Yes and Yes + Caveat.


Does a Block contain the list of transactions? Or only the Merkle Tree? I was wondering how a block encodes its set of transactions. I know a Merkle Tree is generated, and that it encodes a Hashed version of the transactions. But is the Merkle Tree included in the Block that gets sent to the other nodes for validation?  Is there a list of transactions that it also sent?

In my understanding, when a Node wishes to 'Mine', they will:

Generate a new block
Create a coinbase transaction
Gather a subset of the other incomplete transactions (those that have not yet been put into a block) from its copy of the blockchain.
Generate a Merkle Tree using the transactions from steps 2 & 3
Increment a Nonce repeatedly until the Hash of the <Previous Hash, Nonce, Transactions from 4> begin with a certain number of 0s.

It seems that to validate each individual transaction (to ensure money is not double-spent), it would be good to include a list of transactions. But to check that the proof-of-work has actually been completed, the other nodes need the merkle tree to quickly hash.

It is very possible that there is also a way to obtain the list of transactions from a merkle tree, but I just don't understand what that process looks like.

P.S. I am building my own Python demo implementation of a blockchain currency, hence the more-theoretical/less-practical questions.

Thanks.

You cannot obtain a list of transactions from the merkle tree.

The merkle tree root is part of the block header, which as you said, allows quick verification of the proof-of-work.

After the block header, each block contains a list of serialized transactions in the order they appear in the merkle tree. A complete block is a block header + list of transactions.

When validating a block, nodes will check:

The proof of work (this can be done with just the block header. However, just because the block header validates, it does not mean the block is valid)
The merkle tree - Nodes will take the list of transactions and reconstruct the merkle tree to ensure the root matches what is in the header
Each individual transaction - Individual inputs and outputs are validates to ensure they meet network rules, and that no double spends exist.


How mtgox and bitstamp calculate the bitcoin price? Trading platforms like mtgox and bitstamp display the current bitcoin price on the top. How they calculate that and what effect it has when trading? What labels Last|High|Low and Vol actually mean?

I do not understand what do you mean by the current bitcoin price on the top (I can not see it), but I will clarify on some other numbers.

Last - the price of bitcoin based on the last transaction. So if I bought 1.2 bitcoins with a price of 950$ and this is the latest transaction so far, this number will appear in the last.

High - What was the highest price for the day. Bitcoin price fluctuates and if you assume that during the day the price went from 900 to 920, dropped to 870 went to 980 and right now it is 950, the highest per day was 980. This number you will see in high.

Low - the same idea as with high, but the lowest number. For this example it will be 870.

About Volume, I might be wrong so if there is someone who knows better, please edit my post. Volume this is the total number of bitcoins which are putted on sale.

Therefore the weighted average is calculated in the following way. Assume you have 3 guys putting their prices on bitcoin. First one wants to sell 1B for 900, second 3B for 910, third one 2B for 890. The weighted average will be (1*900 + 3*910 + 2*890)/(1 + 3 + 2) = 901.666


Who pays the fees for transactions initiated by a smart contract in Ethereum? I am wondering who pays the fees for transactions initiated by a smart contract in Ethereum?

For example, if I have a contract that simply forwards any payment made into it to someone else, does the contract have to pay its own transaction fees for payments moving out, or does the transaction that initiate the contract have to pay the fees for both its transaction and the resulting transaction coming from the contract?

A smart contract can only initiate a transaction when it receives a transaction from either another contract or a user. Thus, all transactions must originate from some user transaction, and it is this transaction that must pay for fees. The amount of fees can be limited by setting the gas limit on that transaction to prevent a malicious contract from consuming a horrendous amount of fees.

Also, all transactions that are the result of a specific user transaction will occur before any other user transactions (and it's subsequent contract transactions) are processed.


export Bitcoin Cash private key from Bitcoin QT after send out BTC to exchange After Bitcoin Cash folked,  I have sent BTC to exchanges from wallet Bitcoin QT. Before sending, I have export out a file with format as below in .CSV file:
Confirmed,Date,Type,Label,Address,N,ID
TRUE,2017-07-30T21:25:50,Received with,tes,X_address,X_number_of_bitcoin,X_ID

I thought the X_ID is the private key at that time. However, when I tried import X_ID into another BCH wallet, the error message said: the format is not correct. I appreciate anybody's help in term of how to get the private key  at this point.

First of all, there is no "private key at the time". Your wallet does not have one private key which it changes for each transaction or on a time basis. Rather your wallet contains multiple private keys, one for each address you use. It is not one private key per transaction.

Secondly, the ID in the exported .csv file is not the private key. In fact, there is no way for your wallet's private keys to be exported from the GUI. You will need to open the debug console (Help > Debug Window > Console) and use the dumpwallet or dumpprivkey commands to get the private keys. The private keys will always begin with a 5, K, or L. If they do not, then those are not valid private keys.

However you should not need to export your private keys to import into a Bitcoin Cash wallet. You can use a Bitcoin Cash wallet which is based on Bitcoin Core; such wallets read and use the Bitcoin Core wallet.dat file.

So to be able to spend your Bitcoin Cash, first move your Bitcoin to a new wallet. Then download and install a Bitcoin Core based Bitcoin Cash wallet such as Bitcoin ABC, Bitcoin Unlimited Cash, and Bitcoin Classic Cash. Then copy your Bitcoin Core datadir (which includes the blockchain, the databases, and your wallet.dat file) and have your Bitcoin Cash client use it. You may need to have it reindex the blockchain. Once that is done, you should be able to spend your Bitcoin Cash and use the Bitcoin Cash wallet software as you normally do with Bitcoin Core.


How to decode transaction inputs from raw data using bitcoinjs-lib? I need to calculate fees for each transaction in block.

I retrieve raw block data and use bitcoinjs-lib library to decode it to Block object:

const block = Bitcoin.Block.fromHex(data.rawblock);

It has an array of Transaction objects. However, while these transactions' outs have values, ins have only hash and script.

How should I process this data so I can get total in and out amounts and calculate transaction fee?

You will, by default, only see the values of the outputs and not the inputs. To gather all values for inputs, you will need to loop through your inputs and use an API to gather the transactions where the inputs were once outputs.

I used the BitPay insight API and left some notes in the code below:

var Bitcoin = require('bitcoinjs-lib');
var request = require('request');

function getRawBlock(blockHash) {
  return new Promise((resolve, reject) => {
    request('https://insight.bitpay.com/api/rawblock/' + blockHash, // hitting an insight API to get the full block
      (error, response, body) => {
        try {
          var block = JSON.parse(body); // result is in JSON
          resolve(block.rawblock)
        } catch(error) {
          reject(error)
        }
      })
  })
}

function getTransaction(transactionId) {
  return new Promise((resolve, reject) => {
    request('https://insight.bitpay.com/api/tx/' + transactionId, // hitting an insight API to get the full transaction
      (error, response, body) => {
        try {
          var transaction = JSON.parse(body); // result is in JSON
          resolve(transaction);
        } catch(e) {
          reject(e)
        }
      });
  })
}

getRawBlock('000000000000000000aabc9831a830ab8542137c68998368b86f9127432767d5')
  .then((rawBlock) => {

    var block = Bitcoin.Block.fromHex(rawBlock); // use bitcoinjs-lib to convert the raw block to usable data
    var transactions = block.transactions; // transactions reside here
    var transaction = transactions[1]; // using second transaction as an example since the first one is miner reward
    // you can loop the transactions the way you like

    var inputs = transaction.ins; // will need to use the API to get the outputs that each input once was
    var outputs = transaction.outs; // no need to hit API for outputs, value is in outputs[i].value

    var inputsWork = inputs.map((i) => { // map the inputs to an array of promises which we can run later
      return new Promise((resolve, reject) => {
        var transactionId = Buffer.from(i.hash).reverse().toString('hex'); // derive the transaction id this way
        var outputIndex = i.index; // output index is also needed
        getTransaction(transactionId)
          .then((transaction) => { //this transaction belongs to the looped input (i)
            var outputs = transaction.vout; // get outputs of transaction
            var output = outputs.find((i) => (i.n === outputIndex)); // match the input/output indexes
            resolve(output.value); // resolve with our output value
          })
      })
    });

    Promise.all(inputsWork)
      .then((inputValues) => { // execute array of promises for inputs

        var totalInputs = inputValues.reduce((a,b) => (a+b)); // add up the input amounts
        var totalOutputs = outputs.reduce((a,b) => (a.value+b.value)); // add up the output amounts
        totalOutputs = totalOutputs / 100000000; // outputs in satoshis

        var feesIncurred = totalInputs - totalOutputs; // fees of a transaction is input amount - output amount
        console.log(feesIncurred); // log the fees to your console
      })

  })

Cheers!


How can I pay with Bitcoin on overstock.com o.co? I just registered at overstock.com to buy something, because I heard that they accept bitcoins as of today. But when I checked out, there was no option to pay with bitcoins. Only PayPal and credit cards.

Do I have to do something specific to activate bitcoin payment?

Can someone post a screenshot of a working Bitcoin checkout?

Only for the USA at the moment according to reddit

  If you go to the checkout page on Overstock you'll see an option to
  pay with Bitcoin!

  -edit- For now it's only available on the U.S. checkout but I hear from reliable sources that they will roll it out to international
  after a bake in period.


Cryptonote vs an X11 Coin Which one is a more desirable feature in an altcoin?
The X11 or the Cryptonote?
Also why cnt the 2 be implemented together?
X11 seems to allow 11 algos to mine the coin, and cryptonote is based on something else.

''Which one is a more desirable feature in an altcoin?'' that's not an easy question and the answer depends on the philosophy you impart in your coin. X11 is in essence a PoW with 11 hash functions (blake, bmw, groestl, jh, keccak, skein, luffa, cubehash, shavite, simd, echo) if one of them gets cracked there's still 10 more to deal with. It does allow for reduced energy draw and heat output from GPU but that's pretty much all I could say about it's cons. The downside of X11 algorithm is in that it's not as long-term as some expect it to be. The experts claim that it will take a maximum of two years before this algorithm gets ASIC’d. Even though it’s complex, X11 is one of the mining algorithms which isn't relying on hardware memory hence it's much more simple to implement on ASICs. In my opinion all PoW algorithms need to use memory bound functions so if you are thinking long term I'd suggest you go with CryptoNight.

CryptoNight relies on random access to the slow memory. And a megabyte of internal memory is almost unacceptable for the modern ASICs. So far quite a few coins have been using this algorithm, all of them are CryptoNote-based. Bytecoin (BCN) is probably the most prominent one since it was the first coin to have built its architecture around the CryptoNote protocol. Bytecoin has been around since 2012 but from what I've heard the development started as early as 2009. It is a CPU-minable coin with anonymous transactions feature and immunity to ASICs. You could try mining Bytecoin with a GPU but the coefficient of performance would be comparable to CPU-mining. Bytecoin is doing pretty well and there are other coins with CryptoNight algorithm; Fantomcoin, Quazarcoin or Monero.

Theoretically you could implement X11 and CryptoNight together in a cryptocoin but two years later you'll inevitably face the ASIC problem for your X11 PoW. So I don't really see any practical use of such a combination.


Merkle Root for 1-transaction block! I know that merkle hash for one transaction tx is:

sha256(sha256(tx))

In this block:
https://blockchain.info/block/000000000000000001291219dde8ed705903e8c101f416c68a439e5171ede5bc

there is only one transaction, but the merkle root equals to transaction hash!!!

So, how merkle root can be calculated???

The merkle root of a block is the hash of all of the transactions. If there is one transaction, then the hash of all of the transactions is the hash of that one transaction. So the merkle root and the txid of the only transaction in a one transaction block will be the same.


Where can i download latest stable bitcoin-core src files? i want to download latest stable bitcoin-core src files. and want to build it on my system from source.

here is latest src of bitcoin-core but its not stable for production ready environment.

https://github.com/bitcoin/bitcoin

https://bitcoin.org/en/download shows latest version as

Latest version: 0.14.2

Update 1 :

Looks like git checkout is what i am looking for.

git clone git@github.com:bitcoin/bitcoin.git
git checkout tag_name

the latest version must be v0.15.0.1 now. so the command is :
git checkout v0.15.0.1


Quarkcoin's bitcoin-qt fork won't recognise unspent transaction I've got a problem with my bitcoin wallet client, I got around 10 QRK by mining via a pool, transferred them to my local wallet and then sent them to btc-e, I got a dialogue box saying something about the TX being too large and if I wished to add a fee, I said yes, and after that, the TX was registered in my wallet, but now two days have passed and I don't have even a single confirmation, I've searched for the TX and my address in the QRK blockchain explorers and I couldn't find a single reference to my TX.

Any ideas on how to "purge" that fake TX and get my coins back (they are unspent, according to the network, there should be a way to do a "rollback")?

https://bitcointalk.org/index.php?topic=231309.0 worked for me, as it says:

Export your private key in base58 format (how to do this depends on the software used to make the unconfirmed transaction, but I'm sure it is straight-forward)
Create an empty wallet in bitcoin-qt (can be done with renaming your current wallet.dat to wallet.dat.bak and launching bitcoin-qt. Just be sure to keep wallet.dat.bak...)
Launch bitcoin-qt
Import the private key into bitcoin-qt (see this: https://en.bitcoin.it/wiki/How_to_import_private_keys_v7%2B)
Quit bitcoin-qt
Run
bitcoin-qt -rescan
Wait
Wait...
Now you have the full balance of the single key you imported (compare with blockexplorer. If not, stop here and post in this thread)
Create the transaction you wanted to do without forgetting the fee
Delete the new, nearly empty wallet.dat (just rename it if you're not sure about that part)
Rename wallet.dat.bak (thus your original wallet) to wallet.dat
Done


Can I build a raw segwit transaction with no segwit inputs? I am trying to build a segwit transaction between a regular p2pkh address and a p2sh 2-of-2 multi-signature address. I have successfully transacted back and forth between these two addresses before (Testnet), but now I want to implement a segwit transaction. However, when I try to broadcast the transaction, it says "unexpected witness payload for non-witness script..". I am seeing the default witness field as "b'\x00'".

Documenting myself more about the subject, I found that "If all txins in a transaction are not associated with any witness data, the transaction MUST be serialized in the original transaction format, without marker, flag, and witness".

Does this mean that in order for me to test my segwit code, I will have to wait till I get a segwit input somehow?

This is my transaction hex:

01000000000102575307b5cd2a1364c48501434790c0e83c22a16a4b5a902b62e46a34bca06a81000000006b483045022100e07aeaa18e08dedbeebfa7c7299dad2a5dd18df0b31af2f654f2a139d5c6f3900220286b641f4a444d23c952cded85939177abbc7510f909f156fadef5399e20dbe8012103e07f96e5ba598431c0c994493a4ae988c9854c171d5d4bb140db0a27a4c853e4fffffffff53d3533ab79d8425526a7378c91a718e8b526ca32e317b4193333949c261ec9000000006a4730440220780a21e18feeddecb6ca999370fe76a8b612dbaca18ea1249bc312da32f4534c02207342a4d9daea5bbc314e1965f952fbc7fcfcfa5b3b208efc9f2fe0f380afa39b012103e07f96e5ba598431c0c994493a4ae988c9854c171d5d4bb140db0a27a4c853e4ffffffff02102700000000000017a914c104b576f5436309587aefa3ddddd5c295b904808702db1d00000000001976a91452903efc1004de01883ba3687be2a8ea4f6b1b1988ac0100010000000000

Only segwit outputs can be spent using segwit inputs.

A segwit transaction is a transaction with at least one segwit input.

You'll first need to create a segwit output to test segwit spending.


Bitcoin mining process Can someone please explain these fuzzy understanding?
I am trying to implement my proper demo application of blockchain, but now I discover that many concepts are not that clear..

1- how do miners in a network learn that there is a new transction added in one block? is there some party responsible for notifications or something? after getting this information, must a miner re-copy the whole blockchain to his local computer?

2- As I understand, mining is done on blocks in bitcoin. So if someone add a transaction to a valid block, does this mean that the block has to be re-mined?

3- finally who decide to create a new block? is there some conditions on the size of the block or is it unconditional unlimited process?

1- how do miners in a network learn that there is a new transction added in one block?

When a node recognizes a new block, it sends it to all the other nodes directly connected to it. It is very important for miners to build on top of the newest blocks they possibly can and to get their own blocks to as many other miners as quickly as they can (or they lose money) so miners, at least, go to extraordinary lengths to make this fast and efficient.

For new transactions not yet in blocks, more or less the same thing happens. Nodes in the bitcoin network distribute the transactions.

  is there some party responsible for notifications or something?

Anyone who wants notifications is responsible for making sure that they get them. Since pretty much everyone in the network does, this is not difficult. Nodes just share new transactions and new blocks.

  after getting this information, must a miner re-copy the whole blockchain to his local computer?

No. They just need to adjust their current state slightly.

  2- As I understand, mining is done on blocks in bitcoin. So if someone add a transaction to a valid block, does this mean that the block has to be re-mined?

If you modify a block, it's a different block entirely and not the block that was mined. If you try to produce a block by any process other than mining, you will simply fail to produce a valid block.

  3- finally who decide to create a new block?

Pretty much every miner is trying as hard as they can to create a new valid block all the time because they want the block reward that they will get if they are successful.

  is there some conditions on the size of the block or is it unconditional unlimited process?

There is a block size limit. If a miner produces a block that others will not consider valid, his block will just be ignored by the network and he will lose money. So miners must create blocks that comply with all the rules that other node operators enforce.


What does "Unable to decode output address" mean? On BlockChain.info, I have noticed a few transactions which send money to "Unable to decode output address".

For example, here is one:
https://blockchain.info/tx/624928439d2f668bab9f4cc1d9c4d2bc62a9603d8109d73d4fff8cf3043b68bd

All of the ones that I have seen with this message have 0 Bitcoins associated with that transfer and then some other greater than zero amount of Bitcoins sent to a valid looking address.  These weird addresses also have their money marked as "unspent".  Do they ever get marked as "spent"?

What does this message mean and why are people sending Bitcoins this way?

If you look at the output script for that output, you can see it looks like this:

 RETURN PUSHDATA(32) [some garbage]

This script, beginning with OP_RETURN, is called a null-data output, and is used to store arbitrary data in the blockchain. These outputs can never be spent, there is no way to make the script ever evaluate to true. Because of this, they will always show up as unspent on blockchain, and can be pruned from full node UTXO sets.

In general it's required that these outputs are accompanied by at least one 'normal' output. Any bitcoins in an OP_RETURN output are destroyed forever because they cannot be redeemed, that is why they all have 0 value


NXT Private blockchain changing the block generation time By default the block time for nxt is 60 sec average this is question.

This parameter can be changed to a lower time 10 sec for e.g?

And if  yes what would be the possible impacts (negative and positives)

Thank you.

Yes, the block time can be changed, but not very easy. There are two ways to do it:

Change the timestamp resolution to be 1/6th of the second. The
drawback is that you will run out of int values 6 times sooner
(timestamp is 32-bit integer). And eventually it will be less
convenient to read timestamps.
Keep the timestamp resolution and
adjust the forging. In Nxt there is no constant for changing the
block time, so you'll have to change few other constants. A
BLOCK_TIME constant was added in Ardor, you can see how it is used
there. The drawbacks of having 10 sec blocktime with 1 sec
resolution is that the base target adjustment will work not so well,
so finally you may end up with average block time which is not
10 sec.

A negative effect in both cases is that there will be less time for nodes to communicate new blocks and consequently more spontaneous forks will appear.
And the number of blocks will grow 6 times faster.


Whose to stop the coinbase devs from just draining all accounts and running of with the money? I have been wondering, what would happen if the coinbase developers agree to drain all the funds of all their accounts and run off into hiding?
Its not like anybody will be able stop them or return the coins and their profits will be immense. So what incentive do they have to keep peoples funds safe?

The same kind of business trust and legal things that let an exchange or a bank running I suppose.

There have been exchanges doing what you said in the past, and they have gotten the same legal pursuit as any other business scamming his clients.

Here is some links: https://www.coindesk.com/six-arrested-over-cloned-crypto-exchange-that-stole-e24-million

https://medium.com/datadriveninvestor/investigating-the-40m-binance-hack-c5fba32900f1

Also, at least in the case of bitcoin and ethereum the two most valuable crypto at the moment, and so the more money they can hope to have with, every transaction is recorded on the blockchain so they gonna have a harder time to transform those crypto back to fiat.

You also have to notice that most of the veteran crypto user will advise new users to not let their coins sit on an exchange and instead to store them in an offline secure place, owning our money and replacing the bank being one of the idea behind cryptocurrency, the problem you are describing being one of the reason why.


Copay does not go past splash page ios I am running IOS 10.3 on an Iphone 6s and can't get past the copay splash screen no matter how long I wait.  Everything worked just fine until two software updates ago.

Anyone else seeing this?

Exactly the duplicate of copay does not work in iphone5 ios10

Don't worry, it has been reported: https://github.com/bitpay/copay/issues/8382

It's not only you, other people seem to have the same problem.

Just wait until they release a fix for it.

EDIT: It has been fixed. Please update the app!


Mining Pools Transactions Fee I am learning about mining pools and trying to understand their reward structure and transactions fees.

Looking at the two largest pools, Antpool & BTC.com, as far as I understand AntPool uses PPS and BTC.com FPPS.

The main difference i guess is that in FPPS also the transaction fees are incorporated in the reward structure.

First of all, what exactly is the transaction fee? The fee of finding a block? The fee of transferring the btc reward to another account?

and how can the transaction fee be incorporated in the reward structure as in FPPS?

What exactly is the transaction fee? The fee of finding a block? The fee of transferring the btc reward to another account?

Transaction fee is a method by which anyone who creates a transaction incentivizes the miners to include that transaction in the block that the miner will mine. Bitcoin blocks can have a maximum 4MB of block weight, which means there are only certain transactions that can be included in the block that is being mined. So you include a fee so that miner picks your transaction over others to include in the block. Transaction fees also serve another purpose of preventing DoS attacks. If there were no fees, people in order to spam the network would send between between addresses they control so as to deny the service to legitimate people. Transaction fees ensure that there is a cost associated for launching such attacks.

To be more thorough, you do not send a transaction fee to a particular address, but it is the difference between the input and output amounts. So consider a transaction that consumes 1BTC and sends 0.8BTC to one address and 0.15 BTC to another address, then the transaction fee is 0.05BTC. When the miner creates the coinbase transaction for the block he is mining, he will pay out the block reward (12.5 BTC currently) and sum of all the fees of the transactions that are included in the block to the pool participants.

As to your other question about how they pay transaction fees vs block reward, that is more of a service related question and is more suited to the customer relationship department of each pool.


Why does Bitcoin charge per transaction? The first time I heard about Bitcoin, someone told me that it's almost free to transfer bitcoins to other people. However, I found something called "cost per transaction." Why does the Bitcoin network charge per transaction? Who receives the transaction fee?

Because it is in fact "almost free". The transaction fee charged by the bitcoin protocol is so small that it basically doesn't matter when compared to standard banking fees.

This measure is in place for several reasons, including:

Promoting mining. Mining requires expensive hardware and miners
expect to receive some sort of compensation for contributing to the
network. This is necessary to keep the bitcoin network decentralized,
secure, reliable and fast. This is where this fee ends up: in the
hands of miners that confirm your transactions.
Avoiding spam. Anybody could decide to write a bot that sends very, very
small fractions on a very short delay in order to spam the network,
as a form of DoS. This fee makes these kinds of attacks very
expensive, because if you transfer, let's say 30 euros, the fee could
be 0.01 cents. But if you transfer 1 cent, the fee is still 0.01
cents, making the fee not a percentage but a fixed quantity which
gets more expensive as the amount to transfer decreases.

Watch this to learn more: https://www.youtube.com/watch?v=X_hz7TyQ_bs


Does using different addresses affect subsequent transaction size, given the same number of inputs? I'm quite confused about the input count that affect the transaction size, example:

x1 = my receive btc address

x2 = my another receive btc address

x3 = my another receive btc address

Scenario A

P1 send 1 btc to address x1

P2 send 1 btc to address x1

P3 send 1 btc to address x1

Scenario B

P1 send 1 btc to address x1

P2 send 1 btc to address x2

P3 send 1 btc to address x3

So my wallet will have total balance 3 btc.

My question is when I try to send 3 btc to P4 (Another user), scenario A will count as 3 inputs or scenario B will count as 3 inputs or both is same 3 inputs?

Transaction inputs need to reference the Unspent Transaction Output (UTXO) they are spending with the outpoint of that UTXO. The outpoint is the transaction id of the transaction that created the transaction output concatenated with a colon and the output position in that transaction: txid:vout.

Let's say you were sent 1 BTC by P1 to address x1 in transaction uiaex and it was the second output (vout = 1 because we start counting at 0), the corresponding outpoint would be uiaex:1.

The UTXO reference therefore is independent of the address that the funds were sent to previously.

The transaction size is therefore the same whether you received all outputs to the same address or different addresses. There are no savings in transaction size by receiving funds to the same address multiple times.