What is the private key format? I wasn't aware of a private key format, however numerous stackoverflow posts hint towards a formatting of some kind

Format of private key

Which private key format is this?

What encoding or format is the private key in Dumpprivkey?

And looking at iancoleman/bip39's website, indeed the private key changes as you change the coin, implying that there is at least a format that takes into account version bytes.

However, using hdkey in js I am unable to reproduce this format, or even the "32-byte big-endian secret parameter" Pieter Wuille describes in the last example.

var bip39 = require('bip39');
var hdkey = require('hdkey');

const mnemonic = 'thunder purchase pave tower lecture upgrade supreme half kid fitness tray shove'
const seed = bip39.mnemonicToSeed(mnemonic); //creates seed buffer
console.log('mnemonic: ' + mnemonic);

const root = hdkey.fromMasterSeed(seed);
const masterPrivateKey = root.privateKey.toString('hex');

const addrnode = root.derive("m/0'/0");
console.log('addrnodePublicKey: '+ addrnode._publicKey.toString('hex'))
console.log('addernodePrivateKey: ' + addrnode._privateKey.toString('hex'))

What is the detailed private key format? What does it consist of, how do you derive it from a standard private key? What is it used for compared to the unformatted private key?

The format you use depends on how you need to use the private key. Your code produces a raw hex private key, without formatting.

$ node index.js
mnemonic: thunder purchase pave tower lecture upgrade supreme half kid fitness tray shove
addrnodePublicKey: 02ceb48796223dc3777fe210a2034059b5e39b3743e59d62f75ef07a32f8440caf
addernodePrivateKey: 310fe2e677a3ad28acb91d2645bb33882f015ab11e59dce9d2a72905979e3cb6

Raw Private Key

A private key (in bitcoin, i.e. ECDSA SECP256K1) is a 32 byte number between 0x1 and 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4140.

For example:

0C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D

Wallet Input Format (WIF)

However, wallet software typically uses the Wallet Input Format (WIF) to make it easier to copy over. It uses base58check encoding so it avoids ambiguous characters (like 0 and O), it is shorter, and includes a checksum in case of typos. For example:

5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ

WIF Conversion

The process of converting a raw private key to WIF is outline here: https://en.bitcoin.it/wiki/Wallet_import_format:

Take a private key

0C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D
Add a 0x80 byte in front of it for mainnet addresses or 0xef for testnet addresses. Also add a 0x01 byte at the end if the private key will correspond to a compressed public key

800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D
Perform SHA-256 hash on the extended key

8147786C4D15106333BF278D71DADAF1079EF2D2440A4DDE37D747DED5403592
Perform SHA-256 hash on result of SHA-256 hash

507A5B8DFED0FC6FE8801743720CEDEC06AA5C6FCA72B07C49964492FB98A714
Take the first 4 bytes of the second SHA-256 hash, this is the checksum

507A5B8D
Add the 4 checksum bytes from point 5 at the end of the extended key from point 2

800C28FCA386C7A227600B2FE50B7CAE11EC86D3BF1FBE471BE89827E19D72AA1D507A5B8D
Convert the result from a byte string into a base58 string using Base58Check encoding. This is the Wallet Import Format

5HueCGU8rMjxEXxiPuD5BDku4MkFqeZyd4dZ1jvhTVqvbTLvyTJ

Potential node.js resources:

https://github.com/bitcoinjs/bs58check
https://www.npmjs.com/package/create-hash


Where is the nonce incremented in Bitcoin source code? Where is the nonce incremented in Bitcoin source code?
I found where the extra nonce is incremented, but not the regular nonce?

Line 132 in src/mining.cpp in the generateBlocks method.

while (nMaxTries > 0 && pblock->nNonce < nInnerLoopCount && !CheckProofOfWork(pblock->GetHash(), pblock->nBits, Params().GetConsensus())) {
    ++pblock->nNonce;
    --nMaxTries;
}

Update: Given @MeshCollider's answer I guess this is now only relevant on the regtest network.


What are the risks of exchanging Bitcoins via Near Field Communication? What are the risks of exchanging Bitcoins via Near Field Communication? The transaction Parameters might be negotiated via NFC and the actual transaction via Internet.

The risks could be, someone else with a good NFC communicator could intercept your request and make you send some BTC to them, having another persons phone next to yours with the app can do the same, and possibly NFC jammers can really cause a lot of problems with the transfer.


How to test bitcoin distribution mechanism Now I'm developing a bitcoin distribution mechanism (according to users' submitted shares count). The complete workflow is: Users submitted shares to my pool, then my pool submitted these shares to another famous pool (e.g. btcguild). When my pool received bitcoins from the remote pool, it will distribute these received coins to users (according to their submitted shares count)

The problem is that everytime I test this mechanism, I will create many transactions, but each transaction will take 0.005 btc as transaction fee for bitcoin network. Then after paying 200  users, I will pay 1 btc to bitcoin network, The cost is high. Is there any way to simulate the bitcoin network, so I can create transaction without paying transaction fee?

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

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


Confirm own incoming transactions Is it possible to only mine your own incoming transactions? So you can confirm a Bitcoin transaction (only locally).

This might only be an issue with the terminology, but when a transaction is "mined", it is included in a block. You could do that of course, if you were contributing blocks to the Bitcoin network, but the computing power of the network has grown to levels where it is infeasible to mine at home.

What you can do, is to verify the validity of an incoming transaction. Your Bitcoin wallet software does this automatically when it receives the transaction. It checks that the inputs are available for spending, and the signature matches the source of the funds. However, until a transaction is part of a block in the longest valid chain, it is unconfirmed and may yet be replaced by a competing transaction spending the same funds. Therefore, you cannot "confirm a transaction locally".


Where is bitcoin.conf and why doesn't bitcoind find existing datadir v0.17.1 Just built no gui, no wallet bitcoin on WSL Ubuntu Bionic, Bitcoin v0.17.1.

I want to experiment with bitcoin-cli.

I followed recommendation to run bitcoind -princonsole and it says:
Using config file

  /home/<myusername>/.bitcoin/bitcoin.conf

This file doesn't exist.

I followed some dense discussion on how should this behave to make dumb users happier on github, supposedly there were some merges, but frankly, I have no clue what was the final conclusion and what is or isn't in 0.17.1

Eventually, I understood that datadir must be specified first.

But that doesn't work for me.

~/bitcoin$ bitcoind -datadir /mnt/d/blockchain -txindex
Error: Specified data directory "" does not exist.

/mnt/d/blockchain definitely exists.

Thanks for any help.

 Many thanks to Nate Eldredge for pointing out a dumb error of mine and hope someone can help parsing and shedding some light on this:

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

Blockchain download has started and now I am waiting for the end result.

The syntax should be

bitcoind -datadir=/mnt/d/blockchain -txindex

Note the = sign.

This will look for the bitcoin.conf file at /mnt/d/blockchain/bitcoin.conf and will store the blockchain, databases, wallet files, etc, all in /mnt/d/blockchain.  With this option, Bitcoin Core shouldn't read or write anything in ~/.bitcoin at all.


How to make sure, Bitcoin private key and bitcoin address generator tools are generating valid key pair? I find lots of tools/scripts written in python which can generate random number then using this random number it generates Bitcoin Private key(WIF) -> Bitcoin Address pair.

I have tried verifying few pairs using www.bitaddress.org >> Wallet Details by entering WIF key and verifying with output address.

But How can one make sure, the tools/scripts will always generate valid address and key pair ?

or is this like this way

if it generates one valid address and key pair it means all the future address and key pairs will be valid ?

i was looking at this https://github.com/shirriff/bitcoin-code

from makeAddr.py

import random, keyUtils
private_key = ''.join(['%x' % random.randrange(16) for x in range(0, 64)])
print keyUtils.privateKeyToWif(private_key)
print keyUtils.keyToAddr(private_key)

i know random number/string generated using this method is not very much secure, but i am talking in terms of valid WIF and address pair.

you need to make sure that the private is lower than 1.158 * 10^77 (115792089237316195423570985008687907852837564279074904382605163141518161494337) and

In your case you could do

 import random, keyUtils
 private_key = ''.join(['%x' %random.randrange(16) for x in range(0, 64)])
 print keyUtils.privateKeyToWif(private_key)
 print keyUtils.keyToAddr(private_key)

 from ecdsa.curves import SECP256k1
 decoded_private_key = int(private_key,16)
 if decoded_private_key > 0 and  decoded_private_key < SECP256k1.generator.order():
     print 'valid'
 else:
     print 'invalid'


WalletAppKit creates an address every time Bitcoinj gets initialized I'm implementing an app using BitcoinJ, but every time I run the code, a new address is created. Is there any way to work with the very first address that was created and stop creating new addresses?

walletAppKit = new WalletAppKit(parameters, walletDir, "my_wallet") {
        @Override
        protected void onSetupCompleted() {

        if (wallet().getImportedKeys().size() < 1)
           wallet().importKey(new ECKey());
           walletAppKit.peerGroup().setBloomFilterFalsePositiveRate(0.00001);
           setupWalletListeners(wallet());

           for (Address address: wallet().getIssuedReceiveAddresses()){
                Log.d("myLogs", address.toBase58());
           }
        }
    };
walletAppKit.setBlockingStartup(false);
walletAppKit.setUserAgent("RocketWallet", "1.0");
walletAppKit.startAsync();

According to the documentation:

  getImportedKeys() returns a list of the non-deterministic keys that
  have been imported into the wallet, or the empty list if none.

Try to change:

if (wallet().getImportedKeys().size() < 1)
    wallet().importKey(new ECKey());

to:

if (wallet().getIssuedReceiveKeys().size() < 1)
    wallet().freshReceiveKey();

To get the first address in your wallet, you can use:

wallet.getIssuedReceiveKeys().get(0).toAddress(TestNet3Params.get()).toBase58().toString();


Is it possible for the network to stop finding valid blocks? The hashing problem is by design computationally hard, because SHA-256 hashes are for all intents and purposes random strings with no direct link to their inputs, and there's no (known) way to generate a block so that its hash computes to a given output (or, more exactly, satisfies the current difficult criteria). At any given difficulty level, there will only be a certain probability for miners to find a valid block.

Ok. But is there any proof that a valid block will actually exist at a given difficulty level? Is it possible that valid blocks just stop being found if difficulty increases too much? How could the network handle such a situation, if the difficulty level can only change every X blocks?

