Expected use model for PSBT I want to use Bitcoin Core to create a PSBT for offline signing (cold storage) of a multisig p2wsh-in-p2sh address, such as that created by Glacier. Based on the PSBT doc I assume I want the online node to be the Creator & Updater, and the offline node to be the Signer, Finalizer, and Extractor.

Firstly, what is the expected use model (using RPC)?

I've created privkeys, redemption script, and matching address on an offline node. How do I import this into my online node (presumably as a watch-only address)?
Using the online node, how do I construct a PSBT that spends some of the UTXO(s) for this address?
Using the offline node, how do I sign said PSBT using the privkeys, redemption script, and matching address that I have stored on paper?

Secondly, is this process expected to work in today's 0.17.1 software? Is it expected to change in the near future?

Thirdly, is this secure, assuming a secure offline node but an insecure online node? Can I be sure this isn't funding a too-large miner fee, for example? I understand that hardware wallets sometimes require the entire input transactions in order to verify input amounts.

It is important to note that with this process, you will want to use a wallet that does not have private keys. Otherwise, you could accidentally be sending Bitcoin to an address that is in the online wallet. This especially important with change addresses because change addresses are automatically pulled from the current wallet. By disabling private keys, you won't have any change addresses (or other addresses) in the wallet that has your addresses imported. You can create a wallet that has no private keys by using createwallet "<wallet name>" true.

When doing the following with bitcoin-cli, make sure that you include the option -rpcwallet=<wallet name> so that you are using the correct wallet that does not have private keys.

  I've created privkeys, redemption script, and matching address on an offline node. How do I import this into my online node (presumably as a watch-only address)?

Use the importmulti command to import your addresses, their redeemScripts, and their witnessScripts, if any. When you receive coins to these addresses, you will be able to see them in your online wallet's balance using getbalance "*" 0 true.

  Using the online node, how do I construct a PSBT that spends some of the UTXO(s) for this address?

You can use the walletcreatefundedpsbt command. Your command will be something like:

walletcreatefundedpsbt '[]' '[{"<recipient address>":<recipient amount>}]' 0 '{"includeWatching":true,"changeAddress":"<change address>"}' true

What this will do is create a transaction with the outputs to your recipients. It will then choose inputs from the wallet, and add them to the transaction. If there is change, it will use the change address that you specify. walletcreatefundedpsbt has other options too. Read the help text for more information.

  Using the offline node, how do I sign said PSBT using the privkeys, redemption script, and matching address that I have stored on paper?

Assuming that your offline node has the private keys, you can sign using the offline node by taking the PSBT from the previous step and using the walletprocesspsbt command. Your command will be something like this:

walletprocesspsbt <psbt>

It will give you a PSBT that contains signatures. You can double check this by decoding it with decodepsbt <psbt>.

Then you can finalize and extract using either your online or offline node, it doesn't matter. You will use finalizepsbt <psbt>. If everything is correct, you will get a hex transaction that you can send with sendrawtransaction. If some part of the process failed, then it will fail to finalize and extract, so you will get another PSBT from finalizepsbt.

  Secondly, is this process expected to work in today's 0.17.1 software?

Yes

  Is it expected to change in the near future?

Not significantly. There may be more commands that are added that are useful, but not necessarily required. The format for the existing commands won't change significantly if at all.

  Thirdly, is this secure, assuming a secure offline node but an insecure online node? Can I be sure this isn't funding a too-large miner fee, for example? I understand that hardware wallets sometimes require the entire input transactions in order to verify input amounts.

Yes, it is secure, even if the online node is compromised. When the offline node signs, it does several checks. It will check that the entire previous transaction included for non-witness inputs has a txid that matches the one specified in the transaction being made. This ensures that you are spending what you expect to be spending.

For segwit inputs, part of what you are signing is the value of the output being spent. So you always know what amount you are spending. If the amount is incorrect (does not match the amount that you expect for that output), the signature will be invalid and thus the whole transaction will be invalid.

These checks ensure that what you sign will either be exactly what you expect it to be, or that the result is invalid and nothing moves anyways. Since the transaction includes full amount and scriptPubKey information, you can double check that the amounts are correct, the fee is correct, the inputs are the ones you want to use, and the outputs are the ones you want to create by using the decodepsbt command.


Is it plausible to make a decentralized rendering farm by creating a new cryptocurrency? I had this idea to create a new cryptocurrency that uses rendering as mining, using it to create a decentralized render farm. is it possible, and if yes, then how? Sorry the question is not in depth. I'll edit this as I go along. Thanks!

No.

A proof of work is a piece of data which is difficult (costly, time-consuming) to produce but easy for others to verify. You might be able to squeeze a render job into those constraints (remember, easy to verify also means it needs to be easy (small) to download, otherwise it's already a DOS opportunity right there).

However, another PoW requirement is that the work must be progress-free, which means every iteration of the work is completely independent of all other iterations (like rolling dice). This is because if you have 10% of the capacity, you'll win 10% of the time. As soon as there is progress in the work (20% done, 50% done, 99% done ... 100% done) then the fastest render farm will win 100% of the time (defeating the whole purpose of PoW). That situation also opens up all kinds of exploits where a fast farm can work ahead on the next block and gain an even bigger advantage.

There are many aspects to being progress-free. Even the current bitcoin PoW has a little bit of progress in practice (the block propagation itself) and even a little bit causes centralization pressure: bigger farms have a slight advantage over smaller farms.


Is it possible for multisig wallets to have trusted addresses? (Dynamic amount of permissions required) I've been wondering if it is by design possible to have a multi-signature wallet which has a set of trusted addresses which require less signatures.

Let's say I have a 3-of-5 wallet, but all address holders agree there is a certain address which is trusted and should only require 2-of-5 or even 1-of-5 signatures.

Is it possible to implement such a wallet? If so, do any mainstream wallets currently have this feature?

Thanks

This is not a wallet function. This can be done with m-of-n multisig script.

for example Alice, Bob, Charley, David and Eva want to have 3-of-5 multisig address, but David is manager and it is enough to have 2 signatures for spending if one signer is David. Eva is bigboss and can spend funds alone.

So, the redeem script can be

OP_3 pubA pubB pubC pubD OP_DUP pubE OP_DUP OP_DUP OP_8 OP_CHECKMULTISIG


What they stored in cold wallet? All bitcoins anyone owned is already in blockchain I just want to understand what actually they store in the cold wallet because all bitcoins anyone owned is already in the blockchain.

Do they store the private key of users in cold wallet?

Do they store the private key of users in cold wallet?

In short, yes. (Some) private keys are stored in cold wallets.

The record of all bitcoins (UTXOs) exist as a public database, which is stored in full nodes all around the world.

To spend a UTXO (ie, some amount of bitcoin), the user must be able to produce a valid signature, by using the appropriate private key for that bitcoin address/script.

Those private keys are stored in various ways. One such way is a 'cold wallet'. Generally, a cold wallet describes a way of storing a bitcoin private key, such that the device storing the private key has not, and will not, connect to the internet. Conversely, a wallet that exists on an online machine is usually referred to as a 'hot wallet'.

There are also different types of hot wallets, and cold wallets. But the online/offline distinction is the main distinguishing factor.


Colored coin adds meta data to OP_RETURN. Why isn't this frowned upon? It seems that adding data to OP_RETURN is frowned upon and considered as bloating the blockchain.

Blockchain.info wallet also had a short stint where users could include data into the OP_RETURN field before it was pulled.

I like that fact that this field exists but can also understand the arguments against putting random data in there.

Coloredcoin makes extensive use of OP_RETURN so does this mean that coloredcoin's actions are frowned upon by the community? Don't they set a precedent?

I think I get it now. So Blockchain.info's wallet use to have a field for adding custom messages via a public note field.

(https://blog.blockchain.com/2014/05/09/tutorial-how-to-send-bitcoins-using-our-web-wallet/)

This was "potentially" creating lot of un-spendable outputs. Ie bloating the blockchain in a bad way.

  "Yes, please don't create lots of unspendable scriptPubKeys. There are
  more prunable ways of embedding messages into transactions. And there
  are even better ways of associating messages with transactions, so
  only people involved with the transaction can read the message (if
  that's desired).

  In other words, lets figure out how to do this the right way. The way
  you're doing it now will stop working as soon as the network upgrades
  anyway (0-value outputs are nonstandard as of the 0.7 release)."

(https://bitcointalk.org/index.php?topic=40264.msg1162402#msg1162402)

When the OP_RETURN drama eventually passed, this allowed any kind of meta data to be stored on the blockchain to the tune of 80 bytes in a "friendlier" way.

Coloredcoin (and others) then made extensive use of this but because it uses the OP_RETURN code, this means that transactions are not stuck in limbo in UTXO and in addition, they can be removed or "pruned" with no detrimental effect.

In summary, adding non-bitcoin/ledger related data to the blockchain is only frowned upon by the people in the "use the bitcoin blockchain only for financial data" camp. With OP_RETURN, it is not such a big deal now because it can be pruned and keeps the people who want to put meta data on the blockchain happy.


How to speed up first sync bitcoind? I am running bitcoind version 0.19.0.1 on different cloud providers and it gets very slow at some point. After 300k blocks, CPU drops from ~90% to 5% and network usage drops to a minimum. I've tried in a medium size droplet at Digital Ocean and t2.small on AWS.

In the latter, IO operations in the HDD are at a good throughput. My configuration is by default.

As you've discovered, Bitcoin Core is almost optimally non-performant on shared servers.

The majority of the work done is on a single core, so measuring the total utilization of the CPU is not a good measure.  Database operations are necessarily single threaded, and the majority of the work in the early parts of the chain are entirely consumed by this.
Bitcoin Core is sensitive to disk speed and latency for some operations, which shared servers are often starved of resources for. EC2 especially is well known for atrocious IO performance in even moderately sized instances, other low cost providers suffer similarly.

Security issues with delegating your private material to a third party not withstanding, the best performance is going to be on a dedicated piece of hardware that is not EC2. Otherwise increasing the amount of dbcache increases performance to a degree (more than a couple of gigabytes will not help), but this will not resolve CPU resource starvation which is common for shared hosts.


Can an attacker create many nodes that approve blocks without work? There are currently about 7000 nodes in the Bitcoin network. The security rests on the fact that someone adding nodes would have have to expend CPU power to hash transactions.

What prevents someone from creating a large number (e.g. 10,000 to 20,000 or more nodes) and then execute the following attack.

The objective of the bogus network would be to appear to anyone, except for the legitimate nodes, as producing legitimate verification of Bitcoin transactions without actually doing the work. While the legitimate network would know something is wrong; to those outside it would appear that a majority were approving the transaction.

The bogus nodes run a stripped down version of Bitcoin which accepts new blocks from other bogus nodes, but not new legitimate ones. The bogus software is designed to make the blocks look as real as possible, chain together, but without requiring the true proof of work. The nodes could be bots on compromised computers.

The nodes might do something like:

1) Gather any transactions sent to the network, including ones with invalid signatures and perhaps other invalid information, including thefts by the schemers.

2) The nodes in concert generate the block header and hash, by hashing once with some pre-aggreed upon nonce. They don't bother to do the repeated search.

3) All the bogus nodes accept the new block, send their acceptance out to the network and start creating the next block

You're essentially talking about a "fork" - or a separate chain. It wouldn't and couldn't interface with bitcoin - merely work (at best) alongside it. Exchanges, merchants, and official bitcoin wallets could not be fooled into using this alternative. Someone would have to download a compromised client. As each block refers to the previous one, there would be no way for them to "inject" fake blocks in the way.


Can we derive parent’s private key using child’s private key? In the book named Mastering Bitcoin by Andreas, the author described the usage of derived child keys. One thing I noted was that he said(page 108),

  The derivation function is a one-way function, the child key cannot be
  used to find the parent key. The child key also cannot be used to find
  any siblings.

And when he had come across the topic Hardened Child Key derivation he described the flaws of Non-Hardened Child Key derivation. He said(page 112),

  Because the xpub contains the chain code, if a child private key is
  known, or
  somehow leaked, it can be used with the chain code to derive all the
  other child private keys. A single leaked child private key, together with a parent
  chain code, reveals all the private keys of all the children. Worse, the child private key
  together with a
  parent chain code can be used to deduce the parent private key.

What I can’t understand is why had the author initially stated that using child keys we cannot derive parent keys, and later stating that using child’s private key we can derive parent’s key.

Well, I’ve found one post which clearly explains the latter. But not the former. Can anyone explain what he meant in the former?

But not the former. Can anyone explain what he meant in the former?

A child key can refer to two different things: the child private key and the child public key. With just only one of these two things, you cannot determine the private or public keys of any parents or siblings. Just revealing one of those keys does not necessarily reveal any other information.

However, when a child private key AND the parent extended public key (so public key and chaincode) are revealed, we can derive the parent's private key. This requires more than just the child private key and cannot be done with a child public key.


What is the estimated price of Bitcoin which will push miners to stop mining if its price dropped to uneconomical level ? What is the estimated price of Bitcoin which will push miners to stop mining if its price dropped to uneconomical level?

When a bitcoin was worth less than $10, miners were mining.

When a bitcoin was worth more than $15,000, miners were mining.

The key point is that there is no exact price that would make mining unprofitable. Bitcoin mining is a self-balancing system made up of individuals with different costs, and thus mining is sustainable at any price level.

If the price drops, then the miners who pay the most to mine a coin will become unprofitable, and they may stop mining. But this would only make it easier to mine coins for all the remaining miners, and so the network would find a new balance. A huge drop in price may cause many miners to shut off their rigs, but the disruption to block interval would only be temporary, as the network difficulty would adjust and soon blocks would continue to be found every ~10 mins on average.

In a very extreme case where an extremely significant portion of hashpower dropped off, then the block interval may become extremely long. But a situation like that is unprecedented, and in fact many miners may persevere and mine at a short-term loss, in order to maintain their long-term investment strategy, for ideological reasons, etc.

So TL;DR: the average cost of mining $1 worth of bitcoin will trend towards $1, so a lower BTC price just means that miners as a whole will spend less resources mining bitcoins.

EDIT: To be clear, a price of $0/BTC would in fact be unprofitable to mine, for hopefully obvious reasons. But anything above that will be sustainable.


Calling JSON commands to armoryd I know with bitcoind, you can easily start the daemon and call some commands.

But with armoryd, I start it up with a wallet argument.

What are some examples of using the JSON-RPC to call a method for it?

For example, with bitcoind I can type in my shell:

bitcoind listaccounts

Is there a easy way to get my armoryd daemon to do the same?

In your install directory, you should have armoryd.py.  Once you run

python armoryd.py

then you have a daemon.  Now you can run

python armoryd.py help

to get a list of commands like this (which can then be run with python armoryd.py <command>):

{
"backupwallet": {
    "Description": "Back up the current wallet to a file at a given location. The backup will occur only if the file does not exist yet.",
    "Parameters": [
        "backupFilePath - Path to the location where the backup will be saved."
    ],
    "Return Value": "A dictionary indicating whether or not the backup succeeded or failed, with the reason for failure given if applicable."
},
"clearaddressmetadata": {
    "Description": "Clear all armoryd-specific metadata for the currently loaded wallet.",
    "Parameters": [
        "None"
    ],
    "Return Value": "None"
},
"createlockbox": {
    "Description": "Create an m-of-n lockbox associated with wallets loaded onto the armoryd server.",
    "Parameters": [
        "numM - The number of signatures required to spend lockbox funds.",
        "numN - The total number of signatures associated with a lockbox.",
        "args - The wallets or public keys associated with a lockbox, the total of which must match <numN> in number. The wallets are represented by their Base58 IDs. The keys must be uncompressed."
    ],
    "Return Value": "A dictionary with information about the new lockbox."
},
"createustxformany": {
    "Description": "Create an unsigned transaction to be sent to multiple recipients from the currently loaded wallet.",
    "Parameters": [
        "args - An indefinite number of comma-separated sets of recipients and the number of Bitcoins to send to the recipients. The recipients can be an address, a P2SH script address, a lockbox (e.g., \"Lockbox[83jcAqz9]\" or \"Lockbox[Bare:83jcAqz9]\"), or a public key (compressed or uncompressed) string."
    ],
    "Return Value": "An ASCII-formatted unsigned transaction, similar to the one output by Armory for offline signing."
},
"createustxtoaddress": {
    "Description": "Create an unsigned transaction to be sent to one recipient from the currently loaded wallet.",
    "Parameters": [
        "recAddr - The recipient. This can be an address, a P2SH script address, a lockbox (e.g., \"Lockbox[83jcAqz9]\" or \"Lockbox[Bare:83jcAqz9]\"), or a public key (compressed or uncompressed) string.",
        "amount - The number of Bitcoins to send to the recipient."
    ],
    "Return Value": "An ASCII-formatted unsigned transaction, similar to the one output by Armory for offline signing."
},
"decoderawtransaction": {
    "Description": "Decode a raw transaction hex string.",
    "Parameters": [
        "hexString - A string representing, in hex form, a raw transaction."
    ],
    "Return Value": "A dictionary containing the decoded transaction's information."
},
"dumpprivkey": {
    "Description": "Dump the private key for a given Base58 address associated with the currently loaded wallet.",
    "Parameters": [
        "addr58 - A Base58 public address associated with the current wallet."
    ],
    "Return Value": "The 32 byte binary private key."
},
"encryptwallet": {
    "Description": "Encrypt a wallet with a given passphrase.",
    "Parameters": [
        "passphrase - The wallet's new passphrase."
    ],
    "Return Value": "A string indicating that the encryption was successful."
},
"getactivelockbox": {
    "Description": "Get the lockbox ID of the currently active lockbox.",
    "Parameters": [
        "None"
    ],
    "Return Value": "The Base58 ID for the currently active lockbox."
},
"getactivewallet": {
    "Description": "Get the wallet ID of the currently active wallet.",
    "Parameters": [
        "None"
    ],
    "Return Value": "The Base58 ID for the currently active wallet."
},
"getaddrbalance": {
    "Description": "Get the balance of a Base58 address associated with the currently loaded wallet.",
    "Parameters": [
        "inB58 - The Base58 address associated with the current wallet.",
        "baltype - (Default=spendable) A string indicating the balance type to retrieve from the current wallet."
    ],
    "Return Value": "The current wallet balance (BTC), or -1 if an error occurred."
},
"getaddressmetadata": {
    "Description": "Get all armoryd-specific metadata for the currently loaded wallet.",
    "Parameters": [
        "None"
    ],
    "Return Value": "A dictionary with all metadata sent to armoryd."
},
"getarmorydinfo": {
    "Description": "Get information on the version of armoryd running on the server.",
    "Parameters": [
        "None"
    ],
    "Return Value": "A dictionary listing version of armoryd running on the server."
},
"getbalance": {
    "Description": "Get the balance of the currently loaded wallet.",
    "Parameters": [
        "baltype - (Default=spendable) A string indicating the balance type to retrieve from the current wallet."
    ],
    "Return Value": "The current wallet balance (BTC), or -1 if an error occurred."
},
"getblock": {
    "Description": "Get the block associated with a given block hash.",
    "Parameters": [
        "blkhash - A hex string representing the block to obtain."
    ],
    "Return Value": "A dictionary listing information on the desired block, or empty if the block wasn't found."
},
"gethextxtobroadcast": {
    "Description": "Get a signed Tx from a file and get the raw hex data to broadcast.",
    "Parameters": [
        "txASCIIFile - The path to a file with an signed transacion."
    ],
    "Return Value": "A hex string of the raw transaction data to be transmitted."
},
"getledger": {
    "Error": "The function description is malformed."
},
"getledgersimple": {
    "Description": "Get a simple version of a wallet or lockbox ledger.",
    "Parameters": [
        "inB58ID - The Base58 ID of the wallet or lockbox from which to obtain the ledger. The wallet or lockbox must already be loaded.",
        "tx_count - (Default=10) The number of entries to get.",
        "from_tx - (Default=0) The first entry to get."
    ],
    "Return Value": "A dictionary with a wallet ledger of type \"simple\"."
},
"getlockboxinfo": {
    "Description": "Get information on the lockbox associated with a lockbox ID string or, if it exists, the currently active armoryd lockbox.",
    "Parameters": [
        "inLBID - (Default=None) If used, armoryd will get information on the lockbox with the provided Base58 ID instead of the currently active armoryd lockbox.",
        "outForm - (Default=JSON) If used, armoryd will return the lockbox in a particular format. Choices are \"JSON\", \"Hex\", and \"Base64\"."
    ],
    "Return Value": "If the lockbox is found, a dictionary with information on the lockbox will be returned."
},
"getnewaddress": {
    "Description": "Get a new Base58 address from the currently loaded wallet.",
    "Parameters": [
        "None"
    ],
    "Return Value": "The wallet's next unused public address in Base58 form."
},
"getrawtransaction": {
    "Description": "Get the raw transaction string for a given transaction hash.",
    "Parameters": [
        "txHash - A string representing the hex value of a transaction ID.",
        "verbose - (Default=0) Integer indicating whether or not the result should be more verbose.",
        "endianness - (Default=BIGENDIAN) Indicates the endianness of the ID."
    ],
    "Return Value": "A dictionary with the decoded raw transaction and relevant information."
},
"getreceivedbyaddress": {
    "Description": "Get the number of coins received by a Base58 address associated with the currently loaded wallet.",
    "Parameters": [
        "address - The Base58 address associated with the current wallet."
    ],
    "Return Value": "The balance received from the incoming address (BTC)."
},
"gettransaction": {
    "Description": "Get the transaction associated with a given transaction hash.",
    "Parameters": [
        "txHash - A hex string representing the block to obtain."
    ],
    "Return Value": "A dictionary listing information on the desired transaction, or empty if the transaction wasn't found."
},
"gettxout": {
    "Description": "Get the TxOut entries for a given transaction hash.",
    "Parameters": [
        "txHash - A string representing the hex value of a transaction ID.",
        "n - The TxOut index to obtain.",
        "binary - (Default=0) Indicates whether or not the resultant binary script should be in binary form or converted to a hex string."
    ],
    "Return Value": "A dictionary with the Bitcoin amount for the TxOut and the TxOut script in hex string form (default) or binary form."
},
"getwalletinfo": {
    "Description": "Get information on the currently loaded wallet.",
    "Parameters": [
        "inWltID - (Default=None) If used, armoryd will get info for the wallet for the provided Base58 wallet ID instead of the current wallet."
    ],
    "Return Value": "A dictionary with information on the current wallet."
},
"help": {
    "Description": "Get a directionary with all functions the armoryd server can run.",
    "Parameters": [
        "None"
    ],
    "Return Value": "A dictionary with all functions available on the armoryd server, along with the function parameters and function return value."
},
"importprivkey": {
    "Description": "Import a private key into the current wallet.",
    "Parameters": [
        "privKey - A private key in any format supported by Armory, including Base58 private keys supported by bitcoind (uncompressed public key support only)."
    ],
    "Return Value": "A string of the private key's accompanying hexadecimal public key."
},
"listaddrunspent": {
    "Description": "Get a list of unspent transactions for the currently loaded wallet that are associated with a given, comma-separated list of Base58 addresses from the wallet. By default, zero-conf UTXOs are included.",
    "Parameters": [
        "inB58 - The Base58 address to check against the current wallet."
    ],
    "Return Value": "A dictionary containing all UTXOs for the currently loaded wallet associated with the given Base58 address, along with information about each UTXO."
},
"listloadedlockboxes": {
    "Description": "List all lockboxes loaded onto the armoryd server.",
    "Parameters": [
        "None"
    ],
    "Return Value": "A dictionary with the Base58 values of all lockboxes loaded in armoryd."
},
"listloadedwallets": {
    "Description": "List all wallets loaded onto the armoryd server.",
    "Parameters": [
        "None"
    ],
    "Return Value": "A dictionary with the Base58 values of all wallets loaded in armoryd."
},
"listtransactions": {
    "Description": "List the transactions associated with the currently loaded wallet.",
    "Parameters": [
        "tx_count - (Default=10) The number of entries to get.",
        "from_tx - (Default=0) The first entry to get."
    ],
    "Return Value": "A dictionary with information on the retrieved transactions."
},
"listunspent": {
    "Description": "Get a list of unspent transactions for the currently loaded wallet. By default, zero-conf UTXOs are included.",
    "Parameters": [
        "None"
    ],
    "Return Value": "A dictionary listing information about each UTXO in the currently loaded wallet. The dictionary is similar to the one returned by the bitcoind call of the same name."
},
"receivedfromaddress": {
    "Description": "Return the number of coins received from a particular sender.",
    "Parameters": [
        "sender - Base58 address of the sender to the current wallet."
    ],
    "Return Value": "Number of Bitcoins sent by the sender to the current wallet."
},
"receivedfromsigner": {
    "Description": "Verify that a message (RFC 2440: clearsign or Base64) has been signed by a Bitcoin address and get the amount of coins sent to the current wallet by the message's signer.",
    "Parameters": [
        "sigBlock - Message with the RFC 2440 message to be verified. The message must be enclosed in quotation marks."
    ],
    "Return Value": "A dictionary with verified message and the amount of money sent to the current wallet by the signer."
},
"relockwallet": {
    "Description": "Re-lock a wallet.",
    "Parameters": [
        "None"
    ],
    "Return Value": "A string indicating whether or not the wallet is locked."
},
"sendlockbox": {
    "Description": "E-mail ASCII-encoded lockboxes to recipients.",
    "Parameters": [
        "lbIDs - A colon-delineated list of Base58 IDs of lockboxes to send to an email recipient.",
        "sender - The email address of the sender.",
        "server - The SMTP email server.",
        "pwd - The email account password.",
        "recips - The recipient or, if the string is delineated by a colon, a list of recipients.",
        "msgSubj - (Default=Armory Lockbox) The email subject."
    ],
    "Return Value": "A string indicating whether or not the attempt to send was successful."
},
"setactivelockbox": {
    "Description": "Set the currently active lockbox to one already loaded on the armoryd server.",
    "Parameters": [
        "newIDB58 - The Base58 ID of the lockbox to be made active."
    ],
    "Return Value": "A string indicating whether or not the lockbox was set as desired."
},
"setactivewallet": {
    "Description": "Set the currently active wallet to one already loaded on the armoryd server.",
    "Parameters": [
        "newIDB58 - The Base58 ID of the wallet to be made active."
    ],
    "Return Value": "A string indicating whether or not the wallet was set as desired."
},
"setaddressmetadata": {
    "Description": "Set armoryd-specific metadata associated with Base58 addresses.",
    "Parameters": [
        "newAddressMetaData - A dictionary containing arbitrary metadata to attach to Base58 addresses listed with the metadata."
    ],
    "Return Value": "None"
},
"signasciitransaction": {
    "Description": "Sign an unsigned transaction and get the signed ASCII data.",
    "Parameters": [
        "unsignedTxASCII - An ASCII-formatted unsigned transaction, like the one used by Armory for offline transactions.",
        "wltPasswd - (Default=None) If needed, the current wallet's password."
    ],
    "Return Value": "A dictionary containing a string with the ASCII-formatted signed transaction or, if the signing failed, a string indicating failure."
},
"unlockwallet": {
    "Description": "Unlock a wallet with a given passphrase and unlock time length.",
    "Parameters": [
        "passphrase - The wallet's current passphrase.",
        "timeout - (Default=10) The time, in seconds, that the wallet will be unlocked."
    ],
    "Return Value": "A string indicating if the wallet was unlocked or if it was already unlocked."
},
"verifysignature": {
    "Description": "Take a message (RFC 2440: clearsign or Base64) signed by a Bitcoin address and verify the message.",
    "Parameters": [
        "sigBlock - Message with the RFC 2440 message to be verified. The message must be enclosed in quotation marks."
    ],
    "Return Value": "A dictionary with verified message and the Base58 address of the signer."
},
"watchwallet": {
    "Description": "Send an e-mail notification when the current wallet spends money.",
    "Parameters": [
        "send_from - The email address of the sender.",
        "smtpServer - (Default=None) The SMTP email server.",
        "password - (Default=None) The email account password.",
        "send_to - (Default=None) The recipient or, if the string is delineated by a colon, a list of recipients.",
        "subject - (Default=None) The email subject.",
        "watchCmd - (Default=add) A string indicating if emails from the sender should be sent or, if set to \"remove\", emails from the sender that are currently being sent should be stopped."
    ],
    "Return Value": "None"
}
}

Source: armoryd.README in the install folder


How would you create child pay for parent in bitcoind-cli I have unconfirmed transactions in my bitcoind wallet. Some of the are mine and some are incoming third party transactions.
I want to speed up their confirmation by creating CHPFP transaction - spending unconfirmed inputs in one transaction with substantial fee. This would make mining unconfirmed inputs profitable. This is possible in electrum wallet.
How should i do it in bitcoind ? I suppose i should use sendtoaddress, but this will not use third party unconfirmed inputs and even change returns reported by spendable are ignored and bitcoind respond with "insufficient balance"
is there any setting or config, which would enable this ?

CPFP - Child Pays For Parent
Child transaction that spends unconfirmed output of parent transaction. Child transaction uses a higher fee rate, prioritized by miners, however it is dependent on other transaction (parent) so both are included in the same block.
Example:
Parent tx: https://blockstream.info/testnet/tx/1fe69c98608653dd129c0abc42324aca8d9fe463235c79c4a293e88eb29273cb
Child tx: https://blockstream.info/testnet/tx/fc07a13c4b919496efbdd5e62b57b9fe6e4080ed43c52a678bab30fe9e195d8e
I used the below commands in bitcoin core to do this:

getnewaddress to get new address. Sent 0.011 BTC to the address in Parent tx mentioned above.

getnewaddress get one more address for Child tx: tb1qazka5ds83ad4nz5qxxgz0dar59hpuradd4xwzj

listunspent 0 0 "[\"tb1qrldlrqajfwujwqfxcgeyrq90q5gw6uw9ge5xm6\"]"

Create a raw transaction to send 0.01 BTC to the address I got from Step 2 and 0.001 fee for the transaction (915.3 sat/vB)

createrawtransaction "[{\"txid\":\"1fe69c98608653dd129c0abc42324aca8d9fe463235c79c4a293e88eb29273cb\",\"vout\":1}]" "[{\"tb1qazka5ds83ad4nz5qxxgz0dar59hpuradd4xwzj\":0.01}]"

Sign transaction

signrawtransactionwithwallet 0200000001cb7392b28ee893a2c4795c2363e49f8dca4a3242bc0a9c12dd538660989ce61f0100000000ffffffff0140420f0000000000160014e8adda36078f5b598a80319027b7a3a16e1e0fad00000000

Broadcast transaction

sendrawtransaction 02000000000101cb7392b28ee893a2c4795c2363e49f8dca4a3242bc0a9c12dd538660989ce61f0100000000ffffffff0140420f0000000000160014e8adda36078f5b598a80319027b7a3a16e1e0fad0247304402203039e3673a8681a3625e38a7980cd9c17f4ee15acac07f60b8d055f9d495eb4a02204da56bec7b8c668bf57ebd082668e9af7fdb92d8cae7c5e9797919b177808c65012102ef547994e2371acbcf6300c343085ad9eee13edfdd00b52bc051006aa8b89d0400000000
Both transactions got confirmed in block 1865124


Is a low difficulty insecure? Please ignore the connection between difficulty & creation rates for the purposes of this question.

Can a difficulty be set so low that the security of transactions is compromised?  In other words, if a difficulty is set too low, can malicious miners forge transactions?

If so, what number is "too low", and how is it determined?

A low difficulty is only insecure if the malicious miners have a combined hash power much greater than the difficulty level.  The difficulty level is adjusted up or down every 2 weeks so that a new block continues to be found approximately every 10 minutes.  So, to forge transactions, a large percentage of the current miners would need to stop mining in order to get the difficulty level to drop.  Then the malicious miners could jump in and create bogus transactions assuming they controlled enough hash power to make their blockchain the accepted one.


Would a Schnorr PubKey be a different length than a Taproot PubKey like P2WPKH and P2WSH? A P2WPKH PubKey is shorter than a P2WSH PubKey. Would this also be the case that a Taproot PubKey is larger than a Schnorr PubKey?
If so, wouldn't people be incentivised to use the Schnorr PubKey and as a result Taproot would be less fungible?

A P2WPKH PubKey is shorter than a P2WSH PubKey.

No, not quite. A P2WPKH address is shorter than a P2WSH address. The addresses are both based on a hash of the underlying witness program (i.e. the locking conditions of the output). In the case of Pay to Witness Public Key Hash (P2WPKH) the witness program contains only the public key. On the other hand, Pay to Witness Script Hash (P2WSH) doesn't have a public key, its witness program consists of a witness script. P2WPKH and P2WSH addresses differ in length, because the hash for P2WPKH is a RIPEMD-160 hash which produces a digest of 20 byte (160 bit), while the hash for P2WSH is a SHA-256d hash which produces a 32 byte (256 bit) digest. Thus, the address for P2WSH simply has to encode 12 bytes more data and is that much longer.
Regarding Taproot and Schnorr, the outputs are actually indistinguishable, either commits the funds to a public key. In fact, if the spender doesn't make use of a script path (one of the scripts in a leaf of the tree), but spends the output using the key path, they remain indistinguishable even at spending time.
So, all segwit v1 outputs are always the same length, while the inputs may differ in size depending on how they got spent. They aren't categorized as two different output types, they are all categorized as Pay to Taproot (P2TR). Since the encoding used for public keys in P2TR is also 32 bytes, P2TR outputs end up being the same length as P2WSH outputs: 43 bytes.


How does one know they solved a block? Having the difficulty (either in the "bits" form, big integer form, or human-readable format) and a given block hash, how does one know if they solved that block? What is the formula or algorithm for checking it?

(The question might seem trivial, but it does not seem to be described explicitly on the SE or the Wiki)

Assuming everything else in the block is valid, the block hash simply needs to be smaller than the target. https://en.bitcoin.it/wiki/Difficulty explains how to find the target from the bits representation; and to find it from the human-readable difficulty D, you calculate 2^208*(2^16-1)/D.


How to build a web site on which clients can send and receive bitcoins without an account? I've been asked to write a gambling website using bitcoins. The gambling part is easy but I found out about bitcoins only yesterday. I've been following the links and reading but I'm buried in technical jargon; like block chain, wallets, mining etc.

I just want to know the following things.

What does the website need to hold bitcoins?
What does the website need to request funds from player?
How to transfer funds from player to website?
What does the website need to give out funds to player?
How to transfer funds from website to player?

I'd like to know the answers to be as specific as possible, even code level.
Oh, a requirement is not need to open an account on my website or using any payment gateway.

Thank you all in advance.
Moe

A payment gateway may have restrictions on the type of business category, and online gambling may be a category they don't support.

The process is pretty simply.

Supply a new address for each deposit.  When a payment arrives to that deposit address the customer account is credited.

A payment is considered final, generally, once it has six confirmations.  That may be a long time for a customer (an hour, or longer even) -- some sites use one, or three confirmations but then have withdrawal restrictions so that newly deposited funds are not withdrawn until the original deposited funds have six confirmations.

But this business deals with money. Any business that deals with money, whether dollars, euro, gold, or bitcoin, should not be operated without giving appropriate attention to the factors that require attention.  With Bitcoin being a non-reversable payments system, IT Security becomes among the most important areas of the business.

Learning how to construct a payment transaction (sendtoaddress using bitconid) or receiving a payment (poll bitcoind using listtransactions, or -walletnotify) should be your last concern at this point.  Figuring out how to manage a wallet, using a cold wallet and hot wallet, for example, and making sure you have backups, etc., are a higher priority.

This experience might be something you hire out for rather than solicit from a Q&A site.


Bitcoin node and sending transaction Is there any bitcoin free full node (both mainnet and testnet) available online that i can make use of like infura for ethereum? This is because i do not intend to host my own node.

Also which javascript library for bitcoin can be used for generate wallet and sending transaction?

You can use this libs for your purposes:

https://github.com/bitpay/bitcore-lib

https://github.com/bitpay/bitcore-explorers

And you dont need a node =)