The simple answer: no.

The not to simple answer: extremely unlikely.

Miners hash an input block, in the hopes of getting a result that satisfies the difficulty requirement, i.e., has a certain number of zeroes in front. Now the possibilities for the miner to vary the input are quite large. There is the 4 byte nonce, there is the order transactions are put into the transaction (for simplicity let's just assume it allows all permutations of the merkle root, 2^256), there's the coinbase in the reward transaction (which also influences the merkle root), there's the timestamp (not that variable but let's say we can vary by two hours => 14 bit) and there's the transaction count (up to 4 byte, that are not independent from the merkle root, but let's assume they are indipendent). So in total we have something in the order of 2^256*2^32*2^32*2^14~=3.49E100 possible inputs to find a block and 2^256~=1.15E77 possible block hashes. (These are all back-of-the-envelope calculation, and probably wrong, but just to give an idea of the scale of this)

Hence we would find ~3.02E23 hash collisions for each hash, and would have to not find a single hash that matches the target. Notice that hash functions are built with the stated goal of making hash collisions really hard (researchers have used super computers for decades to find a single hash collision), and you'll see it is unlikely to ever occur in anyones lifetime.


Which is the reliability of a transaction timestamp? Just one question. Where and how is the TIMESTAMP of a transaction generated?

Is it reliable to develop a transactions notification system?

Thank you! (I mean the time node below)

  {
  "hash":"44ffca26a089ccc806a7861e715d237d9f63b373085492f2ee82901171e8d661",
  "ver":1, "vin_sz":1, "vout_sz":2, "size":257,
  "relayed_by":"127.0.0.1", "tx_index":31066681,"result":0,
  "time":1351624745,"block_height":205754, "inputs":[ { "prev_out":{
  "type":0, "addr":"1PAPY4UN1NtFwRibWRuFT1CkgK3NvnMpoC",
  "value":879000000, "tx_index":31055718, "n":1 } } ], "out":[ {
  "addr":"1ELop4RiQtsVnqPJZHqErCvmJZPHsVn2YT",   "value":5000000,
  "type":0 } ,{ "addr":"1PAPY4UN1NtFwRibWRuFT1CkgK3NvnMpoC",
  "value":874000000,  "type":0 } ] },

The timestamp is not a part of the standard transaction as per Bitcoin Protocol Specification. It is most likely generated by the standard client during the api call. The standard client might use its internal time (that might differ from the machine time), which is vulnerable to timejacking. I might be wrong, however.

As long as your client is running properly, it should be okay to use its timestamps for various notifications. They might represent the time the client received the transaction however, which may differ from the time the transaction was broadcast the first time.


Where can I find a graph of the current size of mining pools? Where can I find a graph of the estimated size of each mining pool relative to the overall hashrate of the entire bitcoin network?

The http://bitcoinwatch.com/ site gives a pie-chart of the hasrate distribution by mining pool.


How many Dogecoin-satoshis will ever exist? In Bitcoin, there will only ever be ~21,000,000 coins (slightly less, technically, but I'll just use 21 million for easy calculation). Each bitcoin is 10^8 satoshis. This means there be a maximum:

2,100,000,000,000,000 satoshis

What is the equivalent number for Dogecoin?
Is it larger than the maximum 64 bit unsigned integer?

Dogecoin has no maximum, because it mints 10k dogecoins per block, forever.

But to answer the spirit of your question, there are 100 million indivisible parts to a dogecoin. You can see that here.

static const int64_t COIN = 100000000;

There are currently 97 billion dogecoins. This is a bit more than 2^63 satoshis.

  Is it larger than the maximum 64 bit unsigned integer?

No, but it wouldn't matter if it was. There isn't a limit of 2^64 satoshis on the total money in Bitcoin (or altcoins). However, there is a limit of 2^64 satoshis per output.


Is it possible to have a failed Bitcoin transaction on the block chain? In Ethereum, a transaction may get out of gas but still being included in a block with a receipt status of failed. In Bitcion, will similar things happen?

No. Invalid transactions do not get included in blocks in Bitcoin.

There is also no receipt concept in Bitcoin. All nodes run full verification and check transactions against their own UTXO set when importing a block. Therefore any invalid transaction will also cause a block to be invalid as well.


Has anyone ported the Bitcoin software to plain C or Objective C? I'm not a big proponent of either C++ or Boost. Has there been any attempt to rewrite Bitcoin in plain ANSI C, or maybe Objective C? Thanks.

There is a pure C99 bitcoin implementation called cbitcoin by MatthewLM, forum threads:

cbitcoin - Bitcoin implementation in C. Currently in development.
[ANN] cbitcoin 1.0 Alpha 3 Released.

but it is currently in alpha stage. One of its features is weak library dependency, e.g. it possible to implement cryptography using something other than OpenSSL. As far as I know there is no Objective C Bitcoin implementation.


Information about price fluctuations I have a block chain wallet, I know that the balance will fluctuate. But I am having trouble finding on block chain is some sort of charting, or some sort of chronological logging of those fluctuations like a stock summary. Where should I look and see this?: "OK, on aug 31st it was this amount then on 2nd of september it was this amount" I have seen both sides of the fluctuation coin, I have seen my balance exceed what i put in and of course drop below what i put in, but I have no way of tracking an exact amount like a stock summary does for you giving you 1 day, 5 day, 30 day and on and on going out as far a 5 years. Does anyone know block chain wallet well enough to give me some guidance on this question?

Use a historical price chart like https://www.coindesk.com/price/


Ubuntu Server vs Desktop for mining PC Could anyone tell if Ubuntu Server has any advantages over Ubuntu Desktop for mining?

Basically, here is explained that there should be no big difference since that the Server and Desktop are different by initial packages installed.

I am wondering:

if energy can be saved as you are not using graphical environment
if GPU would have better performance in case it mining PC is manage
by SSH connection against a monitor is connected to it when using
Ubuntu Desktop
if the mining PC will work better - I noticed that some icons (like updates) are not responsive on my Ubuntu Desktop after 24 hours mining a

Any others pros and cons about using server versions against desktop version that anyone can share will be helpful.

I would highly recommend using Ubuntu Server for this, as long as you know what you are doing without a GUI. Not having a GUI at all means smaller OS size and much less OS tasks. This translates into more power savings. If you are using graphics cards, a non-GUI OS will improve your mining performance. If using an ASIC/etc. you probably will not see performance improvements, but you should definitely see power consumption improvements.


Backing up bitcoins on Mt.Gox I have some bitcoins on Mt.Gox. Against the possibility that a nuclear holocaust or some sort of hanky-panky or the like were to wipe out Mt.Gox tomorrow morning, how should I back those up?

Mt. Gox operates a hosted (shared) EWallet.   They claim to have cold storage and perform other backup practices, but there is nothing that you as a Mt. Gox accountholder can do to "back up" those funds.  And if there is a problem restricting you from accessing your Mt. Gox account, there is nothing you can do to recover those funds.

If you have your own wallet, perhaps running the Bitcoin.org client, you then do have the ability (and responsibility) to back it up.


Can I have the same wallet opened in multiple computers? I wanna put my wallet.dat to another node, and keep them online at the same time, Can I do like that?  and is there any problem?

BTW, how can I  do load balance with bitcoin node?  Thx

Provided that your wallet is an HD wallet (Bitcoin Core will show you a small HD  in the bottom toolbar if it is), then you can safely use it on both machines, as addresses are deterministically generated.

If your wallet is individual key based, then after you copy the wallet to the second machine, they will diverge and generate different keys for future addresses.


These testnet outputs are not making sense to me Today I took some time to mess around with the bit Python library, which I find pretty easy to use. I have been wanting to do some Bitcoin programming for a while, so I decided to create a simple web wallet to test creating and broadcasting transactions. I'm obviously using testnet for this.

I initially used a testnet faucet to send two transactions to a main address, 0.0005 and 0.0001 tBTC to get started. I used my code to check for this address' balance and got 0.0006, cool. I then proceeded to used my newly developed web wallet to send two transactions to another address, both with a value of 0.00001 tBTC. I immediately noticed the balance from my main address was off, showing me 0.000028 tBTC which to me makes no sense, it should have been something close to 0.00058. I used blockcypher to check on those transactions (which are unconfirmed, but I believe this is irrelevant) to make sure my code was ok. Sure enough, 0.00001 tBTC was sent twice to the correct address, but the change sent back to the sender address is way off. What exactly happened here?

I include the transactions here and here.

Thanks in advance!


Raw data of dates in all blocks using PHP or R Is it possible to obtain the date (time stamp) of each bitcoin block so far, using languages like PHP or R?.

I am developing an analysis of the time series of bitcoin use for a scientific project, and while many sources provide averages, few provide the raw data.

In I related post (Raw data of transactions in all blocks), a person (amaclin) kindly provided the number of transactions in all existing blocks, could it be possible to obtain the date?.

Is this something that can be done in R or PHP?

I've written this simple PHP code with an explanation for each comma

PHP code

<?php

$lastBlockEnd = $this->MyRPC->BitcoinCoreCommand('getblockcount' , []);
// https://bitcoin.org/en/developer-reference#getblockcount

for ($i = 0; $i <= $lastBlockEnd; $i++){
    $blockHash = $this->MyRPC->BitcoinCoreCommand('getblockhash' , [$i]);
    //https://bitcoin.org/en/developer-reference#getblockhash
    $blockData = $this->MyRPC->BitcoinCoreCommand('getdata' , [$blockHash]);
    //https://bitcoin.org/en/developer-reference#getblock
    $block[$i]['time'] = $blockData['time'];
    $block[$i]['hash'] = $blockHash;
}

print_r($block);

Code Explanation

We are getting total available blocks number, say its 65443
we will start looping from block number 0 to 65443

  Note: You should send "batch request" instead of calling each block separately
  - we are getting block hash, then we're calling getdata and passing that block hash.

Now we've got the following response:

{
    "hash": "00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
    "confirmations": 447014,
    "strippedsize": 215,
    "size": 215,
    "weight": 860,
    "height": 1,
    "version": 1,
    "versionHex": "00000001",
    "merkleroot": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
    "tx": [
        "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098"
    ],
    "time": 1231469665,
    "mediantime": 1231469665,
    "nonce": 2573394689,
    "bits": "1d00ffff",
    "difficulty": 1,
    "chainwork": "0000000000000000000000000000000000000000000000000000000200020002",
    "previousblockhash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
    "nextblockhash": "000000006a625f06636b8bb6ac7b960a8d03705d1ace08b1a19da3fdcc99ddbd"
}

Finally, We are storing time and block hash in an array and printing it.


Who witnesses a Segregated Witness transaction and what incentive do they have to witness the extended block containing signatures? This video claims Segregated Witness is insecure because no one has an incentive to process (witness) the extended signature block.

https://www.youtube.com/watch?v=VoFb3mcxluY

It claims that as the hashing power increases over 50%, you would be a fool (not a Nash equilibrium) to waste processing power on extended blocks containing the signatures, when the real money is in the transactions containing fees. This means anyone can feed a block with any transaction they want, since no one is checking signatures. (Paraphrased.)

From what I understand, Segregated Witness transaction addresses start with a 3 and are multi-signature addresses. So you have to sign, and someone (who?) also has to sign for the transaction to go through. All of these signatures are placed into an extended block.

Is the extended block also placed on the main blockchain?
Who processes the extended block containing signatures?
What incentive do they have to process the extended signature block?
Does the extended block have fees?
Who is the 3rd party signer for segregated witnesses multi-sig addresses?

Since exchanges and merchants won't accept the blocks, miners who mine invalid blocks won't get paid. A miner could take that risk if they wanted to, but it's no risk to the system as a whole. Only the longest chain that consists only of valid blocks is honored by non-miners.

I could imagine a miner trying to mine on top of a new block without first checking the extended block. But they'd almost certainly start checking the extended block and switch if it turned out to be invalid. This takes an acceptable risk of mining an invalid block while ensuring that nobody has any incentive to deliberately mine invalid blocks.


Why don't nodes resume all existing outbound connections at restart? The Erebus attack can, according to the authors, be accelerated by causing the victim node to reboot* at opportune moments. This is because the node will pick new outbound peers from a list that's been compromised by the attack.

What's the reason nodes don't frequently store their current outbound peers to disk and reconnect at restart?

* by causing it to crash, which nodes are hardened against as much as possible

First, let me clarify that the Erebus attack does not require rebooting the victim. It is only for speeding up the attack process. The attacker can patiently wait for the existing legitimate connections to expire and occupy them.

Coming back to your question, I guess you suggested to prioritize reconnecting the current outbound peers among all tried IPs.
It actually doesn't help much because: 1) the victim may reconnect to shadow IPs controlled by the attacker and 2) again, the attacker can wait for legitimate connections to expire.

The bottom line here is that, because Bitcoin is permissionless, you may not be able to know which are good peers and bad peers to reconnect to. If a node strongly trusts some peers, it can simply whitelist them. But overall whitelisting is bad for decentralization.


Could bitcoin/blockchain be used to create a secure non-3rd party escrow? I'm wondering if there could be a block chain approach to selling goods and putting money in an escrow-like state until the goods are received.

I'm envisioning the following scenario.

1) Buyer puts money into escrow with seller and adds it to the block chain. In this state the buyer can no longer spend the money, but neither can the Seller.