How can Electrum restore a wallet? I've some questions about the technique of storing and restoring a wallet using Electrum.

I found out that Electrum stored a file on my PC. This file has my wallet's name so I think this file contains my bitcoins. If I deleted this file, my money will be lost forever, Am I right?
I have 12 words (The seed). Will those words restore the file if it is deleted? Or Are they just used to restore password?
What are all the things that I need to restore my wallet? (Eg. the file, the seed, the password, private keys, ... etc)

Thank you so much,

1)2)
Electrum uses so called "Deterministic wallets". In short this basically means that your entire wallet can be recovered using the seed.

Even if you delete the wallet file/ have no private keys, the seed will give you full access.

3) Either every private key of each adress that you used, or the seed.


How does the Smart Contracts work in a blockchain I am relatively new to blockchain technology, and my only knowledge is relative to the way bitcoin blockchain works. I know it is based on mining and and transfer of value that gets scarce whenever more bitcoins get mined.

Next I got into the blockchain technology as a standalone technology away from the finance field of cryptocurrency. I found out about the usefulness of the unique tokens and how to link digital assets to these tokens.

One of the biggest adding to blockchain is the smart contacts which by my knowledge are contracts that don't require third parties as brokers.

The problem is that I still can't figure out how do these smart contracts integrate into blockchain technology. Any help? is there any concrete exemple I can read about ?

Thank you !

when it comes to bitcoin world, smart contracts are usually some kind of escrow service. A good reference is in the book from Andreas: "Mastering Bitcoin". Both editions can be found in the net. The second edition has chapter "7. Advanced Transactions and Scripting". It explains the use of multisig, escrow, timelocks and more.

When you say integration in blockchain technology, then in this case it is bitcoin and its scripting. One of the several use case examples from the book is this:

  ... The participants in the multisig scheme are Mohammed, his two
  partners Saeed and Zaira, and their company lawyer Abdul. The three
  partners make decisions based on a majority rule, so two of the three
  must agree. However, in the case of a problem with their keys, they
  want their lawyer to be able to recover the funds with one of the
  three partner signatures. Finally, if all partners are unavailable or
  incapacitated for a while, they want the lawyer to be able to manage
  the account directly.

I would also like to mention, that the logic behind these scripts is the secret to the lightning network.
Have a good reading :-)


Using Ufasoft miner with 50BTC So I decided to take a look at this bitcoin stuff. I would like to test Ufasoft for CPU mining. Don't really care about performance.

There is this nice guide: https://50btc.com/en/articles/view/68

And I follow the steps:

Download http://ufasoft.com/open/bitcoin/
Install it
Run "%ProgramFiles%\Ufasoft\Coin\coin-miner.exe"-u you@email.com -o http://pool.50btc.com:8332

After running that, well, the command line stays there, with no feedback whatsoever. I can't type anything on it so I guess it is indeed doing something.

Anyway, out of curiosity I check out the activity monitor, and the CPU usage is almost always at 1% or 2%. Sometimes it may suddenly pick to 5%.

I was under the impression that CPU mining would cause some sort of greater spike, so I'm not sure if the miner is actually doing something.

It then ocurred to me to, of course, check out the 50BTC dashboard.

I have a worker, whose name is the same as my account name (which is the email address I used to startup the miner), so I guess this worker is the one that should be showing some sort of feedback. However, it says it is "offline", so it seems like, after all, the miner is indeed doing nothing.

Normally I'd just go on and try another miner, but I'd like to solve this anyway.

What have I done wrong?

I'm on Windows 7 with 4 cores. GPU mining has worked fine with software such as BitMinter in the past.

Check your internet connection, make sure your mining device connected right, restart your devices.


How to retrieve Bitcoin transfer unconfirmed for 10 days I’m very new to Bitcoin. I had Bitcoin sent to wallet on Bitcoin.com and then sent to wallet in cash app that I am familiar with. After 12 days it still says unconfirmed and pending. Is there a way to resend and pay higher fee or what can I do to have access and be able to cash in and use money? Please help!!

My first recommendation is for you to never use bitcoin.com.  This is a scammy site which attempts to trick new users into thinking that something called "bitcoin cash" or the ticker "bch" is bitcoin. Which it is not.
But luckily the bitcoin that you bought is the real bitcoin (often referred to as btc)
By now, your transaction has probably confirmed and already reached your wallet since the activity on the network has calmed down now over the weekend.
If not, it is usually possible to use something called "Replace By Fee" or "RBF", which increases the fee that you pay for your transaction so that it will get included in a block, and thus reach your faster.
If you are interested, consider to visit bitcoin.org to find out all the details about how to install your own bitcoin node and wallet in order to increase your security and not need to trust Cashapp for holding your funds.