2) Once seller sees the money in escrow on the blockchain associated with their account, they release the goods to the buyer.

3) Once the buyer receives goods they approve the escrow.

4) The seller takes ownership of the funds.

I think this helps to protect buyers who get ripped off by sellers promising goods, accepting funds then never handing over the goods.

Obviously in this situation a buyer could decide not to approve the escrow, but they would have no reason to do that because the money is not spendable by them anyway.

So my question is, is there something like this or could something like this be created?

I would think it has been asked several times, but not in this detail. The way to use escrow would be a „2 of 3 multisig“ transaction. A search in the forum reveals a lot of links. Also very useful is the wiki and of course the bitcoin.org webpage. There are even wallets providing multisig functions. But still it is not „an easy usecase“. Data has to be exchanged between the parties, and as far as I know, there is no protocol specified. So it is still possible to make errors and loose funds :-(

Oh, and then there is Andreas‘ book „Mastering Bitcoin“, which explains even more escrow (3 of 5 combination). Worthwhile to read, and also online available.


Is the fee added to the cost of the transaction or subtracted from the received money? I want to send exactly 0.00136889 bitcoin but I never sent bitcoins before, I only received.

If I send 0.0136889 to the address, will blockchain.info remove the fee from my wallet or do I need to send 0.0136889 + the fee?

The fee is paid by the sender. The sender technically specifies how much money goes into the transaction from where and how much goes out of it to where. The total output value – of course – can at most be as big as the total input value, otherwise the transaction is invalid.

When you send money using a wallet software, you specify how much money you want to send. That is, you specify how much money you want to arrive at the recipient. The wallet will then add the fee to it. Your balance will go down by the money you sent plus the fee you chose.


How to make totally secure Bitcoin transactions? So, I'm wondering if my system of protecting my bitcoin is totally secure.

If I have an old laptop, and I boot into tails linux from a flash drive, and download electrum on there, and only ever connect to the internet at my home WiFi, and only ever visit Coinbase (GDAX) and Gmail, are their opportunities to steal my bitcoin?

Is there hardware risk? Would I need to wipe the drive completely, or can I purchase a hardware wallet that transacts without connecting to a laptop?

Is there WiFi risk, or are Electrum, Coinbase, and Gmail all encrypted connections so it wouldn't even matter if there were a man in the middle? (am I confusing things here?)

Is there risk with Electrum? Should I download the core Bitcoin client instead?

Obviously no cameras or microphones in the room when you use the dedicated laptop, right?

The primary concern with Bitcoin security is where your private keys are stored.

In your scenario the private keys are stored on a Linux laptop which is not unreasonable if you follow good internet hygiene and security practices.

The next best approach is to purchase a hardware wallet from the likes of Trezor or Ledger. These wallets have High Security Module (HSM) chips inside them that are highly resistant to being compromised. By highly resistant it means the private keys are stored on a tamper-proof chip and NEVER leave it. The HSM chip in the Ledger Blue is ST31. Google for ways to compromise the ST31 versus ways to compromise Linux and you'll get the idea.

With a hardware wallet it works in conjunction with a client on your PC but the crucial factor is the transaction (tx) is signed in the HSM chip and the only thing an attacker could do is try and replace the Bitcoin address in your tx. Most hardware wallets safeguard against this by displaying the recipient address on the screen when requesting verification of the signature operation.

And finally you could write your private key down on a piece of paper and hand-sign all your Bitcoin tx's. No electronic compromises to worry about.


How can I see what is bitcoin tx for pending Lighting channel (lnd) When I open a new Lightning channel from lncli I get the blockchain tx hash back.
But afterwards how can I find this hash later on, if the channel is still pending state?

lncli pendingchannels does not show any tx data and lncli listchaintxns does not show unconfirmed bitcoin tx.

thanks

The output of lncli pendingchannels gives you as much as you need:

"pending_open_channels": [
{
        "channel": {
            "remote_node_pub": <pubkey>,
            "channel_point": <txid:output_index>,
            "capacity": ,
            "local_balance": ,
            "remote_balance":
        },
        "confirmation_height": ,
        "commit_fee": ,
        "commit_weight": ,
        "fee_per_kw":
}]

The channel_point will give you the txid, that you can later lookup at a bitcoin testnet explorer, or directly with btcctl --testnet gettransaction txid


Sendtoaddress using custom private key Let's say the user sends me his private key. What is the appropriate RPC command to spend the Bitcoins of this user using his private key?

Should I import his private key in the wallet before?

If you're using Bitcoin Core, you must first import the private key using the importprivkey console command.  The coins held by that private key will then be added to your existing balance (if any).

If you want to spend those specific coins rather than some others in your wallet, you can use the "coin control" feature.  This can be enabled in Settings:Options:Display; when you send coins, you will be offered a list to select which addresses/transactions you want to spend from.


How do Lightning Explorers like 1ML register closed channels? I want to do analytics on unilaterally and mutually closed channels. To do so I need to scan know when channels close. It seems to me there's no other way than to actively scan the network graph for closed channels.

But I'm not sure if that's the right approach. How do explorers like 1ML do this?

Every Chanel that us public is announced on the gossip protocol and in the channel announcement message linked to a funding transaction. What you can do (and what 1ml most likely does) is to save spent funding TX as close channels. As the gossip protocol will only forward channel announcement messages for open channels (those where the funding TX was not spent) it will be impossible to query your lightning node for closed channels from the past. You will only be able to collect this data for the future. Or you could crawl 1ml if their robots.txt allows this.


why bitcoin escrow don't use fiat currency? Cryptocurrency escrow,  like localbitcoins.com, use bitcoins as guaranty funds.
Seller transfer bitcoins to merchant as guaranty, later when buyer has paid with fiat money to seller, merchant make the transfer of bitcoins to buyer wallet.
why bitcoin escrow use bitcoins guarantee and  don't use fiat currency?

Because it is much harder to do escrow with fiat.

Fiat currencies are subject to various regulations which make this difficult. The escrow service would have to be registered as a money transferring business and be required to follow AML/KYC regulations. This means that all users would have to submit personally identifying documentation to the service in order to do any trades.

Additionally, there are multiple ways that fiat can be transferred. If you look on LocalBitcoins' website, you will see that you can do a variety of things for transferring the fiat; you can send cash by mail, cash in person, you can do bank account transfers, you can purchase goods for the seller, etc. There are a lot of different ways to send the fiat to the other person. If they put the fiat in escrow, then they would be limiting the number of ways that the fiat could be transferred. Conversely, there is only one way to transfer Bitcoin.

Furthermore, doing a fiat escrow would mean that the service is subject to whoever they are using as their bank. The service itself cannot actually hold the fiat money when it comes to things like bank and wire transfers (or it's really difficult). Rather they have to have an account with a bank and the money would go into that bank account and leave from that bank account. This introduces another third party who is not necessarily trusted. That bank could shut down the service's bank account thus causing all users whose funds are in escrow to lose all of their funds. It would, in general, introduce more risk to trading.

Lastly, the idea of services like LocalBitcoins is centered around the idea of trading Bitcoin for physical cash, typically in person. This means that it is extremely difficult to provide escrow services because someone from LocalBitcoins would have to be physically present for each trade to hold the fiat while the Bitcoin transfers. That would simply be unfeasible and impractical to do. However, because Bitcoin is a digital asset, the Bitcoin can easily be held in escrow on their servers and the trade can go along as long as both parties have internet access. This is much easier and cheaper to do.

Thus Bitcoin is easier to do escrow with than fiat, so such services escrow the Bitcoin rather than the fiat.


Reason behind hashing the nonce in prevBlockHash? I understand the role that the nonce plays in the block header for calculating a hash for a valid proof of work.

But what I ask is: Do we consider the nonce in the prevBlockHash calculation of the previous block because, well, it's in the block header already (for the proof-of-work calculation), and it would be silly to write a calcPrevBlockHash function that calculates the previous block's header by ignoring the nonce?

Or is there a specific security property or assurance that we get when including the nonce in the prevBlockHash calculation of the subsequent block?

For instance, you could argue that we hash the timestamp because we want to capture the time that the block was generated. See answer here: Why the timestamp component of the block header? I guess you can argue the same for the nonce field.

But I claim that we could still have the nonce in the block header, and not hash it during the prevBlockHash calculation of the subsequent block, and things would still work. You would still be (a) able to validate this block, and (b) unable to mess around with the transactions in the block, because that would modify the hashMerkeRoot field, and thus render the block invalid.

Yes, you're correct. Without the nonce, we could still generate valid blocks.
However, to get a different hash we need to change the input for the hash. The input for the hash is the block header.

If there were no nonce, we would have to change something else about the block header for each try. That would only leave the timestamp or the Merkle root.  Other header items are fixed.
The timestamp is icky, because we would like it to show the actual time. So, we'd have to change the Merkle root.

The Merkle root calculated by hashing all transactions in the Merkle tree where they are listed. If we change e.g. the Coinbase or the order of the transactions in the tree, we could also gain another different combination to try. But to do so, we'd have to recalculate the Merkle root.

Rather, we put a nonce in the header directly that allows us to use the same block candidate for a number of different hashing attempts.

Hence, the nonce is used to introduce randomness into the blockheader. That's why it

a) has to be changed, and
 b) has to be in the blockheader. ;)


What is the longnest blockchain fork that has been orphaned to date? On this thread, the user asked what is the longest unintentional fork that Bitcoin had suffered. From the answers present, Bitcoin never had a >4 block fork until 2012.

It has been 6 years though, and I wonder if there is a more up-to-date statistics on that question, and if any study has been done so far.

11/12 March 2013 Chain Fork at block height 225,430.It's 31 blocks long.


How is Bitcoin/Blockchain programmed to do multi transaction at the same time? I read this article blockchaing stored and now I am bit confused. In this article it is described, that the transaction needs 15 seconds to propagate to the whole blockchain network. I know that the new transaction block contains the hash of the previous block. So my question is, if anyone in this 15 seconds create another transaction, how the systems doesn't crash?

To make my question a little bit more clear, I make one example. Let's say the hash of the previous block was "11b83f1dbb421b7539f755". If I make a transaction (Transaction A) for about 1 BTC and 1 second after me someone other makes new a transaction (Transaction B), which transaction becomes the previous hash "11b83f1dbb421b7539f755", because it needs 15 seconds till every node knows the new chain? So after one second not every node, knows about the Transaction A.

Thank you very much in advance!

PS: English is not my mother language :)

Let's say the hash of the previous block was "11b83f1dbb421b7539f755". If I make a transaction (Transaction A) for about 1 BTC and 1 second after me someone other makes new a transaction (Transaction B), which transaction becomes the previous hash "11b83f1dbb421b7539f755", because it needs 15 seconds till every node knows the new chain?

Not quite.

When you submit a transaction to the network, the network's nodes will check to see if it is valid. If it is, then the nodes will each store the transaction in their local 'mempool' of unconfirmed transactions. Note that a transaction does not reference a previous block, but it will reference some valid unspent transaction outputs (UTXOs) to consume as inputs (which means, it will specify which coins it is spending). It is possible for different nodes to have different mempools, and a node can even elect to not keep a mempool at all.

Miners will select transactions from their local mempool, and attempt to mine blocks which include those transactions. Once a miner finds a valid block with a certain transaction included in it, that transaction is said to be 'confirmed'. Note that a valid block must reference the previous block's hash.

If two transactions consume the same UTXOs, then only one of them can possible be validly included in the blockchain record.

Likewise, if two blocks reference the same previous block hash, then only one of them will eventually become a part of the blockchain record (whichever one is extended first).


How does a time warp attack work? I more or less understand how an attacker (with less than 50%+1 of the hashing power) can artificially lower the block difficulty by messing with timestamps. I also understand how such an attacker could, on his own chain, at one point "ramp up" the difficulty of his last blocks to match the current chain's difficulty (I've read the other questions containing the time-warp-attack tag). What I don't understand is how at one point his chain, with less total chainwork, can be accepted by the network.

Say we're at block 100 on the honest chain and an attacker crafted a fake chain starting from block 50. He's now at block 105 and his block 105 has the same difficulty (that he ramped up) as the honest's chain 's block 100. He decides to broadcast his chain and he "wins" because he succeeded with his time warp attack (the question here is not about the feasability, budget-wise, of pulling such an attack today on the Bitcoin network: it's about the technical aspect of the attack).

What I don't get is that the honest chain has more total chainwork from block 50 to 100 than the total chainwork on the attacker's chain from block 50 to 105. The attacker, in the case of a time warp attack, has less than 50%+1 of the hashrate. So it's impossible for him to come up with x blocks that have more total PoW than the y blocks that the honest majority have mined meanwhile (even if he has more blocks, without 50%+1 he simply cannot have more chainwork than the honest majority).

So how comes that this re-org is accepted by the clients? When there's a re-org of the chain of several blocks, ain't the total chainwork of both chains compared?

When there's a re-org of the chain of several blocks, isn't the total chainwork of both chains compared?

Yes, that's true. In fact, that's how a reorg of any size is considered. However, that wasn't always the case. In the first version of Bitcoin, the client compared purely by chain height. In version 0.3.3 (released July 2010) we switched to comparing by chain work. Today, you can't pull off a timewarp attack without a majority of hashpower.

However, let's say that you did have a majority of hashpower. What could you do with a time warp attack? You could mint an arbitrary number of blocks, and get more mining reward than you're entitled to. You could prevent the timestamp from advancing.


base58 cannot get 34 chars results (as Bitcoin address does) but 68 chars I am trying to convert public key hex to Bitcoin address.

From this website http://gobittest.appspot.com/Address, I can do some test.

For example, I have this public key:

04b4d653fcbb4b96000c99343f23b08a44fa306031e0587f9e657ab4a2541129368d7d9bb05cd8afbdf7705a6540d98028236965553f91bf1c5b4f70073f55b55d

According to the website, the address should be:

1DU8Hi1sbHTpEP9vViBEkEw6noeUrgKkJH

which is the base58 encode of 0088C2D2FA846282C870A76CADECBE45C4ACD72BB655DA1216.

However, if I do Base58 encoding directly on 0088C2D2FA846282C870A76CADECBE45C4ACD72BB655DA1216 on this website https://www.browserling.com/tools/base58-encode, I will get:

bSLwwticQjhNvEtqTMZXbn3dLmFrPvNrDGE4hmHsfADpHWb3b2ruh3XqtNzv8ESS8V6V

which is totally different from the 34-char Bitcoin address.

Anyone knows why?

When you use that site, you are encoding the hex as a hex string, not of the actual bytes that they should be. The base58 encoding for addresses operates on the bytes themselves which are represented in the hex string. However that website is just encoding the hex string (which, as bytes, is double the length and is entirely other data).


Blockchain.info Receive Payments API problem I am building a little online app to accept bitcoin payments in my website. I have a blockchain.info wallet and I am following their Receive Payments Api, which can be visited here: http://blockchain.info/api/api_receive

The monetary part works great, but the HTTP Callback Notification does not take place and my online store is not notified of the payment. However, the TEST callback does work.

I think it is a problem on his application.

Has anyone implemented the "Receive Money API" successfully?
Is there any other alternative for received instant payment notifications?
(To several different addresses)

A friend of mine reports the same issue. We need a little help :)

Thanks!

It is working now! Issue closed. Great service provided by BlockChain.


How did mining occur before OpenCL? According to the Bitcoin history, the OpenCL miner was released publicly in October 2010. How was mining done before that? There were about 4 million coins mined until then, so there must have been some mining software out there. Any ideas on what was it and how did mining work in those early days?

Before GPU mining all mining was done on the CPU.


Can't post on bitcointalk.org I've done some research and understand that I'm supposed to post in a newbie forum and wait a while, as a newly registered user.

But I can't seem to find the newbie forum.  Does anyone know which top-level forum it lives under?

In fact, no matter where I am, there's always a big banner on my screen saying I can't post.  When I click "How to Enable Posting," it says there's an error: bitcoind is offline.

I tried to find a way to contact some staff member.  No luck.  In fact, my private messaging section says I'm not allowed to send messages.

Any idea would be appreciated.

It's likely that your account has "units of evil" which require you to pay money to remove them. Bitcoin, the program used to accept these payments, is down. See also https://bitcointalk.org/index.php?topic=953005.msg10434122#msg10434122

You also have restrictions on your account due to being a new user. See Why can't I participate on bitcointalk.org?


I am reinstall my btc but balance and address not oldone? hello sir I have getting some problem to my bitcoin client.

I am backup of my old wallet.dat and again install the btc client but this new client my old address is not showing and also my balance of old wallet $3.99 is where gone........

pls. check my balance and help me for solving this problem

http://blockexplorer.com/address/149ZUavxLWurrVkeXBJsh7X7gELB7i9PuP

Pls. help me sir what can i do

thanks

With the Bitcoin.org client, the balance is calculated based on data in the blockchain data files.  If those files haven't finished updating, the calculation will not be current.

The way to check on this depends on which version of the Bitcoin.org client you are using.  The most recent versions (v0.6.x) will show the status at the bottom.  If is says "Synchronizing with network ..." then your balance may not show correctly until it has completed successfully.  When it is completed then a green check-mark will show in the bottom right-hand corner of the client.


How to find bitcoin balance via command line I'm wondering how to find the balance a wallet for a full node on a command-line only linux box.  bitcoin-cli doesn't seem to help here, and I'm not sure what else to try.

There is a simple RPC call getbalance. So bitcoin-cli getbalance should give you the number.