How do I pay for something anonymously from the UK using bitcoins? I've seen the following guide but it's no good as I can't use bitinstant from the UK. Can someone recommend an alternative?

Step 1.
Download and install TOR

Step 2.
While using TOR create a Tormail account
You can confirm the address at http://tormail.org/

Step 3.
While using TOR, visit http://www.bitinstant.com

Step 4.
Choose the Cash deposit to Bitcoin to email option.

Step 5.
Follow the instructions on Bitinstant to make your cash deposit, and have your Bitcoins sent to your new Tormail account.
No ID is needed.

Step 6.
Receive your Bitcoins via email.

Buying coins non-anonymously in the UK:
Transferwise to Bitstamp's European account - £1 transfer fee, then <0.5% commission to buy.

Spending:
I guess you would use a mixer service


Are big miners a threat for Bitcoin? According to this graph, the biggest miner is so big that combined with two of the three runners-up they would have more than 50% of the hashing power.

Is that to be considered a threat to the bitcoin network?

As others have mentioned, those are mining pools, not miners.

Large mining pools provide the benefit of allowing small miners to earn more regular income, which encourages participation in bitcoin mining and strengthens the bitcoin network.

They are also a threat because they can be hijacked or DDOSed by a party wishing to do a >50% attack.

A temporary >50% attacking from a large pool being taken over by a hacker or DDOSed is a much smaller threat to bitcoin than a party acquiring more than 50% of the network hash-rate through their own hardware and being able to conduct a permanent/long-term >50% attack, so mining pools, by increasing the contribution of honest miners to the network hashing rate, benefit bitcoin more than they threaten it.

Features could theoretically be incorporated into mining software to reduce the threat of hijacking and DDOS attacks too, like automatically switching a mining machine to a different pool if the mining software detects previously confirmed blocks becoming unconfirmed or the mining pool becomes unavailable, respectively.


Why does importmulti not support zpub and ypub? As far as I can tell importmulti does not work with zpub/ypub.

Why not?

FWIW I prefer only to deal with xpubs, but I am curious.

The "xpub" format was defined by BIP32. It's a standard that specifies how to derive public keys from master public keys and seeds. Parts of it are widely adopted, some parts aren't. However, it does not say anything about how the keys it generate should be turned into addresses, only the keys themselves.

Now, at the time, there was only really one obvious way of turning a key into an addresses: by using its hash in a P2PKH (1...) address. This was implemented by numerous pieces of software, which more often than not treated "importing an xpub" as "importing an xpub and watching all P2PKH addresses for the resulting keys". This made sense, because it was how everyone wanted to use them anyway.

Then came along Segwit, which introduced two new common ways of paying to single-key outputs. Wallet software needed a way to "mark" an xpub as being intended to be used for P2WPKH (bc1...) or P2SH-P2WPKH (3...), instead of the traditional P2PKH. As the xpub standard had become interpreted as P2PKH only (rather than an address-agnostic way of describing public keys), something other than xpubs were needed. This is why some people adopted ypub/zpub for this purpose.

I believe this is confusing, as it is unclear now what an xpub means, and it is not scalable: we can't keep inventing new xpub-like formats for all types of addresses that may be invented. Especially with the introduction of multisig and more complex constructions, which simply don't fit into a single xpub-like thing (because you'll need to combine multiple of them).

For this reason, Bitcoin Core is using (and further developing) an approach called Output Descriptors. These are strings that specify exactly and unambiguously what scripts/addresses are desired, based on the involved public keys. These expressions support xpubs, but only in the original address-neutral meaning - the rest is conveyed using functions on top of them. For example:

pkh(xpub.../44'/0'/0'/0/*) would describe the BIP44 addresses derived from a particular xpub (P2PKH).
sh(wpkh(xpub.../49'/0'/0/*)) would describe the BIP49 addresses derived from a particular xpub (P2SH-P2WPKH).
wsh(multi(2,xpub1.../*,xpub2.../*,xpub3.../*)) represents a 2-of-3 P2WSH-embedded multisig.

There are many more features in descriptors, and there is ongoing development.

Disclaimer: I'm the author of BIP32.


What is Bitcoin Gold? There have been a lot of discussions about bitcoin-gold. What is it? I couldn't find an official website or something?

Bitcoin Gold is a new hard fork planned by Jack Liao (CEO of LightningASIC), that will happen on October 25. It's main aim is to decentralize mining by changing the Proof-of-Work algorithm to ZCash's Equihash algorithm, and they promise it'll switch to a different PoW when ASICs are launched.

Its addresses will start with G (P2PKH) or A (P2SH), and it has replay protection. Source

The official website is bitcoingold.org

Also These can be used to contact them:

https://github.com/BTCGPU/BTCGPU
https://twitter.com/btcgpu


Bitcoin RPC RegTest not validating addresses I am attempting to use Bitcoin RPC in regtest mode, however, when I try to validate a bitcoin address with the following function

public function validateAddress($address)
{
    $command = new \Nbobtc\Command\Command('validateaddress', [$address]);
    $response = $this->client->sendCommand($command);
    $contents = $response->getBody()->getContents();

    return $contents;
}

it returns...

Array ( [result] => Array ( [isvalid] => ) [error] => [id] => )

Any ideas why the isvalid value is missing?

I could have sworn this was working a day or two ago...

You may be trying to validate a mainnet address on a testnet/regtest client.

For the benefit of others:

<?php

require '/tmp/vendor/autoload.php';

$command = new \Nbobtc\Command\Command('getinfo');
$client  = new \Nbobtc\Http\Client('http://username:password@localhost:18332');

# legacy testnet address
#$address = "mvM368BXwRNx4HcYdL8XbU8hAX274gMKcq";
# bech32 address
#$address = "2Mzm5MPhGWTxNcZPGfpW7URR4mASKzsCZ3k";
# mainnet address
$address = "1KJFgSXpPvUthy3a7NxyM66szTkqHabpYB";

$command = new \Nbobtc\Command\Command('validateaddress', [$address]);
$response = $client->sendCommand($command);
$contents = $response->getBody()->getContents();

echo $contents;
?>

I observe that bitcoin 0.18.1 will return as OP describes when attempting to validate a mainnet address on a testnet/regtest client, and return correct details otherwise.

If not, could you edit in to your question the actual address and the bitcoin.conf you're using.

Edit: I notice there IS a difference. I'm getting
{"result":{"isvalid":false},"error":null,"id":null}
vs OP getting
Array ( [result] => Array ( [isvalid] => ) [error] => [id] => )
Perhaps there is some post-processing you're doing to $contents that is losing the value?


I'm worried I have lost my BTC from sending on my BTC Core 0.13.2 wallet I would truly appreciate anyone's help.
I have a BTC core wallet, it's 2 years behind on the blockchain update.
I previously sent a couple of test sends for 0.01 BTC each quite a while ago, end of 2017 and mid 2018. These were seemingly lost as I can't find anything relating to them. I likely used too low a mining fee that I had nominated, being clueless.
In any case, just yesterday I tried to transfer the balance of my wallet with the "recommended" settings of my wallet for the mining fee, and now I can't find anything and fear the coins all lost, as they don't turn up on any blockchain search (or even the boost thing at https://www.viabtc.com/tools/txaccelerator) that I can find. Also Nexo, the org behind the receiving wallet, cannot help me as they just don't know since the transaction hash produces nothing for them.
These are the three transactions:
[all hashes and addresses below removed now since I have solved things, leaving just the label on what was there]
3.
0.198 btc  - yesterday  3/18/2021 19:59
label
hash
to account #
1
(label )  5/7/2018 16:32 tried to send 0.01 BTC
hash
to
wallet
2
(label) 6/8/2018 15:55 tried to send 0.01 BTC
hash
to
address
The wallet started with 0.2 sent to it in Dec 2017.
Thanks in advance to anyone that might be able to help. My heart is coming out my mouth...
Thank you
michael
[will write solution to this shortly...]

I think I am all good. Thanks Pieter for your input, maybe that is so. but I was worried as  none of the web blockchain transaction displayers showed a thing, but core was happy to display all funds gone. So I think it was just not getting out at all with Bitcoin Core, even though it was providing the "not found" (by blockchain etc) hashes of transactions.
I started a (Kleopatra verified!) Electrum wallet. This seems to be a Godsend. So much nicer to use, and no waiting for the blockchain. More data at the fingertips, specify fiat, it knows your capital gain, etc. etc.
Yes, I know the blockchain on your own device is the most robust way of handling your BTC but, oh the wait! The size! The stress (in my case)! The money lost whilst waiting for that chain to download the first time I bought in 2017 (which I didn't know at the time but I don't think I had to do. I could have bought 6 months before the peak, instead of the 2017 peak). The recent repartitioning / merging of hard drives and moving & deleting that had to go on to handle 300 Gb+ of chain... The many hours left on overnight even to catch up from 2015 onwards (when used in 2017-18 I had downloaded the whole chain but for some reason I lost a whole batch when I tuned back into crypto now things are moving again.) Overall, the headache of the locally held chain for me is something, as a newbie, I could have really done without (not to mention the sleepless night last night!)
Electrum took my private key and automatically acknowledged the full 0.2 BTC. I then made a transaction and for whatever reason I could see much better the satoshi per byte level and compare it with https://bitcoinfees.earn.com/#fees to make sure there was plenty enough to get it moving with the miners. Now the transaction is in progress and it's confirmed three times so far... a few more and it will be where I need it.
In the end the solution was so simple, I'm very disappointed in the staff at the 'exchange' who didn't know more to give me the tip. You think if you did this stuff all day you would at least have a clue about core wallets and potential problems/fixes. Another hardware data recovery mob that I spoke to here in Australia said that they often had people calling up with similar requests, but they couldn't help either, citing "some USA companies are beginning to get into this sort of recovery."
If there's any further problem I'll add it here, but otherwise assume happy endings (SFW) from one bitcoin 'newbie' that was scared witless he'd lost about 15 grand Aussie about half a day ago thru to now.
--Wow that was fast, 7 confirmations and my money is in the right spot. Phew! Hope this helps anyone in a similar space.


How can government "seize" bitcoins? Last year the U.S. Department of Justice posted this press release claiming U.S. "law enforcement seized several thousand Bitcoins on November 3, 2020."
How is it possible for anyone to "seize" BTC?
My understanding is that it is technically impossible to transfer BTC without the private key for the wallet holding BTC.  And likewise that anyone with the private key can transfer the BTC if they can transmit the transaction.  I.e., short of coercing whoever has the private key to disclose it, is it true that no amount of force or authority can cause or prevent the transfer of any particular BTC?
Or am I missing something?

It is not necessarily true that no amount of force or authority can cause or prevent any transfer of Bitcoin. The protocol does not allow arbitrary seizures or blocking, but there are still human factors involved.
Bitcoin is decentralized, so there is no central authority that governments can go to (or coerce) to force or disallow transactions. However Bitcoin is still owned by people, and people can be forced to perform certain actions that they do not necessarily want to do. While a government cannot command the Bitcoin network to make a transaction to happen, they can go to a particular individual who owns Bitcoin and coerce them to make a transaction
Furthermore, governments often have the power to arbitrarily seize assets owned by people. They can do this by force and physically taking things away. This is often how Bitcoin is seized - the hardware that contains the private keys is physically taken by the government. Once they have access to the private keys, the government can perform any transactions that they wish. There is nothing that Bitcoin can do to prevent this; it is up to the individual to ensure the security of their private keys.

For disallowing transactions, this is much harder. However, as before, there is still a human factor involved. In this case, it's miners who produce blocks. A government could mandate that miners operating in their jurisdiction are not allowed to create blocks containing certain transactions. If all miners were to follow such mandates, then a transaction could remain unconfirmed indefinitely and thus be effectively disallowed.
However this is much harder to do. The decentralized nature of mining means that miners who are in other jurisdictions that do not require censoring certain transactions can mine those transactions. Furthermore, miners who can protect their anonymity and are willing to break some laws can mine those censored transactions too.
Even if no current miner is willing to mine a censored transaction because their governments threaten them, more people could simply begin to mine who do not necessarily follow the same censorship requirements. Mining being decentralized allows anyone to be a miner, albeit at a high initial cost currently. Governments could also try to snuff out the non-censoring miners through force, possibly through seizure or destruction of mining hardware. But even so, people will still be able to mine, and there will inevitably be some miner out there who is willing to make a block that includes a transaction censored by every other miner. So in the end, it really is not possible to disallow a transaction.


Generating bitcoin wallets for my customers I run an application written in PHP and need to add the option to buy services with bitcoins.
So, for each user i need to generate a unique, unused bitcoin address.

I could generate X number wallets with Electrum and assing 1 address to each user, but then i will have to check manually if someone send a payment, match the address with the user, wait for confirmations, import data, update the balance, every day.
This take too much time and it's tricky.

What's the best and easier approach to achieve this? from where i start?
Using external api and services is not a choice, using a single shared wallet can be okay but how i associate user/transaction?

You can do this easily using bitcoincore. Brief overview of process (Source: bitcointalk thread)

Generate unique address using getnewaddress
Register on walletnotify to get txid as notification
Call gettransaction with txid from step 2 to get details/address of payment received


My Bitcoin wallet is out of sync after connecting for the first time It's 4 years out of date. I have tried using a different network. Same thing. Don't know what to do but would appreciate help.

The official Bitcoin software has to download the details of every single address, transaction and confirmation block to be synchronised. If you've just installed it then it's going to take you 1-5 days to download that data depending on your Internet and computer speed (just leave it running on your computer).

There are other options to avoid this but as a rule of thumb it's more secure to use a "full client" such as the official software. Once it has sync'd every time you use it after that it will only need to sync the data since it last sync'd so is much, much quicker.


what is exact meaning of some field of response of `getBlock` rpc api I refer to this document for using getBlock rpc api.

https://bitcoin.org/en/developer-reference#getblock

{
  "hash" : "hash",     (string) the block hash (same as provided)
  "confirmations" : n,   (numeric) The number of confirmations, or -1 if the block is not on the main chain
  "size" : n,            (numeric) The block size
  "strippedsize" : n,    (numeric) The block size excluding witness data
  "weight" : n           (numeric) The block weight as defined in BIP 141
  "height" : n,          (numeric) The block height or index
  "version" : n,         (numeric) The block version
  "versionHex" : "00000000", (string) The block version formatted in hexadecimal
  "merkleroot" : "xxxx", (string) The merkle root
  "tx" : [               (array of string) The transaction ids
     "transactionid"     (string) The transaction id
     ,...
  ],
  "time" : ttt,          (numeric) The block time in seconds since epoch (Jan 1 1970 GMT)
  "mediantime" : ttt,    (numeric) The median block time in seconds since epoch (Jan 1 1970 GMT)
  "nonce" : n,           (numeric) The nonce
  "bits" : "1d00ffff", (string) The bits
  "difficulty" : x.xxx,  (numeric) The difficulty
  "chainwork" : "xxxx",  (string) Expected number of hashes required to produce the chain up to this block (in hex)
  "nTx" : n,             (numeric) The number of transactions in the block.
  "previousblockhash" : "hash",  (string) The hash of the previous block
  "nextblockhash" : "hash"       (string) The hash of the next block
}

I want to know meaning size and bits

What is size field mean?? block size as byte??
What is bits field mean?? block size as bits??

May I use chainwork diff for calculating hash power for each block?

According to this doc, https://bitcoin.org/en/developer-reference#getblock, chainwork means

 "chainwork": "xxxx"           (string) total amount of work in active chain, in hexadecimal

For example, let's assume that chainwork of block 12345 is 1111 and that of block 12344 is 1100.

Then may I consider that hash power for block 12345 is 11 since 1111 - 1100 is 11?

size refers to the size of the block, which is 80 bytes for the header + sum(tx_sizes). As pointed out in the comments, this includes the segwit data and is meant to match the actual, on disk size of the block.

bits refers to nBits, which encodes the target difficulty for the block. You can see an explanation of the encoding scheme here.

chainwork represents the sum total of the expected hashing operations required to product the chain up to this block - this means that you cannot use it for calculating the hash power for the current block, as it is the sum of all the hashing required to produce every block from the genesis block up until the current block.

In fact, you can never get a precise measurement of the active hash power based on a single block. However, there are ways to calculate the average/expected hash power on the network at a given point in time, as described in this question.


How do nodes come to consensus on whether a timestamp is valid? From bitcoin wiki:

  A timestamp is accepted as valid if it is greater than the median timestamp of previous 11 blocks, and less than the network-adjusted time + 2 hours.

If a miner submits a block timestamp on the cusp of the network-adjusted time + 2 hours threshold, some nodes will see the block as valid and some will see the block as invalid, regardless of the work done on the block. How do nodes come to consensus on whether the block is valid?

They don't need to.

If a block's timestamp is in the future, it won't be accepted - but it also won't be marked as invalid. Once enough time passes, the node will accept the block if it is offered or received again.

Effectively, the maximum limit on the timestamp is not a consensus rule, but just a temporary acceptance rule.


Can cryptocurrencies be liberated from the menace of exchanges? In my understanding the primary purpose of a cryptocurrency exchange is to let users trade traditional currency for some kind of crypto-coin. Most exchanges also allow provide storage and crypto-to-crypto trade.

But exchanges add centralization, they have questionable security and they can manipulate cryptocurrency prices at their will.

Can there be an alternative market structure for cryptocurrency that liberates us from evil exchanges?

There are decentralized exchanges that will launch soon such as Bisq or Coinffeine.


Is it possible to "send" Bitcoin to yourself (new wallet) without announcing it to the network and without paying any fee? I want to make clear that I've already performed said transactions, so I'm not asking this because I want to do it right now. I'm just curious.
Basically, I've spent a number of very sweaty and nervous days "rearranging" most of my coins so that they will finally end up in an encrypted cold storage wallet.dat, after having spent years fully unencrypted and regularly coming into contact with my main PC. Yes, I know it's insane, but I was not just lazy, but also seriously worried that I'd end up losing access to my coins by forgetting the passphrase. That's why I never did it.
Anyway, I've been forced to pay two Bitcoin transaction fees when sending the coins to myself twice. Although I probably would not have ended doing it if it's complicated/scary, is there some way that I could have just "transferred" the coins by, I don't know, typing some kind of private key dump command in the console of Bitcoin Core and then imported them into the new wallet or something?
Or is the only technical way to move funds between wallets to use the Bitcoin network and thus announce to the world that "somebody sent X BTC"?

The network comes to consensus on how much Bitcoin is held at individual addresses. If you want the network and the blockchain to recognize a certain amount of Bitcoin is held at a new address rather than an old one you can't avoid broadcasting a transaction and paying a fee. Of course there are offchain methods of transferring value like Lightning and Liquid between addresses but the Bitcoin blockchain does not know of these transfers.


Is the bit encoding format for the graphic in BIP 68 implicitly little-endian? CLTV (OP_CHECKLOCKTIMEVERIFY - absolute locktime) and CSV (OP_CHECKSEQUENCEVERIFY - relative locktime) utilize BIP 68. Is the locktime for those two operations implicitly encoded in little-endian format?

Byte swapping associated with endianess has a very serious impact on the semantics for lock types (i.e., absolute, relative) and locktime value units (i.e., block number, seconds). Would it be prudent/responsible for the BIP 68 Standard to make it clear whether the bit-encoding is natively little-endian or big-endian?

All fields in a Bitcoin transaction are little-endian encoded except for the signature fields and the public key fields which are both DER and big-endian encoded since they were originally produced by an external library that uses these encodings.

  Would it be prudent/responsible for the BIP 68 Standard to make it
  clear whether the bit-encoding is natively little-endian or
  big-endian?

I think this information belongs in the protocol documentation, not necessarily in the BIP.


How do I reconfigure Abe to work with Litecoin? I succesfully launced this image. But I need one more instance as Litecoin blockchain explorer. How to configure it properly? Docker is not necessary

I used this configuration to work with Litecoin

{
  "chain": "Litecoin",
  "code3": "LTC",
  "address_version": "\x00",
  "magic": "\xfb\xc0\xb6\xdb",
  "policy": "Sha256Chain"
}

Its now hitting block 1201593 without any crashes. But still observing.


What does it mean by "many different transactions tied to a particular bitcoin address" in this context? The context is on this section: “What if the input and output amounts don’t match?” of this page: http://www.coindesk.com/information/how-do-bitcoin-transactions-work/

I find it strange as it seems that reusing address is a bad practice (https://en.bitcoin.it/wiki/Address_reuse). (i.e. When Person A makes a transaction with Person B, then Person A makes a transaction with Person C, there should be two different addresses (instead of one) from Person A involved.) Or does the “address” here actually mean bitcoin wallet?

many different transactions tied to a particular bitcoin address

The sentence refers to the fact that the address can be involved in many different transactions. This is most likely seen with the address working as a receiving address, or destination address. For instance, imagine that you want to have an address posted in your personal website where you receive donations from people. It would be tedious to change it every time you receive a transaction.

As you already mentioned, reusing an address is not usually a good practice, since it could involve some privacy issues. By using a different address each time you perform a payment, you make it harder to link different bitcoin addresses owned by you (however, not impossible). By using always the same address when paying you make way easier for a third party to analyse your behaviour, based on where you are sending bitcoins.

Finally you should not mix up Bitcoin address with wallet. Think in a wallet as a collection of tools that let you manage your Bitcoin address (or addresses), such managing public/private keys to create transactions. What is said to be a bad practice in the Bitcoin wiki is referring to use the same Bitcoin address multiple times. The wallet is a collection of tools, the Bitcoin address will be more like an endpoint.


Blockchain.info: Is there a way to know if a transaction is confirmed or not? I'm using the Blockchain.info API to get info about addresses and transactions.
It seems to me that the transactions (txs) don't indicate if they are confirmed or not.
Is there a way to get this info, directly from the api or indirectly, calculating the status from other values present in the repsonse?

The rawtx endpoint has a field block_height. If this field has an integer value, then the transaction was confirmed in the block at that height. If it is null, then the transaction is still unconfirmed. You can use that to know if a transaction is confirmed via the blockchain.info api.


How to configure a bitcoind instance solely designed to contribute to the network? I'd like to run a headless bitcoind instance on a server, in order to contribute to the network. Are there any specific configuration options that are recommended for that purpose?

My intention was primarily to make the network more secure by providing one more "good" node, though since I'm not familiar with some of the maybe more subtle aspects of the protocol, I'd welcome advice on other ways a single node would or could contribute.

I was not necessarily planning to run a miner.

Generally speaking if you want to contribute you have two options:

Become a blockchain peer

The Bitcoin network requires the full chain to be available for download.  If not enough peers allow the full chain to be downloaded, this is a risk to the network.  This isn't CPU intensive but puts a small load on your network IO as a configurable number of peers download the data.

Namely you can run bitcoind  and allow inbound access to port 8333.  This will allow people to download the blockchain.  If you see options to run as a "server"  know this runs something different on port 8332 and is considered "sensitive" and should be secured.

I like to visually check on on the process so here is the command I run:

bitcoind -debug   -logtimestamps   -printtodebugger -printtoconsole

If your computer can handle it, edit the bitcoin.conf file (location is platform specific) to allow more people to simultaneously connect.  Edit maxconnections= to whatever you think is best.

Mine

There isn't much use in mining unless you have a FPGA, or ASIC for Bitcoin.  These rigs are more specialized and competitive.   Take a look at www.butterflylabs.com for an ASIC miner that can plug into your USB port


How does a node forget about other nodes? It is said that addr message: Provide information on known nodes of the network. Non-advertised nodes should be forgotten after typically 3 hours.

I did not totally understood what does it mean forgetting a node? A node has a list of peers, and it is checking every 3 hours if these peer are active? Does it work like this? How does this forgetting mechanism work?

There is no need for a node to "forget" a node. This is not something that is required nor necessary. What Bitcoin Core does in response to a getaddr message (so it sends an addr message) is that it checks its list of nodes. It filters through that list for the things that it recently had a connection to and that it didn't have multiple failed connections to before. There is no checking that a node is actually live and it doesn't do it on a set timer either.


Regtest: address is still at zero after sending some bitcoins I'm trying to send some btc to an address in Regtest mode:

the address where I want to send is: mjeoXvBnD4DtZumeSJEjNJfLb4RrhpbH1H

$  bitcoin-cli -regtest -rpcuser=bitcoinrpc -rpcpassword=Alice -rpcport=16591 sendtoaddress mjeoXvBnD4DtZumeSJEjNJfLb4RrhpbH1H 5.00
9caca4f88c6bf727f6e8599fc1012867561ff7ef34412ef1fc70457fadf08e0b

I generate a new block:

$  bitcoin-cli -regtest -rpcuser=bitcoinrpc -rpcpassword=Alice -rpcport=16591 generate 1
[
    "5851b3adfd810480e53fbb5dab1ce4967a50f072a5a7abe054f114839ea3501e"
]

Then, I check the amount of btc inside the address:

$  bitcoin-cli -regtest -rpcuser=bitcoinrpc -rpcpassword=Alice -rpcport=16591 getreceivedbyaddress mjeoXvBnD4DtZumeSJEjNJfLb4RrhpbH1H
0.00000000

Nevertheless the transaction is well listed on listtransactions:

$  bitcoin-cli -regtest -rpcuser=bitcoinrpc -rpcpassword=Alice -rpcport=16591 listtransactions
...
    {
        "account" : "",
        "address" : "mjeoXvBnD4DtZumeSJEjNJfLb4RrhpbH1H",
        "category" : "send",
        "amount" : -5.00000000,
        "vout" : 1,
        "fee" : -0.00001860,
        "confirmations" : 1,
        "blockhash" : "5851b3adfd810480e53fbb5dab1ce4967a50f072a5a7abe054f114839ea3501e",
        "blockindex" : 1,
        "blocktime" : 1452096896,
        "txid" : "9caca4f88c6bf727f6e8599fc1012867561ff7ef34412ef1fc70457fadf08e0b",
        "walletconflicts" : [
        ],
        "time" : 1452096887,
        "timereceived" : 1452096887
    },
...

Is there a problem with my address?

I've generated it thanks to pybitcointools , doing:

magickey = '111' # regtest mode

priv = random_key()

addr = privkey_to_address(priv, magickey)

Thanks a lot in advance

getreceivedbyaddress is only able to show the balance for the addresses in the account: it stores only UTXO for these. The addresses generated with Pybitcointools are not stored in the account (contrary to addresses generated with getnewaddress).

To get the balance of any address, a block explorer is needed, which scan ALL UTXOs of the blockchain (like blockexporer.com or blockchain.info).

And for Regtest, it's more complicated since a local server is needed like https://github.com/bitcoin-abe/bitcoin-abe.

Conclusion: I"ve finally switched to Testnet mode, for convenience.


Moving transfer help! I just got a bitcoin qt wallet today and I have already sent the money, it is taking to long to to though so if I dump my key and import it to an e-wallet like blockchain.info, will my coins still show up?

As long as the transaction is in the network (it has been transmitted without double spends), you can access your bitcoins with the private key from any client, be it Standard Client, blockchain.info or anything else. Your money is not stored in your wallet, but in the Bitcoin Network - only the private key that lets you access that money is stored in the wallet file.


bitcoind (JSON-RPC) returned HTTP 403 error, i don't know why I set up bitcoind in Ubuntu 14.04 and I requested "getinfo",
but returned HTTP 403 error "FORBIDDEN". I don't know why...

The environment is below..
・Ubuntu is installed in Virtualbox and bitcoind is installed in the Ubuntu.
・The Host OS is Mac OS.
・The Host OS and the gest OS (Ubuntu) is connected host only adapter.
  (Host OS -> 10.0.2.2  Gest OS-> 192.168.33.33)

The bitcoin.conf is below

  server=1

  daemon=1

  rpcallowip = 10.0.2.0/24

  rpcuser=...

  rpcpassword=...

  rpcport=8332

  txindex=1

  keypool=100

From the browser, type "http://rpcuser:rpcpassword@192.168.33.33:8332/"
but it gives "Forbidden"

Forthermore, i tried to use easybitcoin.php (https://github.com/aceat64/EasyBitcoin-PHP/blob/master/easybitcoin.php),
but also the same like "HTTP_FORBIDDEN" "403"

Can you give me any advices?

Your rpcallowip setting is 10.0.2.0, but you listed 10.0.2.2 as the host OS's IP. That could be your issue.


Good Bitcoin Mining Software? Does anyone know of any of the best Bitcoin Mining Software? I have been looking for mining software for a while, but I can't seem to find any. I'm using Windows 8 if that helps.

The only two that I know of are cgminer and bfgminer. Unless you have specialized mining equipment (read: ASICs) or mining on testnet, mining is not going to be a good idea.


Setting minimal amount of nodes to reach consensus Is the minimal amount/percentage of nodes that need to agree configurable in a blockchain genesis file?

As far as I can find there is no setting for this, and I assume this is set somewhere in the sourcecode?

That's not how consensus works in Bitcoin, as that would be highly vulnerable to a sybil attack.

First a full node validates all aspects of all blocks (incl. transactions) it receives. Anything invalid is discarded and not further considered.

Second the node picks the chain with the most total Proof of Work in it*.  Usually there's only one, but sometimes two miners find a block at roughly the same time, so the blockchain temporarily forks until the next block increases the total PoW for one of the chains and all nodes will converge on that chain.

TL;DR The valid chain with the most total Proof of Work

*) Often referred to as the "longest chain" or better "longest valid chain", although strictly it's not about the length, but about the aggregate difficulty.


What if all nodes on the lightning network were watchtowers by default? What would be the costs for forcing every node on the lightning network to provide watchtower services by default so that the burden is shared by other users maintaining the default and with consideration for relative value across the second-layer and for the rate at which users go offline? Could this work for lightning or other state channel networks? Why, or why not?

So, what if all nodes in state channels are arbiters/watchtowers by default, but the cost of computation to support watchtower service on the network for a node (or node pair/channels) depends on the cost of ‘need’ of that node to have state/in channel transactions backed up, which is relative in value to other nodes in the network and to the rate at which nodes fail in the network. State channel users may choose to not use watchtower services at all, use watch tower services but not support it for others in the network, in which case they pay watchtowers at a premium, or to both support ‘watching’ and establish state channels. Also, if the responsibility of ‘watching’ should have a reasonable level of redundancy over periods of time so as to relieve the burden of computation costs of all watchers... sorry

tl;dr - the first part up to ‘why or why not’^^;

Not sure if I get exactly what you are asking for. But some general remarks and thoughts should hopefully give you all the information you need to answer your question.

A watchtower basically needs  a copy of your channels state history. (a subset of the data will be sufficient but let's assume for simplicity that the watchtower needs an exact copy of the history of channel states)

Now the answer to your question depends.

If every watchtower is supposed to have the full history of every state channel on the network we would have a total storage requirement of O(V*E) with V being the number of nodes on the network and E the number of channels. And a single storage requirement of O(E). Unless the person is a supporter of some Bitcoin forks like bcash, one can easily see that this would never scale as the number grows linear with the amount of payments taking place in the lightning network. This it has a storage requirement in the same order of magnitude as storing all transactions in one public blockchain with really large blocks.

However we could say that it is sufficient for every node to be a watchtower of x other nodes. In this way on average (amortized) every lightning node should have a storage overhead of a factor x with comparison to the storage requirements for their own state channels.


Blockchain.info's blockcount API call giving error, alternatives? This URL today: https://blockchain.info/q/getblockcount

Was giving the error "Too many requests".

Any alternative out there to get the blockcount via an API? Thanks

Another public API I found for this:

https://blockexplorer.com/api/status?q=getBlockCount

But the best one so far, is blockR.io because it even has testnet support:

MainNet: http://btc.blockr.io/api/v1/coin/info

TestNet: http://tbtc.blockr.io/api/v1/coin/info


How do you determine if a transaction is unique? I originally thought one could determine whether a transaction is unique or not by its id. However, if you perform sendmany, then each of these transactions will share the same id, is that right? In this case, how would you go about determining if a transaction is unique?

Each transaction can have multiple inputs and multiple outputs.  sendmany is used when you want to send to many accounts.  It's all still one transaction.


Class action suit against Mt. Gox? This NY Times article says a Chicago law firm is representing Mt. Gox customers in a lawsuit against that company.  I had a small about of bitcoin in a Mt. Gox account.  The law firm has not contacted me to sign me up as a member of the class.  Would it be worthwhile to contact them in order to be included?

http://dealbook.nytimes.com/2014/03/05/plaintiffs-in-suit-seek-to-freeze-mt-goxs-u-s-assets/?_php=true&_type=blogs&_r=0

Normally class actions are opt out, not opt in.  That means you don't have to do anything if you want to be in the class.  But the decision as to whether it will be what they call "certified" as a class is probably a long way off.  If the court allows the class to be certified, they will then send notice to the class members giving you the chance to opt out of the class if you don't want to be in it.


Can Bitcoin be run in a shared hosting environment? Can bitcoind be installed and run on shared hosting? Has anyone successfully done this? If not why not.

bitcoind is a daemon, it needs a shell to run: a web host is definitely not enough.


Why are the BTC exchange rates different from website to website For instance here: http://bitcoinwatch.com/ one exchange lists the BTC-USD rate at 133, while the other one lists at 122.

Because MtGox is delaying USD withdrawals for several weeks so whoever wants to withdraw funds quickly has to do it buying Bitcoin and withdrawing in Bitcoin.
This creates a difference in prices.
The question is why people still keep depositing to MtGox? May be because MtGox still has the biggest trade volume in the world, or may be they are old deposits


Earliest block with spent coinbase What is the earliest block in the blockchain that has a spent coinbase? I have manually looked at the first dozen or so but they are all unspent.

The first transaction, Satoshi sending 10 BTC to Hal Finney, was recorded in block 170.


How do I know that my bitcoins are real I have bought some bitcoins off local bitcoins and stored them in an Electra wallet in my computer. Given that I have now paid hard cash, how am I to determine that these are real?

Enter your Bitcoin address (the one you were paid into) into a public blockchain browser such as https://blockchain.info/. That will show you the relevant entries in the global shared Bitcoin ledger, which confirms that you, as the holder of the private key for that address, are the owner of those funds.

If you lose control of your private key for any reason, then your bitcoins might not be yours for much longer.


Please take a look at my server print out to see if all looks well or if the repeating errors mean something is wrong So it is not clear to me if my bitcoin server is syncing and all is fine or if the "potential stale tip detected, will retry extra outbound " message means I have to do something. Searching for that string does not actually provide me an answer. I thought Bitcoin full node install would be a bit more intuitive. Any help appreciated

Solution Update:
My server was not connecting to peers because my ROUTER had a FILTER, set to medium, that was just allowing in some popular known ports. When I set it to Low, My server then started to see peers immediately. Just weird how the router chose to implement this firewall this way. It did not honor the fact that I forwarded the port.

The message

potential stale tip detected, will retry extra outbound peers

is associated with at least two situations:

A firewall is blocking port 8333 and your node cannot communicate with peers.
Problems with genesis block (delete blocks and chainstate directories and restart).


Specifying fee amount using bitcoinjs I'm currently playing with bitcoinjs (https://bitcoinjs.org/) and I'm creating offline transactions that I broadcast over the network after.

I've successfully create my first transaction using this : https://medium.com/@orweinberger/how-to-create-a-raw-transaction-using-bitcoinjs-lib-1347a502a3a

But it seems my transaction is stuck since I haven't put enough fee on it to get it mined.

How using a var tx = new bitcoin.TransactionBuilder(); can I set the fee to a certain amount ? Is this calculated using a default value ?

Thank you for your help !

The fee is the sum of unspent value in a Transaction.

Aka the value NOT SENT by your outputs.

  fee = in - out

For an example,  if we assume the input aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31, 0 has an unspent value of 15000...

var txb = new bitcoin.TransactionBuilder()
txb.addInput('aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31', 0)
txb.addOutput('1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK', 15000)

When we send 15000 to 1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK, the fee is the value of the inputs minus the value of outputs.

  in:15000 - out:15000 = fee:0

For a fee to be non-zero, in > out is required.


From https://en.bitcoin.it/wiki/Protocol_documentation#Transaction_Verification we learn :

Almost all integers are encoded in little endian. Only IP or port number are encoded big endian.

You should look at the https://en.m.wikipedia.org/wiki/Endianness and flip the order of the bitstring to have the bit at the correct position
Using an online hex converter like this one
https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ you can actually see that the hex interpreted as uint32 results to 1


What does it mean when a block is "kicked"? While mining on a NOMP mining pool, I noticed that when you add the confirmed blocks and pending blocks together, they rarely add up to the total blocks found. It is my understanding that the missing blocks were "kicked." What does it mean when a block is "kicked"?

The term seems to have been defined in this GitHub issue: https://github.com/zone117x/node-open-mining-portal/issues/138#issuecomment-42396180.

Kicked basically means orphaned one way or another. Apparently, the creator of this pool software was seeing some strange behavior in the way the daemon would report blocks as being orphaned, and decided to just call them all "kicked" blocks than to differentiate how they were orphaned.

If you are unsure what orphaned blocks are, look at this: What are orphaned and stale blocks?. Essentially they are solved blocks that are not accepted by the network, usually because a different block at the same height was solved at nearly the same time.


is Bitcoind -gen solo mining ? I am running "./bitcoind -daemon -gen" in my machine . Is it solo mining ? If so, what does it take to create 1 bitcoin ? When i run "./bitcoind getbalance" it is always 0.00000 .
"./bitecoind getmininginfo" results in:
{
    "blocks" : 319203,
    "currentblocksize" : 1000,
    "currentblocktx" : 0,
    "difficulty" : 68.59413778,
    "errors" : "",
    "generate" : true,
    "genproclimit" : -1,
    "hashespersec" : 1447,
    "networkhashps" : 2298081699,
    "pooledtx" : 0,
    "testnet" : false
}

Am i on right way ? If so, what does it take to create 1 coin ? Also, when i create a coin, how to send it to my address ? will it be automatically ?

Yes it's solo mining, and the difficulty is so large that you will never be able to find a block before the mining pools do. You have a better chance at winning a lottery than mining a block before big pools do.

So you will most likely never get any coins.


What percent of recently mined coins being actively traded vs saved? I'm trying to understand the recent increase in BTC value in relation to mining.  I am trying to answer the question

Are miners (with powerful ASIC hardware) saving the BTC, and not selling them, thereby reducing supply?
Has the demand increased beyond what has been mined?

That's the thing with a pseudonymous digital currency.

It is not knowable to you and me.  The larger pool operators might be able to look at their withdrawals to see if they are being re-spent but there's no way to tell definitively if the withdrawal was for a hosted (shared) EWallet (e.g., Mt. Gox) or to the miner's local wallet.

With ASIC hardware, the bulk of the production cost has already been spent to acquire the hardware.   Very little of the production cost will be electricity.   This varied from GPUs where the inverse was mostly true.

If miners are indebted they will be needing to sell their production to repay the debt.  It seems likely most ASIC purchases were not purchased with debt so it then seems likely most ASIC mining operators aren't really  being forced to sell their mined BTCs whatsoever.


Is tighting inputs to specific outputs possible within one transaction? For convenience purposes let's say I need to make these payments (and let's pretend that tx fees do not exist):

Address A: 1 BTC
Address B: 2 BTC
Address C: 3 BTC

My balance is 6 BTC that consists of these spendable inputs:

Tx1: 0.5 BTC
Tx2: 0.5 BTC
Tx3: 0.5 BTC
Tx4: 4.5 BTC

It's easy now to create a raw tx using createrawtransaction and since the inputs' sum matches the outputs' sum (and we pretend there are no tx fees whatsoever) everything will work as expected.

But what if I must (for business purposes) use specific inputs for each output?

An example would be:

Address A will be paid inputs: Tx1 and Tx3
Address B and Address C will be paid by inputs: Tx2 and Tx4

These will be batch payments and I plan to be sending batches of 20-30 logical payments per raw tx, so I would like to avoid breaking down the raw tx into small, atomic (per-logical-payments) transactions.

Is that even possible with raw transactions?

In Bitcoin, it is not possible to associate specific inputs with specific outputs within one transaction.

This means that you are required to create multiple transactions to achieve what you want to do.

This wiki article and this forum post explain how to do create raw transactions for spending specific outputs.


What is a bitcoin incoming transaction with value = 0.00000546? I wrote a script that downloads and parses blocks. I see a lot of incoming payments with value = 0.00000546. Any explanation?

Thanks!

This output value corresponds to the dust limit that is imposed on bitcoin transactions.

Many of these outputs may have been generated as a dust attack to de-anonymize users/ addresses.