Cryptocurrency wallet passphrase 10 word? I have a pass phrase with 10 words but can't remember what wallet I used, an every one I have tried is 12. Does anyone know ?

It is possible to have a nine word mnemonic + 1 passphrase word, although it is unusual - you'd probably remember if you specifically chose that combination.

Electrum in BIP39 mode should be able to work with it.

It could also be some random wallet's passphrase system which does not conform to BIP39, in which case electrum will give you a checksum error when you try. If this is the case, you're out of luck unless you can locate the original wallet software.


Is there a way to generate new addresses for someone else's wallet? I thought I saw this feature existed somewhere but I can't find the reference.

Use Case: Alice needs to keep sending multiple bitcoin transactions to Bob, and wants to use a different payment address each time, but neither Alice nor Bob wants to trouble Bob with having to send over a new address for Alice to use. Neither Alice nor Bob want Alice to have Bob's private key.

Any service that sends bitcoins in multiple transactions to a client could make use of this feature. Current services that I've seen, like mining, just reuse the same address over and over, which is not recommended.

What is this feature called?

What bitcoin api (if any) facilitates it, or how would I get started using this api feature?

EDIT

With help from the answer, I was able to do this by adding bitwasp/bitcoin to my php project and this code:

//bitwasp/bitcoin library
require_once(__DIR__.'\..\../vendor/autoload.php');
//use BitWasp\Bitcoin\Bitcoin;
use BitWasp\Bitcoin\Key\Deterministic\HierarchicalKeyFactory;
use BitWasp\Bitcoin\Key\Deterministic\HierarchicalKeySequence;
use BitWasp\Bitcoin\Key\Deterministic\MultisigHD;
use BitWasp\Bitcoin\Network\NetworkFactory;
use BitWasp\Bitcoin\Address\PayToPubKeyHashAddress;

//$xpub = 'xpub661MyMwAqRbcGYcu6n1FmV1TbE8EwnSKecRZLvKAMyj4qLf15qXsoNryiKNvCkRq3z5kBCeZG8115jj28eVqmeKBJZPqjAfwRD3TGx1w5hY';
//$xpub = 'xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz';
//$path = '0/0'; // 1st receiving address
// $path = '0/2'; // 3rd receiving address
// $path = '1/0'; // 1st change address
// $path = '1/1'; // 2nd change address
public static function NewReceivingAddress($xpub, $index, $change = false){
    $key = HierarchicalKeyFactory::fromExtended($xpub, NetworkFactory::bitcoin());
    $path = ($change ? '1' : '0').'/'.$index;
    $child_key = $key->derivePath($path);
    return new Result('data',(new PayToPubKeyHashAddress($child_key->getPublicKey()->getPubKeyHash()))->getAddress());
}

Bob can provide Alice with an extended public key (xpub). This will allow Alice to generate as many addresses as required, all of which will be accessible to Bob via the corresponding extended private key (xpriv), which only he has access to.

There are many tools and libraries around that support address derivation from xpubs, such as BitcoinJS-lib.

As far as I know, blockchain.info is the only explorer with xpub support, and that also only applies to p2pkh addresses. Here's an example: https://blockchain.info/xpub/xpub6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz


Does Taproot allow CoinJoin-style transactions without revealing all signers? Taproot allows to hide a script behind a transaction and only release the relevant information when the output is being spent. Would this allow for a construction of a script with N participants + initiator to generate a script where all N participants have to sign it and the initiator finally signs? Would the MAST reveal all other signers or just the initiator who finally signs the script and can proof that he followed its rules?

As per my understanding what you are proposing can be achieved with Schnorr signatures, which will be implemented with Taproot. Since Schnorr signatures permit key aggregation, you can construct a single public key (threshold public key) from multiple participant public keys, which in your case is N + initiator. When spending you can just combine the signature from all the parties together (threshold signature) and spend it. The threshold public key and threshold signature are indistinguishable from their single-party equivalents. So for an outsider, it might be as though a single person signed it.

MAST is used to reveal only one spending condition while hiding others. For example, say you have a transactio which states that for first 100 days, you require N and initiator. From 100 to 200 days you require M of N and the initiator and after 200 days you only need the initiator. Currently when spending such transaction you need to reveal the entire spending script. With MAST you can consider each spending condition as a branch of the Merkle tree. When spending that output you just need to reveal the branch that you are spending thus allowing you to conceal the other branches from the public.


Why on bitcoin client sender address is 'undefined' Despite the fact that bockexplorer allows to navigate through transaction details and discover the sender address,
why via bitcoin client the sender address remains 'undefined'.

Is it possible to discover sender address via original Bitcoin API?


Tether decouples demand from price? So I don't understand how Tether (USDT) works. I hear two contradicting things about it. First, is that it is pegged to the dollar, plus or minus a few cents here and there. Second, that you can buy or sell freely from some other cryptos.

BUT, usually when lots of people are buying a crypto, it's price will go up. But tether seems to somehow decouple demand from price. I thought that was impossible?

the company behind usdt (tether) can create and sell new usdt (eg. if the price is greater than 1$) and buy them back (eg. when the price is smaller than 1$). they say they have enough money to buy all usdt back (but many people are in doubt about it). furthermore the community knows that tether tries always to adjust the price of usdt to 1$. so only very few people will sell usdt for <1$ or buy it for >1$ (because it is probably uneconomical). so the trader-community is "helping" tether a little bit by continuing mostly accepting this 1usdt=1$-"rule" which could be useful for everyone on a long-term basis.


Import Multibit multibit.key into Electrum Have a multibit.key file from an old Multibit Wallet, but can't import it into Electrum.

When I copy and paste the char string from the file into the "Import Addresses and Private Keys" Electrum window it just never allows me to push Next and proceed.

What am I doing wrong? Is there any other way?

I had the same problem with one of my customers and found out that Multibit had generated an invalid key due to a bug in the software. This key cannot be used because it is out-of-range of the bitcoin EC specs. Check if your key is working with any other software. We are currently working on a solution - you can PM me.


Mining pool hardware and bandwidth requirements Has anyone measured what are the hardware and bandwidth requirements to run a mining pool? Are there any statistics on that per amount of active miners, their hashspeed and other variables?

a good dedicated server will be enough to run a pool like eligius
you will need to ln -s /dev/null debug.log ( or logrotate the file ) if you dont want to run out of space
you could use a good anti-ddos protection if your pool becomes popular ( most pools and bitcoin businesses are regularly ddosed .
concerning server load and bandwidth usage, you could be interested in reading this ( very technical ) log extract , setting this parameter ( difficulty rewrite ) can help to reduce load ( receiving more or less miners requests / second ) and / or make your pool more or less cpuminer friendly


ASICMINER Blade Erupter Backplane Dimensions I need to know the exact dimensions of Backplane (http://www.amazon.com/ASICMiner-Block-Erupter-Blade-Backplane/dp/B00GPUDBSM), both it's height, length and width. If you have one of these mining rigs fully loaded what I really need is the total dimensions of that entire setup.

The dimensions are as follows:

Hasher size: 233mm x 116mm with a 227mm x 100mm x 19mm heat sink attached to its back

Power module size: 192mm x 89mm

Ethernet controller size: 86mm x 40mm

Source:

https://bitcointalk.org/index.php?topic=204030.0


How do hodl invoices work? On March 15th, 2019 hodl invoices where added to lnd via this pull request. Hodl invoices allow a recipient to accept or deny a transaction at their discretion, a very useful feature. However, how does this feature actually work? Are funds locked up until the htlc is settled? Are they not reserved, therefore the longer a hodl invoice is left idle the higher likelihood the transaction may ultimately fail?

Generally when paying an invoice a chain of htlcs from the sender via some path on the network to the recipient is set up. The htlcs lock in by exchanging signatures on every local channel. Now there is a min timelock  which is the amount of time the payment can take. Or the time frame in which the htlcs must settle by releasing a preimage to have a successful payment.

The general workflow is that the recipient is supposed to release the preimage once the htlc on their channel is set up and the amount is equal or bigger the one requested in the invoice.

With the HODL invoice as described in the pullrequest the recipient decides not release the preimage automatically. Therfore the settlement of htlcs is deferred into the future (or the timelock cancles the payment process)


Why is a softfork unable to divide the network? I was wondering why a soft fork cannot in principle divide the Bitcoin network as a hard fork can.  I understand that a soft fork, by definition, involves only tightening the consensus rules, but the result will still be two different sets of consensus rules.  If some nodes consider a block or transaction valid and others consider it invalid, a network divide should be possible regardless of which side's consensus rules are newer.  The roles of each side in the division would simply be the reverse of the hard fork case.

I was wondering why a soft fork cannot in principle divide the Bitcoin network as a hard fork can.

A soft fork absolutely can divide the Bitcoin network, in principle, if you don't specify any other assumptions.

However, the relevant point that distinguishes soft and hard forks is that the network will always converge as long as a majority of the hashrate enforces the new rules.

The reason for this is that even when old miners would produce a block that violates the soft fork's rules, the new miners will not work on top of it. They will ignore such a block, and start working on a competing branch instead. As they have the majority, this competing branch will at some point overtake the old miners' branch. The backward compatibility of the softfork means that old miners at that point will switch over to the new branch, abandoning their own, as the new branch is longer and is valid to them. Through this, the fork is resolved, and the whole network ends up working on one chain again.

As you can see above, the remaining old miners will cause increased (temporary) forks in the chain. In order to avoid having these interfere with the security properties of the network, recent soft forks in Bitcoin have employed thresholds of 95% (measured in one way or another) of miner signalling - leaving at most 5% that may produce forks.


What else can bitcoin inventory vectors be used for? As described in the protocol specification bitcoin nodes respond to the inv command, which queries a node's knowledge of one or more objects, with an inventory vector. According to the bitcoin wiki, inventory vectors can either be of type transaction or type block. What else could be stored in a bitcoin inventory vector?
https://en.bitcoin.it/wiki/Protocol_specification#Inventory_Vectors

Inventory vectors are a collection of inventory items, the ones that are described to be either of type block, transaction or error. Inventory items of type transaction and block are references to actual block or tx messages being available for retrieval.
As such they are used in two places in the protocol:

The inv message to communicate the availability of the respective full message
The getdata message to ask for the full message

The inventory item is implicitly limited to 32 bytes in payload (hash) and a 4 byte type. Currently they are not used besides the original two hash types, but there were a few ideas flying around about getting inner Merkle-Tree nodes as a support for SPV clients to query the current state of the system.

Basically you can use anything you want in there, as long as you manage to stay inside the 32 byte + 4 byte limit, but preferably you'd keep the semantics of the hash + type being a reference to a retrievable item on the sender side.


Is it sufficient to backup the private keys of my android Dogecoin Wallet? I installed the langhans Dogecoin Wallet on my android device and backed up my private keys.
Is it sufficient to backup the wallet to avert loss in case of loss of or damage to the phone?

The private keys are the critical thing and are in the wallet backup.  They're what is needed to transfer coins. If they become public (i.e. stolen), whoever has them can transfer your coins to themselves. If you lose/forget your private keys, you can't make transfers, the coins are worthless to you, effectively lost.

You can create multiple addresses for bookkeeping. For example you can create an address for client X and an address for client Y, your wallet will show how much each address has received.  Also, creating a new address for every transaction can somewhat anonymize the transactions.


Can the service providing the bitcoin wallet know how much value has the user loaded into his wallet? Say for example I run an ecommerce website which mandates users to have a minimum balance of 1 bitcoin in their wallets to access the platform. In the event the balance in his wallet falls below 1 bitcoin he should not be able to access the platform and he should see a message on his screen saying "Please load to minimum balance".

So, the question is, can I, or the Bitcoin wallet provider I use, read the bitcoin balance of the users so as to fulfil the above business requirement?

All Bitcoin transactions are publicly available. This is fundamentally why Bitcoin can work as a truly decentralized currency. Bitcoin is different from the traditional banking system specifically because anybody can see and validate everyone's transactions. If only a few could access the information about people's balance, then it wouldn't be fully decentralized, it would be just like traditional banking.

So yes, you can calculate the balance of any Bitcoin address in the network.


RPC getnewaddress error on v 0.20.0 I would like to new address generate with this command
bitcoin-cli -testnet getnewaddress "adr1" "p2sh-segwit"  but I get this msg:
error message:
Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path).
Try adding "-rpcwallet=<filename>" option to bitcoin-cli command line.

then I added the -rpcwallet command like that:
bitcoin-cli -testnet -rpcwallet=/home/bitcoin/.bitcoin/ getnewaddress "adr1" "p2sh-segwit"  but I got an error again like this:
error message:
Requested wallet does not exist or is not loaded````

what should I do?

thank you

-rpcwallet takes the name of the wallet, not the path to the datadir (as you appear to have done) or the path to the wallet file.
To get a list of the names of the wallets currently loaded, you can use the listwallets command.


Multiple coins after currency fork Situation: bitcoin hardforks and I got payment with coins, that were in the blockchain before fork:

what can prevent me for sending the same transaction to the other forked network and get the second forked money, because I have a signed sending transaction and I own the target address private keys.

Nothing prevents you from doing such.  You now own coins on both chains, and can spend them independently. Assuming that adequate replay protection has been implemented, you shouldn't have to worry about your transaction on one network being broadcast without your consent on the other.


Back-up a Coinbase wallet? Yes I am a newbie trying to get started with Coinbase. I have created a wallet and it seems there is no way to back-up that wallet for safety reasons. I am still confused, can I send an amount from that wallet to a offline wallet and what would the steps be? Thank you.

You will want to get the address to send it to and it's always good to have multiple wallets but you should be able to contact the wallet company and they can tell how back up the wallet


Is there a point on the secp256k1 curve for any given X coordinate? There function in libsecp256k1 that allows you to directly set the field element to 32 bytes of your choice. Does secp256k1 always return a valid group element for any 32 byte value?

secp256k1_fe_set_b32(&xpoint, bytes)
secp256k1_ge_set_xo_var(ge, &xpoint, 0)

The size of secp256k1's coordinate field is 2256 - 232 - 977.

That means there are only 232 + 977 (about 4 billion) possible 32-byte combinations that are not a valid coordinate.

Only slightly less than half (around 2255 - 1.17 * 2127) of those are the X coordinate of a point on the curve (in fact, for every valid X coordinate, there are either exactly 0 or exactly 2 points on the curve).


Help decrypting Encrypted Privated Keys (AES) I am manually inputting my encrypted private keys and secret key (password) on https://www.browserling.com/tools/aes-decrypt

Is there a way I can input more than 1 encrypted private key at a time? I have hundreds of encrypted private keys I want to check for any btc balance.

Is there a way I can input more than 1 encrypted private key at a time?

Write a script using OpenSSL

  I have hundreds of encrypted private keys I want to check for any btc balance.

You should be prepared that they'll all have zero balance soon after typing them into public websites run by people you don't know anything about. Even if the proprietors are honest, you are also putting temptation in front of their new, temporary, weak-willed or disgruntled employees and their third-party support staff and malicious hackers.


What can I do if someone obtained control of my blockchain wallet? I fell for a bitcoin scam and I would like to undestand what are the risk associated to it.
i established contact with scammer on instgram he convinced me to join the mining pool i had to create a new blockchain wallet and deposit founds and send them to one of the addresses he gave me.
I still have access to that wallet but I dont use it anymore for my transactions.
after that intese experience I decided to research the crypto space more deeply and do it by myself instead of relying and giving trust to random people that promise gains.
That was a huge mistake, I am ashamed of what I did and this is my intent undestand more,and don't forget that mistake.
I lost my money but i also lost the keys of my blockchain wallet.
what should i do ?

I did the account as they asked and money where in the account, but I couldn't access them. after i realized that they sent me this :Hello Sir,
We noticed that you want to make withdrawal in your account. Due to the irregularities encountered from your wallet ,there has been a glitch in the withdrawals process, you will need to pay for tax of %10 percent of your money in your account now to be able to with your money fully. Thank you.
after that which i didn't do
i realized that the website they linked me, and asked me to create a profile, in order to complete the withdrawal was asking to  put my bank details to complete the deposit.
At that point, I stopped and I never shared any of my bank details.
we kept talking he tried to get more money from me and i tried to get my money back, now he is gone blocked me on whatsup.
Was this website a strategy to get my bank account?Can be a way to create a backdoor access?
My biggest fear is that I don't understand if there is a larger scam happening or their only goal was to get my money? if so why did they needed my blockchain account?

To be completely safe, you should throw away every piece of information and data to do with the old wallets used or accessed by the scammer. user-ids, passwords, recovery phrases, backups, keys, addresses and anything else that is related to anything the scammer had access to.
Those wallets and the keys in them are forever unsafe. Even if you reset passwords, change 2FA or do anything else they are still unsafe forever.
In those circumstances I would assume the scammer also has back-door access to any computers or phones or other devices that you, or anyone else in your house owned at the time of the scam.
I would back up any important data (photos, email, other documents) and wipe those devices clean and reinstall the operating systems then sell them.
I would only create a new wallet using reliable sources on a new computer or phone that has never been used on the same local network as any of the devices owned at the time of the scam.
This may seem extreme and it may be unlikely that all of it is necessary in your case. But you don't know for certain. The only way to be sure is to take extreme measures so far as you are able and/or live with the remaining risk.
If you are 100% certain the scammer never persuaded you to install software and never used remote access to share a screen to help you, then your devices might be OK, but you need to be certain.

Postscript:

Typically, potential investors are prompted to fill in an online contact form and then encouraged over the phone to set up a cryptocurrency wallet - but unknown to them the scammer installs remote access software on their device, granting them access to it as well.

From https://www.bbc.co.uk/news/technology-57267199 2021-05-27


Discrepancy between blockchain.info live unconfirmed transactions page and chart I'm looking at the live unconfirmed transaction page at blockchain.info, https://blockchain.info/unconfirmed-transactions which currently as I write this is running at around 166,000 transactions.

When I look at the chart labeled Mempool Transaction chart https://blockchain.info/charts/mempool-count with a description of "The number of transactions waiting to be confirmed", I see nothing that goes over 50,000 and for the current time shows only 22,066 transactions.

Seems like they should be the same. One is current unconfirmed transactions and the other is the number of transactions waiting to be confirmed.  What am I missing?

You're not missing anything. If the two where sourced from the same full node, they should show the same data. It appears that there are two distinct sources used for the graphs.

By the way, the mempool chart indicates that the full node sourcing the chart was uncleanly shut down today, which is not reflected in the other unconfirmed transaction count. On a clean restart, the node should have simply reloaded the persisted mempool state, but instead the graph indicates that it took hours to build up transactions in the mempool. (Alternatively that full node predates Bitcoin Core 0.14.0 when the feature was introduced.)


If there is no one company behind bitcoin, who controls it? "If there is no one company behind bitcoin, who controls it?"  This is the question that many people new to bitcoin ask. What is the best way to convey to them how bitcoin works, and in a way that can be understood by non-techies.

Bitcoin operates based on a set of rules known as the Bitcoin protocol, which is defined by a consensus among its users.

The Bitcoin software is open source so anyone can contribute to its development, but in order for one to have any influence his modified software needs to be accepted by the users (so harmful code will be rejected).

The Bitcoin currency day-to-day bookkeeping is operated by a peer-to-peer network of computers running a Bitcoin software which follows the Bitcoin protocol. Virtually anyone can make his own computer part of this network.


BitFinex API call returns 400 bad request - "Could not find a key matching the given X-BFX-APIKEY" I dont know what I'm doing wrong, but everytime I try send post request "https://api.bitfinex.com/v1/balances" or some else I got this answer "Could not find a key matching the given X-BFX-APIKEY".

I was trying some aplication, make-online-request-sites, my own program and code from this page BitFinex API call returns 400 bad request.

My api-key looks like dddd where d is digit.

Maybe I dont know how looks like key-api. This should be first column on this site https://www.bitfinex.com/account/api, right? Second is api-secret. Really... I cant understand what I'm doing wrong...

You see the API key once, when it's generated.

You have to generate another one.

It's sorta mystifying that they would show the API secret whenever you look at that page, but only show the API key once. I dunno why they did that.


How To Get Master Fingerprint say I have master private key from dumpwallet command:

extended private masterkey: tprv8ZgxMBicQKsPdcg8UJAGEEQM6zQgyxgXXXXXXXX

from there, I derived child key using bx hd-private command

$ xprv=tprv8ZgxMBicQKsPdcg8UJAGEEQM6zQgyxgXXXXXXXX
$ bx hd-private -d $xprv | bx hd-private -d

which returned tprv8eWEgAtBJiEjAn8o4G6JL1mqoccXXXXXX

I want to derive hardenned addresses within BIP141 m/0'/0'/* (ex. m/0'/0'/0')

using bitcoin-cli deriveaddresses, which I need a correct descriptor.

$ acctKey=tprv8eWEgAtBJiEjAn8o4G6JL1mqoccXXXXXX
$ bitcoin-cli getdescriptorinfo "wpkh([fingerprint/0h]$acctKey/0h/*)"
$ descrip="wpkh(xxxxxxxxxx)"
$ bitcoin-cli deriveaddresses "$descrip"

questions:

How do I get master fingerprint from Master Key?
What is the correct descriptor to use?

Bitcoin Core doesn’t use unhardened keys, so attempting to get a master public key will never work no matter what.


What were the main technological reasons that Bitcoin Cash did not want to adopt SegWit? What are the key risks/drawbacks to SegWit and why did the Bitcoin Cash community conduct a risky hard fork to avoid it?

There's no technical reason to not to support segwit.

The main emotional arguments were that this was better done as a hard fork rather than a soft fork, but this ultimately would have resulted in a handful of bytes being different in the resulting block. SegWit was originally designed as a hard fork before the realization that it could be implemented using traditional upgrade paths, to exemplify that. As a hard fork, SegWit would have resulted in substantially more disruption of the network for an almost immeasurable efficiency gain.

Claims at the time that miners could steal outputs from SegWit addresses is demonstrably false. P2SH worked in a similar way, and has the same threat model, even at the time storing billions of USD worth of Bitcoin in its scripts. As the rules are enforced by nodes, rather than miners, this claim is largely based on a misunderstanding of the security model of Bitcoin.


How to find net BTC spent or recieved in a transaction Given a BTC transaction such as this, how do I find the net amount person A sent to person B. I have searched all over and people start bringing up change wallets and all this other stuff. All I want to know, is given this transaction how can I convert it into something like: A --1.32BTC--> B. I don't care about what wallets the change was sent to, or what wallets were the inputs. All I need to know is how much did person A lose in the transaction and how much did person B gain. Thanks

{
"txid":"7afbbb1e606cc232602944b79ae90e9530b74776a923e9ec044a30738c679931",
"version":1,"locktime":0,
"vin":[{"txid":"8607869dc4f89440dee4ed5f9a32a4610cd0b6065ca66f7891ddf7d65ed09d07",
"vout":0,
"scriptSig":{"asm":"304402202882405db1bae04e1a13f1609beac47ea3afebe3668a44fe8ab393ac768e194d022015d3a915ba662097000bf90191a938949141fe9f16918e845d20fe1af2003e01[ALL] 03166a538434ad1ec63fc5265dbbcbfbd521ca513593f7edc4d5929b285f6d4422","hex":"47304402202882405db1bae04e1a13f1609beac47ea3afebe3668a44fe8ab393ac768e194d022015d3a915ba662097000bf90191a938949141fe9f16918e845d20fe1af2003e01012103166a538434ad1ec63fc5265dbbcbfbd521ca513593f7edc4d5929b285f6d4422"},
"sequence":4294967295,
"n":0,
"addr":"16jyig11zSX77NV3o4AcWiw57m1tqLogg",
"valueSat":229438,
"value":0.00229438,
"doubleSpentTxID":null}],
"vout":[
{"value":"0.00008203",
"n":0,"scriptPubKey":{"hex":"76a9140115f4b99e9c537bb584149191723841c6171a6f88ac",
"asm":"OP_DUP OP_HASH160 0115f4b99e9c537bb584149191723841c6171a6f OP_EQUALVERIFY OP_CHECKSIG",
"addresses":["16jyig11zSX77NV3o4AcWiw57m1tqLogg"],
"type":"pubkeyhash"},
"spentTxId":null,
"spentIndex":null,
"spentHeight":null},
{"value":"0.00185075",
"n":1,
"scriptPubKey":{"hex":"a914b0458d1ab4d0fcffc7fd1014d6e62ad8120d294787",
"asm":"OP_HASH160 b0458d1ab4d0fcffc7fd1014d6e62ad8120d2947 OP_EQUAL","addresses":["3Hm4AomkLBGgHHMVMYqoxpTyn1tvf6u4dh"],
"type":"scripthash"},
"spentTxId":null,
"spentIndex":null,
"spentHeight":null}],
"blockheight":-1,
"confirmations":0,
"time":1515372033,
"valueOut":0.00193278,
"size":223,
"valueIn":0.00229438,
"fees":0.0003616}

If you have a look at the "vout" array, you can see there are two outputs from this transaction. The first pays 0.00008203 BTC to 16jyig11zSX77NV3o4AcWiw57m1tqLogg, and the second pays 0.00185075 BTC to 3Hm4AomkLBGgHHMVMYqoxpTyn1tvf6u4dh. There is a single input into the transaction, from the address 16jyig11zSX77NV3o4AcWiw57m1tqLogg (which must have been calculated by a block explorer because inputs do not have "from" addresses). The value of the input was 0.00229438, and it looks like the first output was to the same address as the input address so it is likely change, thus person A lost (0.00229438 - 0.00008203 = 0.00221235 BTC), and person B (could technically also be person A paying themselves) gained 0.00185075 BTC. The rest, 0.0003616 BTC, was paid as a fee to the miners.


How does the getblocktemplate request rate correlate with a miner's hashrate? What is the relationship between a miner's hashrate and the getblocktemplate (GBT) request rate?

(The question here, "How does the rate of getwork requests correlate with the hashrate of a miner?," discusses getwork, but that's outdated.)

There's no relationship. With a single block template mining software can create a limitless amount of work by modifying the extranonce, the only reason they would need to update to a new one is to include transactions that have just arrived, or when someone else has found a block. The reason GetWork rates varied was that each request was only valid for a single 2**32 nonce range, which a modern ASIC miner can exhaust in milliseconds.


Is mastercoin a perpetual bitcoin machine If Alice sends Bob one bitcoin on the mastercoin network, this transaction is technically implemented using a standard bitcoin transaction with a negligible amount.
Isn't that equivalent to creating bitcoins from thin air?

No.
Mastercoin clients form a bridge between the bitcoin network and the mastercoin network riding on top of it.
When Alice sends Bob one bitcoin in exchange for, say, 2 Mastercoins, the Mastercoin client recognizes a standard bitcoin transaction from Alice to Bob and a mastercoin transaction (encoded as a negligible amount bitcoin transaction) from Bob to Alice.
No bitcoins are created.

This type of transaction is the basic way to create value in the mastercoin network.
Note that the same answer doesn't hold for other currencies, say US dollars, because there is no direct way for the mastercoin client to know that US dollars changed hands.


Is it wrong to spend Bitcoin from someone else's wallet if my Bitcoin client generates the same address? I know this scenario is extremely unlikely but what-if by chance I get the same Bitcoin address as another user and the user has hundreds or thousands of Bitcoins in his wallet, is it morally/legally acceptable to spend the money from this wallet? Would you say it's considered stealing or do I now have equal ownership of the wallet just as the original owner?

My first impression was that it's the wrong thing to do. However, perhaps because Bitcoin inherently allows for this possibility (by design) one might argue that by using Bitcoin, one understand the risks associated with using Bitcoin and agrees to share the coins if such a thing did occur.

I'm interested in knowing the Bitcoin communities' take on this.

However, perhaps because Bitcoin inherently allows for this possibility (by design)

I would dispute that.  A fundamental tenet of cryptography is that "extremely unlikely" is effectively the same as "impossible".  Bitcoin has been carefully designed so that this should never happen by chance.  And people definitely don't use Bitcoin with the assumption that there is a meaningful chance of someone else taking their coins through this route.  There is certainly no implied consent.

In fact, I think that it's meaningless to discuss the ethics of what to do if you accidentally generate the same key as someone else.  To me, it's like asking whether it would be ethical to kill a time traveler.  Maybe the discussion helps you think about ethics, as a thought experiment, but it has no practical relevance, because it's about a situation that fundamentally can never happen.

In practice, if you ever do generate an address that already exists, what it means is that both of you are using terrible random number generators.  Maybe one or both of you is doing so on purpose, suspecting that the other has a weak RNG and trying to exploit it.  So if it's not you that's intentionally trying to crack something, then throw away the software (or hardware) you are using, because it's horribly broken.  And do the rest of the community a favor and responsibly disclose the vulnerability, so that people know not to use it, and so experts can investigate the problem.

In this case, you could of course take advantage of the other person and steal their coins.  But you'll know that it's not just random chance - you're actively exploiting a flaw in the software.  I think that would help most people realize that it's clearly unethical to do so.  (You could also transfer the coins to another address, so that they can't be stolen by someone else, and then try to get them back to the rightful owner.)

The other possible explanation for such an occurrence is that one or both of you has found a severe weakness in the cryptographic primitives used by Bitcoin.  This is similar to the previous case: responsibly disclose and don't steal anything.


senting wrong address from BCH to BTC address PLEASE HELP! please help me I am New to this please show me step by step how to recover the lost coin let me explain.
First I used Trezor wallet sent bitcoin(BTC) out convert to bitcoin cash(BCH) using shapeshift.io, however the received address I input BTC received address instead of BCH address so I email shapeshift and asking to recovery my lost coin, they emailed me and say they're nolonger access to my coin to recover it, so they sent me a LINK (https://blockdozer.cominsight.tx.......) ask me to extract the coin using your private key...
please show me how, Im lost...
thank you so much..

The process would be roughly the same as getting your BCH created at the fork. Here's an answer I wrote on that, but it's for a different wallet.

Let's review what happened:

You sent BTC to shapeshift from a Trezor wallet.
You wanted to trade for BCH.
Shapeshift asks for the receiving address.
You provided a BTC address instead of a BCH address.
Shapeshift sent BCH to an identical address generated with a BTC wallet.

Point 5 is where you might save yourself. BCH and BTC generate addresses identically. You sent Shapeshift an address that you generated, however, you generated it with your BTC wallet, instead of your BCH wallet. Since both coins generate addresses exactly the same way, you can use the private key for that BTC address and import/sweep it into your BCH wallet.

Do this:

Get the private key for the BTC address you generated to receive the BCH. I don't know how to use Trezor, so you'll have to get that info somewhere else; I'm sure it's not difficult.
Find the "import private keys" or "sweep wallet" feature for your BCH wallet software. You didn't say which software you use, but I'm sure it's also easy to find and use.
Take the private key from step 1 and input it into the import/sweep feature from step 2.
Enjoy the fact that you've successfully reclaimed your coin and be more careful next time. Confusing BTC for BCH has been a very common mistake since the fork.


What is the best way to purchase Bitcoins quickly? What is the best way to purchase Bitcoins quickly? I don't want to wait a month.

On LocalBitcoins.com you can get bitcoins bought under one hour. Just pick a trader who has good reputation (not a scammer) and low response times.


What does the global transaction limit mean in practice? I read somewhere that there is a global limit of about 7 transactions that can get processed per second. However I was unable to find a clear explanation of what this exactly implies.
First thought:
If I tell one or perhaps a few PCs to transfer some btc a few times per second, then the network is full.
Analysis: Presumably not, as 7 actions per second is not hard to orchestrate
Second thought:
If I make a transaction, I need to wait up to 1/7 th of a second before it happens.
Analysis: Presumably also not as it would not matter enough for people to mention it
Other thoughts, without conclusion:

A transaction may actually be a number of transfers, so perhaps the network is capped at a high number,like 7 million transfers per second
Perhaps this limit is only for transactions that meet criteria (approved, paid) effectively prohibiting someone from just filling the system

A better understanding of the meaning and practical implications would be welcomed!

The Bitcoin network uses the blockchain to form consensus on the journal of transactions. The blocks commit the network to a specific order of events and guarantee propagation. Blocks are found roughly every ten minutes and are limited to 4,000,000 weight units (or 1,000,000 vbytes). Said blockweight limit and cadence of blocks are what limits network's transaction confirmation rate: with about 2,000 to 2,500 transactions per block every 600 seconds, the transaction rate is currently closer to 3.5 tps in practice. Note that a transaction may perform more than one payment.
Before transactions are organized into blocks by miners, the unconfirmed transactions are tracked in the memory pool (mempool) of each node. A node's mempool can hold about half a day's worth of transactions by default. Miners generally pick the transactions with the highest feerate first to build their block to optimize their revenue. When peak demand subsides, the network eventually chews through the backlog, also confirming transactions with lower feerates. Altogether, this forms a market for blockspace in which users can bid with transaction fees to signal the urgency of their payments.

Indeed, how many actual payments would it take a (good or bad) actor to fill the network (or would the payments simply get all grouped together infinitely), is the limit perhaps 3.5*4million per sec?

As described above, miners generally pick the transactions with the highest feerates to form their blocks. If the attacker wants to monopolize all blockspace, they'll have to continuously displace all other transactions from the top of the queue. However, other users are free to resubmit their transactions with an increased feerate to vie for the top of the queue. This would either break the attack or quickly drive up the cost, as all other users acting independently would outspend a low feerate spam attack.
In the 2017 bubble, we saw over a dozen organic blocks with more than 12 BTC in fees. Assuming that an attacker would need to pay a corresponding ~1,200 sat/vB to monopolize blockspace, their attack would cost about 72 BTC per hour.


Can a bitcoin block reward be paid to a multisig address if the transaction is included in the block? Can bitcoind or other miners be modified to use a fixed payout address?

Sure. The miner decides what the payout transaction looks like. It can be paid to any address using any valid type of transaction.

What's specifically checked by the network on coinbase transactions is the absence of output reference in the input, the coinbase position in the block (first) and the reward amount. The output script can be any standard script.

As a matter of fact, rewards used to be paid as pay-to-pubkey transactions. Nowadays, most pools have transitioned to using pay-to-pubkey-hash transactions.


Can't startup Bitgo on Windows After installing bitgoJS, I cd into the bin directory and run the below command

bitgo-express --debug --port 3080 --env test --bind localhost I got,

'bitgo-express' is not recognized as an internal or external command,

Disclosure: I'm a Software Engineer at BitGo.

You can find a guide for running BitGo Express in the corresponding module directory:

https://github.com/BitGo/BitGoJS/tree/master/modules/express

Please direct further questions to the BitGo support team via email to support@bitgo.com.


Bitcoin checks and balances When a new block is created, does each block need to be validated?
How does it differ from validating transactions?

Why miners would waste time validating transactions and blocks when they could spend their time mining

Why miners would waste time validating transactions and blocks when they could spend their time mining?

When a miner successfully mines a block, they  transmit the block across the network. As the block starts to ripple out across the network, each full node receives a copy of the block and after validating it they add the block to the existing chain. Now consider a situation, where the block that is mined does not meet the consensus rules. As the full nodes receive the block, they validate the block to ensure it meets the validation criteria and if the block is invalid, the full nodes will reject the block and will not transmit it further. Thus those miners that do not satisfy the consensus rules will have their block rejected, and will lose their block reward and the effort they put in to mine the block.

  When a new block is created, does each block need to be validated? How does it differ from validating transactions?

When the full nodes receive the block, each node performs a series of checks to ensure that the block conforms to the consensus rules. Similarly, when a transaction is broadcasted, each full node receiving a transaction will perform checks before including it in the mempool. If the transaction is invalid, the transaction will be rejected and will not be broadcasted further by that node. All the transactions included in the block being valid, is a subset of the block verification criteria. You can refer the bitcoin wiki page here to get a checklist on the transaction and block validation.


Can a transaction be created by 2 different wallets? I am familiar with Bitcoin's model, but a complete noob in real-world details. I am entertaining the idea of a service that receives transactions (A->B) and "wraps" or completes them to include (A->B & B->C).

Is it possible to create a transaction requiring 2 wallets to participate?
For example, to create a transaction sending coins from Alice to Bob, and from Bob to Charlie?
I had in mind a process where Alice creates the first half-baked transaction (Alice -> Bob), send it to Bob, Bob "adds" its piece (Bob -> Charlie), and the result is a valid transaction.
Obviously, the (Alice -> Bob) part must not be reusable by anyone else.

Can that be achieved? How? What's a good starting point / alternatives?

Yes. There's a project called Lighthouse that does something very similar. Bitcoin transactions either completely succeed or completely fail. We can use this by starting with a transaction that has the outputs we want.

--> TX -- 0.5 BTC --> Charlie

This is invalid, because it doesn't have any inputs.

We add Alice's input.

Alice --> 0.25 BTC --+
                     +--> TX -- 0.5 BTC --> Charlie

This is invalid, because the transaction creates more in outputs than it takes in inputs. It can't be partially spent, either. It's all or nothing.

We add Bob's input.

Alice --> 0.25 BTC --+
                     +--> TX -- 0.5 BTC --> Charlie
Bob   --> 0.25 BTC --+

Now the transaction is valid, and can be pushed to the Bitcoin blockchain. Modifying it will require Alice and Bob to re-sign it. If we want Bob to have some Bitcoins at the end, the procedure is the same, except we start with outputs that pay both Charlie and Bob.


How much space does deduplication save? Suppose you have multiple computers on the same network. Also, you use a block-level (note that 'block' is different in this context than what it usually means in Bitcoin) deduplication filesystem  like SDFS to deduplicate blocks between these computers.

How much disk space would this save when running Bitcoin Core? Assume that all of the computers are running the same version of bitcoind.

According to this, you need 4096 bytes to align to actually deduplicate (or rather, save space). If I'm reading correctly, that means you would need the same 4096 bytes to occur in the blockchain somewhere at which point you would save space.

Given that each block has all sorts of essentially random data (tx id's block id's, signatures, etc), I would think 4096 bytes aligning anywhere would be highly unlikely. Most likely, you wouldn't actually save any disk space.


Integrate Bitcoin node RPC with website API I am currently using block.io however with their "low" tag fee transactions are still $2+ and they do not offer a way to set custom withdraw fees in their API.

I'm not too sure what my options are but I want to look into setting up my own Bitcoin node/wallet on an external server that we can integrate with our dashboard.

I have a few questions:

1) How would I go about doing it?

2) How many hours would it take for someone with limited experiance? (I will probably be paying someone)

3) Right now block.io is nice because we have unlimited addresses I presume this wont be a problem with the RPC server?

There are two ways you can about doing this:

Using a Bitcoin Node (RPC)
Using a library like this

You asked about RPC so I will talk about that.

Ubuntu

1. You can install the Bitcoin Daemon like this:
$ sudo apt-get install bitcoind

2. You have to start the daemon and wait for blocks to download. You can start the daemon like so: $ bitcoind -daemon
You can check the progress of blockchain download like so: $ bitcoin-cli getinfo

If you don't have space to download the full chain, you can use the prune method. Create a new file ~/.bitcoin/bitcoin.conf and add prune {megabytes of space}. This will limit blockchain space allocation to the value of the prune method.

3. Setup your JSON RPC configuration. You can refer to this thread for adding your RPC username and password.

4. After the blockchain has been downloaded (~150GB), you can connect to the RPC server on port 8332 by default. You may use this library or this library to make calls to the RPC server in NodeJS; you may also use any JSON RPC client to make calls.

5. Use walletnotify to receive transaction updates related to your wallet. Setup an insight-api if you want to receive transaction updates from any wallet. You can use insight-api to index and retrieve transaction data and block data on demand as well.

Resources

Bitcoin API Calls - You may want to reference to these methods as you are programming
Bitcoin Full Node - More information on starting a local node if you are coming across trouble
Insight API - Used for indexing displaying all transactions and blocks.
walletnotify - Information on how to use walletnotify.


How to convert my bitcoins to another currency I'm a merchant, and I'm looking for a complementary method of payment.

How can I exchange bitcoins for my local currency?

Bitcoins can be sold for other currencies at Bitcoin exchanges and exchange services. There are many exchanges all over the world (listed here), but the largest exchange with the greatest depth is Mt. Gox.

You can also use a merchant services provider such as Bit-Pay which will automatically handle for you both receiving Bitcoin payments and immediately converting them to other currencies.


What is the fee policy suggested by the mainline bitcoin client? The online wallet blockchain.info allows for the fee policy to be customised:

The "Normal" policy states

Follow the fee policy suggested by the mainline bitcoin client.

What is the fee policy suggested by the mainline bitcoin client explicitly?

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

  Otherwise, the reference implementation will round up the transaction size to the next thousand bytes and add a fee of 0.1 mBTC (0.0001 BTC) per thousand bytes.

So the rate is 0.1 mBTC for each thousand bytes (rounded up) the transaction is.