Who controls Solidcoin's special millionaire accounts?

RealSolid controls those accounts. He claims that he has selected several trusted people to operate them, but we have no way to know if this is true or not.

There also seems to be a somewhat fundamental flaw in the reasoning. If we trust people because they have the most to lose, why should we trust people who have unspendable coins? Unspendable coins don't reflect having anything to lose at all.

It should also be pointed out that those with more than a million coins have complete control over the transactions included in the chain and who gets all of the mining rewards. They have merely to announce blocks in pairs -- everyone who doesn't control a million coins can be completely locked out by those who do.

Also, I think "the poor can trust the rich because they have the most to lose" fails the giggle test. (That is, you can't say it with a straight face, so it's probably not even close to true.)


What is Delegated Proof of Stake (DPoS)?

Important distinction of DPoS from PoS is that in DPoS, there is no minimum stakeholder token requirement to participate and instead of stakeholder tokens proportionately representing their ability to produce blocks, users cast votes proportional to their stake to select block producers.

The process for reaching consensus in a round can be broken down into the following basic steps.

Block producers are elected by the stakeholders in a round of voting.
Once the producers are selected, they are deterministically given a
round-robin rotation for a round of blocks equivalent to the number
of producers selected.
This creates a competitive market within the    round, ensuring
reliability.
Block producers validate and broadcast    blocks to the network.
Consensus is reached and the next round    begins.

For their services, block producers receive a reward. If they do not produce a block, then there is no reward and the reward is transferred to the next block producer if a successful block is produced. Producers do not have the ability to change transaction details, however, they could collude to prevent specific transactions from being included in blocks.


If transaction has impossible locking script, are coins lost?

If it made it into the blockchain, meaning 1 confirmation or more, it practically can't be invalidated. The same feature prevents people from reversing payments.

If it's provably unsolvable, then there's no way to spend the coins, and they're practically destroyed.


How to get correct block details url with block height on blockchain.info

It seems to me that Blockchain.info just increments the id of blocks whenever it sees a new one. If that is the case, the id of a block on Blockchain.info would just be an arbitrary number and the only relation that it has to the block height would be id ≥ height.

This is so, because it is possible that more than one successor to a block is found at roughly the same time. If that happens all successors (usually not more than two) will have the same block height, and are competitors to build the chain with the most accumulated work, "the longest" or main chain. This conflict will be resolved, when one chain gains another successor, pulling ahead of its competitors.
However, Blockchain.info will still store the detached blocks, allowing the id to grow quicker than the block height.

Apparently, Blockchain.info gives an overview of blocks at the same height under the URL https://blockchain.info/block-height/<height>. There it lists the hash of the main chain block, which you could use to lookup the id.


About confidential transactions blinding key

The blinding key is a shared secret among the receiver and the sender.

Typically the Diffie-Hellman key exchange is intiated by the sender ECDH, given that he already has knowledge of the receivers public key in a secure manner. The blinding key itself is not public knowledge, but the sender includes a one-time/temporary/ephemeral public key along with the transaction. The temporary public key is used in the ECDH key exchange scheme (receiver public key + temporary public key -> shared secret) to create the blind key.

There is no need for a private channel, the temporary public key can be public knowledge. The receiver however has to generate the shared secret themselves.


How many currency units in 1xBTC / 1xAltCoin?

No, at least not for the original Bitcoin and all those altcoins that do not change this aspect. But you are almost correct: Each Bitcoin is divisible into 0.1 billion (which is 100 million or a 1 followed by 8 zeros) actual units, called Satoshi after the pseudonym of Bitcoin's creator. In fact, the protocol only uses these; displaying them as Bitcoin is purely an output formatting convention.


Can one manually type the mined block on bitcoin core and broadcast it?

Yes. Bitcoin Core has a RPC submitblock, which, as the name implies, allows you to provide a block to be submitted to the Bitcoin network.
In fact, Bitcoin Core supports the getblocktemplate protocol which means you can solo mine with Bitcoin Core. Furthermore, pools are probably running Bitcoin Core in their backend and their pool software just uses the getblocktemplate protocol to get the transactions for a block and prepare the work that is sent out to the actual miners.


How does a Bitcoin client know its transaction has been accepted by the whole network?

6 blocks, not 6 clients. The chances of catching up to the block with the transactions that is buried 6 blocks deep is slim. Granted of course that the dishonest party has not a very significant part (say less than 15% or so) of the hashing power. These changes can be calculated using Poisson distribution, as done in Satoshi's original paper (last pages).


You will not be able to find an API that supports Paypal, credit cards and Google wallet since there's a chargeback issue with paying for Bitcoins in these methods. More on this here.
Each major exchange usually has their own api. Just Google "BTC-E API" for example. There is no "one stop shop" solution for this.


BTC-E.com currently supports trading pairs of BTC/USD, GG/BTC, SC/BTC, SC/USD and TBX/BTC. At the moment I believe it is the only exchange currently supporting Tenebrix.


Doesn't storing the "recovery seed phrase" for a wallet defy all logic?

Bitcoin's motto "Be your own bank" requires it that everyone takes responsibility over their coins. Bitcoin wasn't designed as an infallible asset. It instead aims to be something between a payment system (like SWIFT) and easily transportable gold.
If you think banks are safer than your home for money (that is, you don't want to take responsibility) banks are a better option for you.
What might make Bitcoin better for you could be an encrypted mnemonic seed system. There is no proposal, famous enough to make me aware of. It's definitely technically possible, and easy enough for Bitcoin techies to implement on their own.

The government seizes the paper and takes your coins?

Check out brain wallet. Who said that you needed a physical backup?
Though I would, instead, use a cascade of multiple hashing algorithms that I have chosen and memorized with their order, along with a passphrase that I have chosen. This requires less memorization.


How can i accept Bitcoin donations or payments on my website?

BitPay is an electronic payment processing system for the bitcoin currency. It enables online merchants to accept bitcoins, as a form of payment, just as they accept payments from Visa, Mastercard, or Paypal.

BitPay is available in every country, and you can set your prices in over 30 different currencies.

Merchants choosing to keep the bitcoins can be anywhere in the world. Merchants in some countries can choose to receive a direct deposit into their bank account.


Why Owner 1's Signature is in transaction #2, not #1

Owner #1's signature is required for Transaction #2 because Owner #1 at that point owns the bitcoin. It's being signed over to Owner #2.

Think of it this way, who signs a USD check where money goes from #1 to #2? It's always whoever owns the money beforehand.


how can I insert an arbitrary sha256 hash into the blockchain?

You can encode any arbitrary data using the Bitcoin script's OP_PUSH and OP_DROP commands. For this, however, you would need some custom Bitcoin client, as the standard one does not allow you to send messages like this.

Alternatively, you could just use the hash as a part of the generation of a Bitcoin address and store it in the Block chain by destroying one satoshi on it.

There should be a topic covering encoding of any data into the Blockchain somewhere on this StackExchange, so you can also have a look at that.


Should I use a different address for every transaction?

The only reason why it is recommended to use a different address for every transaction, is for increased anonymity - it makes it more difficult to trace, and next to impossible to prove, that the recipient of transaction A is the same person as the recipient of transaction B.

If you publish an address to receive payments online, and keep it static, everyone can go to http://blockexplorer.com/ and see all the money you have received, and calculate how much money you got. If you change the address after every transaction, it makes it much more difficult - someone who have to constantly monitor your web page with the published address to know all your addresses you received money on. And if you keep the page with the published address non-public, such as that your customer has to log-in to his account on your system to see the address, that makes it practically impossible for third parties to monitor your income, find out how much money you have and what you spend it on.


The usual bottlenecks for syncing are in CPU speed, memory limitations, or disk IO limitations. There isn't really a "fix" short of getting better hardware. The software is already doing as much as it can to sync quickly.

The only available "fix" is to increase the dbcache. Doing so will mean that more RAM will be used. To increase the dbcache, add dbcache=<n> to your bitcoin.conf file where  is the amount of memory you want to dedicate to this cache (note that Bitcoin Core will use more memory than you specify as it does other things that need memory besides the dbcache), or add -dbcache=<n> to the startup command, or, if using the GUI, increase the dbcache in the settings.


getnewaddress won't generate bech32 or p2sh-segwit addresses

The problem is that your wallet version is extremely old - it predates support for compressed public keys (which was added in v0.6.0, released in March 2012). As segwit addresses require compressed public keys, Bitcoin Core is failing with the keys you have, and defaulting to legacy addresses instead.

The solution is restart with -upgradewallet (just once), which will update the wallet to the latest version but break compatibility with old Bitcoin Core versions. Note that you'll need a new backup after doing so.


Do you need to change 'rpcuser' and 'rpcpassword' for each bitcoind node you run?

The rpc user/pass is only needed if you're planning to access the node via RPC. If you're running Armory on top of it, for example, that requires RPC and hence you would need it (Armory auto-creates the rpcuser/password for you, though).

If you're running a node and don't need the RPC functionality, no, you don't need those parameters set.


You can use both solutions. Api is based on Json-RPC. Its app for getting transactions on address. You can change it for your needs.

const RippleAPI = require('ripple-lib').RippleAPI;
var test_server = 'wss://s2.ripple.com';
const api = new RippleAPI({
    server: test_server // Public rippled server
});
api.connect().then(() => {
    /* begin custom code ------------------------------------ */
    const myAddress = 'rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn';
    console.log('getting account info for', myAddress);
    return api.getTransactions(myAddress);
}).then(info => {
    console.log(info);
    /* end custom code -------------------------------------- */
}).then(() => {
    return api.disconnect();
}).then(() => {
    console.log('done and disconnected.');
}).catch(console.error);

Good luck)


How do you derive the private key from two signatures that share the same k value?

ECDSA signatures are pairs (r,s) where r=(kG).x mod n, and s = (m + rx)/k mod n, where x is the secret key, k is the random nonce, and m is the message.

If you have two s values s1 and s2 for the same secret key and with the same nonce k (and thus the same value r), the following holds:

s1 = (m1 + r*x)/k
s2 = (m2 + r*x)/k

From that we can derive:

s1 * k = m1 + r*x
s2 * k = m2 + r*x
(s1 - s2) * k = m1 - m2
k = (m1 - m2) / (s1 - s2)
x = (s1 * (m1 - m2) / (s1 - s2) - m1) / r
x = (m1*s2 - m2*s1) / (r*(s1 - s2))
(all mod n)

So not only did you make it trivial to detect signatures with the same nonce (they have a recognizable r value), there is a trivial formula to compute the private key once someone sees two signatures.

This kind of attack has been known and actively exploited on the Bitcoin network since at least 2013: https://bitcointalk.to/index.php?topic=271486.0 . Don't reuse k values. Use RFC6979 to deterministically but securely generate them.

Also note that it's not sufficient that the nonces are different. They also can't be related in a known way. For example, you can't use k for one signature, and k+1 for the next work.


There is a maximum standard transaction size since Bitcoin 0.8.2 of 100k per transaction.

There are a number of other limits that influence the validation and propagation of a transaction though. Specifically:

A block is limited to 20000 signature verifications.
The block itself can't be larger than 1Mb.
The standard Bitcoin client (Bitcoin Core / bitcoind) will refuse to relay transactions flagged as dust.
Enough fee should be included (0.0001 BTC/kb)


What would happen if SHA256's pre-image or collision resistance would be broken?

Any collision resistant hashing function Hk : {0,1}* → {0,1}k is pre-image resistant regarding the uniform distribution on {0,1}2k.

A ⇒ B ⇔ ¬B ⇒ ¬A: I.e. if a function isn't pre-image resistant it is not collision resistant either.

SHA256 is a function that maps a potentially unlimited set of numbers to a smaller set of numbers.

  Hk : {0,1}* → {0,1}k

Collision resistance is a property that loosely says, it is difficult to find two inverse images X ≠ X' that have the same image H(X) = H(X').

More to the point:
A function H is collision resistant, if any algorithm can only find a collision with a negligible probability in probabilistic polynomial time.

I.e. if SHA256 would turn out to not be collision resistant, one could try to pick hashes that would succeed at the current difficulty, use the above predicted inverse function of SHA256 to calculate inverse image candidates, and finally check whether one can satisfy them with the currently available block input.

My gut feeling would be though, that it would be pretty difficult to find inverse images that also satisfy the required structure of the block input, especially getting right the hash of the parent block, and matching an address that one controls for the coinbase transaction.

Unfortunately, I have no idea whether the complexity of that would be greater or smaller than bruteforce mining.


Computer crashed, total reinstallation. Have wallet.dat but not private key

As long as you have wallet.dat file and encryption key so you have nothing to worry about.

You can reinstall Bitcoin-core and move your wallet.dat file to bitcoin directory (./bitcoin on Linux) then you will be able to use it like nothing happened.

To get your private keys from wallet.dat you could run in your terminal

bitcoin-cli walletpassphrase "PasswordHere" 600
bitcoin-cli dumpwallet "txtfile_keysFile_path.txt"

All your private keys will be stored in that path.


Why proof of work rather than posting to a public forum?

I participate in conversations online all the time where I implicitly trust that I am seeing the full discussion

Proof-of-work is one part of what allows bitcoin to be trustless, which is a very important property for any decentralized system of value. If transactions were just posted to a forum, then what is to stop a forum admin from editing, censoring, or deleting transactions?

Creating a trustless financial network is not a trivial task, the large amount of energy being spent to secure the network is a testament to the value users see in maintaining and participating in the network.


When we're talking about an amount like 133.7 BTC, we're actually talking about 13370000000 satoshis (13.37 billion units).

If you're using 32-bit rangeproofs in Confidential Transactions, you're limited to a range of 1 through 2^32-1 satoshi (42.94967295 BTC). To use a number as large as 133.7 BTC, you would need 34 bits at least (making the proofs larger and slower to create and verify).

What the section you're quoting is about is that CT supports scaling this number by a power of 10. Basically, the proof can (in the clear, for now) indicate that it is not dealing with satoshi units, but with millions of satoshis. Now a 32-bit proof can deal with ranges of 0.01 BTC through 42949672.95 BTC.

So the term "floating point" here simply refers to the fact that we're representing the number as 13370*10^6 satoshis rather than as 13370000000 satoshis. It does not mean we're dealing with fractional units.

Note: multiplying an EC point with a fractional number is technically possible in some cases, but not really used here.


What has OP_RETURN been used for over Bitcoin's history?

pourteaux answered this in a Twitter thread.

The story starts in 2010, when there was debate on bitcointalk about a proposal to include a DNS service on bitcoin called BitDNS. There was concern (including from Satoshi) that this would bloat the bitcoin blockchain, making it harder to do things like verify transactions.
Satoshi: "Piling every proof-of-work quorum system in the world into one dataset doesn’t scale. Bitcoin and BitDNS can be used separately. Users shouldn’t have to download all of both to use one or the other."
Some people point to this Satoshi quote as an implicit acceptance of altcoins, but I'll leave that debate for another day. And, BitDNS eventually did find a home in a separate blockchain called Namecoin. It never took off.
But, this isn't the end of the story.
A debate continued about the purpose of the bitcoin ledger. Is bitcoin for:

Recording financial transactions only, or
A secure, distributed data store

Option 1 is more scalable and sustainable. Option 2 allows for more experimentation and could > grow the bitcoin ecosystem.
I'll keep my opinion to myself, but neither camp won. Instead, a compromise was struck in May 2014 where Bitcoin Core enabled extremely short (40 byte) messages in a function called op_return. This was a sufficient size to, for example, store hashes linked to an external service.
This was a compromise because while it allowed messages, the size was limited and importantly- these messages were prunable.
Super important concept: what does prunable mean?
Prior to op_return, people who wanted to write messages on bitcoin were sending btc dust payments to fake addresses where the address itself was the message. This was a problem because all unspent bitcoin outputs have to be stored by all nodes forever as part of the UTXO.
op_return fixed this, because op_return transactions are  unspendable. Thus, nodes can safely ignore them since they are dead ends for btc and therefore take up no space in the memory of a bitcoin node.
These transaction are, however, forever stored in the bitcoin blockchain.
Fast forward to 2018 - 2019. Something like 20% of all bitcoin transactions are op_return transactions during this time. These messages mostly came from two sources: Veriblock (an altcoin that settles on bitcoin) and Omni (a way to mint tokens like Tether with bitcoin).
Bitcoin fees were quite high at this time due to op_return. Supporters of op_return argue that this is good for bitcoin: raises demand for btc and pays fees to miners to secure the network. Opponents say say these were crowding out bitcoin's intended financial transactions.
In all, Veriblock and Omni added about 10GB to the bitcoin blockchain from 2018 - 2019 with about 32 million transactions. Today, Veriblock/Omni have fallen out of favor, but the 10GB contribution to the blockchain is a permanent cost to nodes (some label it as "pollution"). But, because op_return transactions are prunable, there is luckily no memory cost since they aren't included in bitcoin's utxo.
Yet, op_return remains. Does it have any use? Well, it's safe to say that it isn't being used much currently. http://opreturn.org does a good job tracking this. Many argue that the functions op_return was used for are better off being executed with things like timestamps (e.g. OpenTimestamps) that don't bloat the bitcoin blockchain while still allowing you to prove the existence of something at a certain time (akin to a digital notary).
Some additional resources on OP_RETURN:
https://link.springer.com/article/10.1007/s10723-020-09537-9
https://bitzuma.com/posts/op-return-and-the-future-of-bitcoin/
https://en.bitcoin.it/wiki/OP_RETURN
https://opreturn.org/op-return-per-month/
https://www.blockchainresearchlab.org/wp-content/uploads/2020/03/BRL-Working-Paper-No-7-Dominating-OP-Returns.pdf
https://bitscribble.com/


0/unconfirmed and now no transactions anymore

I have observed from other experts that if you 'abandon transaction' your data will eventually be forgotten by other nodes and return to your account. You can 'abandon transaction' from the GUI console in 'transactions' by right clicking on it and selecting 'abandon'. This might take some time as even one outdated node might re-broadcast it again and it will get picked up by other nodes. Patience is what I have read. From there delete mempool and restart.


From the wiki it basically states that you can make a transaction to another bitcoin address and add nlocktime. The way that this would work in real life would be if you get paid on salary and are paid bi-weekly, the bitcoins will be on the network but won't reach you until the nlocktime is up
Edit: read example 1 from https://en.bitcoin.it/wiki/Contracts


How transaction becomes confirmed by miners if InputScript has only the Sig

Transaction verification requires the previous transaction outputs that the transaction spends from. The output script of the previous transaction outputs is retrieved for each input. The input script is first run through the script interpreter. It's resulting stack is then used as an initial state for the previous transaction output's output script's pass through the script interpreter.

For the particular transaction that you have chosen, then previous transaction output script is of the form

<pubkey> OP_CHECKSIG

and the input is of the form

<sig>

This means that the signature is first pushed to the stack. Then the public key is pushed to the stack and then OP_CHECKSIG is performed on the two stack items. The public key resides in the output script. For other output types, the public key is provided in the input script as part of the spend.

The hash that is signed as the message is produced from the spending transaction itself. It contains data that is provided in the spending transaction and the previous transaction output script so it can be generated on-the-fly. You can check out this question and answer How to tell which part of the previous tx I need to make the hash to sign for an old given tx? which breaks down how that hash is generated for non-segwit inputs.


How to create offer using JSON RPC in Ripple

I asked this questions sometimes in November 2016, then I was a newbie to ripple and ripple gateway.

So I choose to answer this question for the purpose of those who may like face this same challenge in the future

if you are creating offers between two none native currencies this is a good sample request.

{
  "method": "submit",
  "params": [
    {
      "offline": false,
      "secret": "snYothV5CFDMpMYStmL5VwMHzxHFr",
      "fee_mult_max": 1000,
      "tx_json": {
        "TakerGets": {
          "currency": "EUR",
          "value": "0.94",
          "issuer": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk"
        },
        "TakerPays": {
          "currency": "NGN",
          "value": "305",
          "issuer": "rGGpYkf66FaZb3zymeB3xH1SRdtx2zGxVN"
        },
        "Account": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk",
        "TransactionType": "OfferCreate",
        "Fee": "12",
        "Flags": "65536"
      }
    }
  ]
}

this will give a provisional response similar to this.

{
  "result": {
    "engine_result": "tesSUCCESS",
    "engine_result_code": 0,
    "engine_result_message": "The transaction was applied. Only final in a validated ledger.",
    "status": "success",
    "tx_blob": "1200072200010000240000007564D50AD5F57690A0000000000000000000000000004E474E0000000000A7616AF5356D585317A38B2EEC95B163BAC3434B65D46165400CE380000000000000000000000000004555520000000000C260B3831882A44608EE81C2F3726AA72D11CA9568400000000000000C732102272E391673B735C9D96435DAFF89F9EA7B4EC285C39643A754848EDE19A6542674473045022100F75C2C1B926F2880A38DB028B64F5363800FDC8FB8F4813ADE60A820DA9D8A710220148CC10AE87F0625733E73F35CB713857B1FDD6F5255979AA1075CE51FE3BAA38114C260B3831882A44608EE81C2F3726AA72D11CA95",
    "tx_json": {
      "Account": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk",
      "Fee": "12",
      "Flags": 65536,
      "Sequence": 117,
      "SigningPubKey": "02272E391673B735C9D96435DAFF89F9EA7B4EC285C39643A754848EDE19A65426",
      "TakerGets": {
        "currency": "EUR",
        "issuer": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk",
        "value": "0.94"
      },
      "TakerPays": {
        "currency": "NGN",
        "issuer": "rGGpYkf66FaZb3zymeB3xH1SRdtx2zGxVN",
        "value": "305"
      },
      "TransactionType": "OfferCreate",
      "TxnSignature": "3045022100F75C2C1B926F2880A38DB028B64F5363800FDC8FB8F4813ADE60A820DA9D8A710220148CC10AE87F0625733E73F35CB713857B1FDD6F5255979AA1075CE51FE3BAA3",
      "hash": "1B5738875CA25CA1CD76F6C8EEA65182172A2F7B7C87777614FA9FAEE2610F45"
    }
  }
}

if you are creating an offer to exchange XRP for none native currency, in which takers of the offer will get XRP for it's non native currency

{
  "method": "submit",
  "params": [
    {
      "offline": false,
      "secret": "snYothV5CFDMpMYStmL5VwMHzxHFr",
      "fee_mult_max": 1000,
      "tx_json": {
        "TakerGets": 10,
        "TakerPays": {
          "currency": "NGN",
          "value": "305",
          "issuer": "rGGpYkf66FaZb3zymeB3xH1SRdtx2zGxVN"
        },
        "Account": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk",
        "TransactionType": "OfferCreate",
        "Fee": "12",
        "Flags": "65536"
      }
    }
  ]
}

and the sample response goes thus

{
  "result": {
    "engine_result": "tesSUCCESS",
    "engine_result_code": 0,
    "engine_result_message": "The transaction was applied. Only final in a validated ledger.",
    "status": "success",
    "tx_blob": "1200072200010000240000007664D50AD5F57690A0000000000000000000000000004E474E0000000000A7616AF5356D585317A38B2EEC95B163BAC3434B65400000000000000A68400000000000000C732102272E391673B735C9D96435DAFF89F9EA7B4EC285C39643A754848EDE19A6542674473045022100C1BC4CF6D6D62670BAD3ACACA822E15E97F9594E30605B67178A25107880BA5B02207F0944A56ABD1BB5C13708903DA5AE13736356F99B1609261A3B4F2E6365A1D88114C260B3831882A44608EE81C2F3726AA72D11CA95",
    "tx_json": {
      "Account": "rJ5mA3kRwJWahdb3GqH3vmrbRd7eVufsVk",
      "Fee": "12",
      "Flags": 65536,
      "Sequence": 118,
      "SigningPubKey": "02272E391673B735C9D96435DAFF89F9EA7B4EC285C39643A754848EDE19A65426",
      "TakerGets": "10",
      "TakerPays": {
        "currency": "NGN",
        "issuer": "rGGpYkf66FaZb3zymeB3xH1SRdtx2zGxVN",
        "value": "305"
      },
      "TransactionType": "OfferCreate",
      "TxnSignature": "3045022100C1BC4CF6D6D62670BAD3ACACA822E15E97F9594E30605B67178A25107880BA5B02207F0944A56ABD1BB5C13708903DA5AE13736356F99B1609261A3B4F2E6365A1D8",
      "hash": "BF257B79B3D80FD7E8B5A42A60BA13904704AE21BFD07E56CE38F229A4C462A6"
    }
  }
}


How to produce a p2wsh transaction with bitcoin-cli?

If a P2SH address is already in your wallet, you can use the addwitnessaddress RPC command to get the P2SH-P2WSH version of that address and have it added to your wallet for tracking.


Generate addresses from Trezor's xPub using Python

xpub = 'ypub6...
(network="BTC",...

You are providing a testnet extended public key with the network parameter set as mainnet. I would suggest you either use a mainnet xpub key, or change the network parameter to testnet.


Fees from portals like coinbase or bitestamp to Bank/Credit Card

Coinbase has a separate bank fee (currently $0.15) in addition to their transaction fee.


Can I walk away from the table temporarily and come back in at a later time or date?

Sure you can.

It isn't a perfect analogy, but think about bitcoin as if it were a dollar bill in your pocket. Some people will obtain a dollar bill, and then stash it away in a safe, not touching it for years. Others will take that dollar bill straight to the casino, keeping it on the table to bet and play with.

There is no requirement to continuously buy/sell, bitcoin is not some sort of game. It is just an asset you can own, and do with as you see fit.


Implementation of the Variable length integer in C

No. The compact size unsigned integers are not uints (except for the base one of one byte). They are a serialization, so it is actually just an array of bytes. You just compare the number you are serializing to the boundaries and determine from there what the prefix byte is. Bitcoin.org does a better job of describing this: https://bitcoin.org/en/developer-reference#compactsize-unsigned-integers. Note that you will need to understand hex numbers are and how they work in C.


How does the security of a mobile wallet work?

Let's assume we have a non custodial hd mobile wallet.

Non-custodial means no third party acts as custodian, the wallet stores the private key(s)

Where is the master key stored?

Wherever chosen by the software developer who wrote that part of the wallet app.
Normally you'd hope this is in a file in local storage. You'd hope that file is encrypted using a wallet password as a key and using a well-implemented well-known algorithm. In some cases you'd be wrong.
In some cases the wallet's backup feature might copy this rather vital data into cloud storage. You'd hope the data is competently encrypted before being sent and that the cloud storage provider are also competent at protecting their client's data. Sometimes our hopes are not fulfilled.

What are the components of the telephone that allow the derivation of keys?

No special hardware is necessary.
Derivation of keys will involve use of the the processor (CPU) and memory in conjunction with the software algorithms embedded in libraries provided by the operating system and/or in the software application that is acting as the wallet. The results are likely to be stored in normal non-volatile storage (e.g. onboard flash-memory). You'd hope the developer was competent and careful to ensure this data was not vulnerable to undesired access while in memory or in non-volatile storage.


Can lightweight wallet users exchange money?

Instead of downloading full block chain, lightweight (SPV) users only download blockheaders of the blockchain.

Not all thin client are doing it.

  Can the *SPV clients create a transaction and send it to nodes?

yes, they can create a transaction. The example of thin client is Electrum wallet.

Electrum fetches blockchain information from Electrum servers, bitcoin nodes that index the blockchain by address. Electrum performs Simple Payment Verification to check the transactions returned by servers. For this, it fetches blokchain headers from about 10 random servers.

* SPV - Here is lightweight client


Can you see live trade data on the blockchain?

Short answer is: No.

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


Have there been cases of traditional money theft from Bitcoin exchanges?

This much less likely for a number of reasons:

Banks have advanced, robust and well-tested anti-fraud infrastructure, making such thefts much more likely to be detected.
Legally it is much much easier to prosecute for fraud cases in fiat than BTC (I do not know any prosecution over stolen Bitcoins)
Fiat transactions are reversible meaning the exchange could easily get its money back
Bitcoins are much easier to launder, so thieves are less likely to get caught


Storing bitcoins without a wallet using only a seed phrase

Essentially what you are proposing would be a cold storage if you install electrum via usb stick and not connecting your computer to the internet. What is really important that you note down not only the seed but also the derivation path to your HD wallet. This is necessary for recovering the coins years from now. There is a good side where you can check:enter link description here


It's more safe to do it on "clean" operating system.
I can propose another solution:

Prepare DVD or USB stick with Ubuntu operating system
Start live session of Ubuntu from DVD or USB stick on your computer
Download Electrum AppImage from official Electrum website
Run Electrum, generate seed
Switch off computer, all data will be lost


Is an extraction of the mnemonic string possible if wallet and corresponding passphrase are in possesion?

From your Electrum toolbar click on "Wallet" and then select "Seed". A new window will open asking you to enter your password, do that correctly and you will see your seed words if you wallet has any (meaning if it is a standard HD wallet not an imported one).


Options for accessing my BTC after host went down

I don't know if I can access it

You can't.

I can still see the balance on blockchain.info

That means you probably know the Bitcoin-address associated with some amount of money. However, knowing an address doesn't give you any control over that money.

There's a common phrase in the Bitcoin world:
Not your keys: not your Bitcoin
The only important information stored in a Bitcoin wallet is a secret number known as a private key. It is knowing that private key that makes it possible to spend Bitcoin money. Without that key you have no control over the money.
An account with a store is almost always a custodial wallet meaning the store has custody of the keys and you don't. Your PIN just tells the store who you are. That PIN is now useless.
This is why many people recommend non-custodial wallets, not custodial wallets (accounts). Especially for long term storage of money that isn't being actively traded.
You need the private key or the seed-phrase (also known as a recovery phrase or backup phrase) from which the private key can be derived. These phrases are typically made of 12, 18 or 24 words from a standard list of about two thousand words. It seems you don't have this.


What are the most notable cases of coins or wallet thefts?

In order of date:

13th June 2011, 25,000 BTC stolen from an early adopter "allinvain": A single user claims they were hacked and lost an enormous quantity of Bitcoins.
15th June 2011, 650 (?) BTC stolen from MtGox exchange: This attack probably made the news more than any other because the apparent market price plunged to $0.01/BTC, but withdrawal limits actually prevented a major loss. There was however substantial downtime and confusion amongst users while security issues were resolved. MtGox remains the largest exchange despite the issues, as at the time of writing.
31st July 2011, 27,000 BTC stolen from mybitcoin.com: This was a website that worked like an online wallet. After the website disappeared for several days, the owner reappeared claiming the site was hacked and is closing the site down, with a plan to refund 49% of each user's previous balance. There has been speculation that the owner of the site scammed the users.
1st August 2011, 17,000 BTC lost from Bitomat exchange: A surprisingly large Polish exchange was mistakenly (due to a technical misunderstanding) set up in an unstable hosting environment and lost its wallet file when the server crashed. The MtGox exchange took over Bitomat's business with an agreement to try to restore users Bitcoins.
1st March, 2012: More than 43,000 BTC were stolen from bitcoinica.com due to a Linode exploit, and another 3,000 from an individual programmer. The same exploit was used against Slush's Pool to steal 3094 BTC.
11th May, 2012: 18,547 BTC were stolen from bitcoinica.com.

I'm not aware of anyone being caught for any of these thefts.


Does encoding Namecoin/messages into the blockchain bloat it?

NameCoin merged mining adds no more than 49 bytes to the size of the block.  Namecoin messages aren't stored in the bitcoin block chain, instead the hash of the most recent namecoin block is stored in the Bitcoin block providing continuity between a potential hash and the Namecoin block chain.

So yes it technically does "bloat" the Bitcoin blockchain but it current is ~4% and that percentage will decline as transaction volume increases, as that fixed 49 bytes is measured against increasingly larger blocks.

As for "how" can it be done.  The coinbase transaction (which transfers rewards and fees to miner's address) contains a field called coinbase.  Without merged mining this field is used to generate entropy for hashing process (extra nonce) which alters the block header each time it is changed.  Allowing a miner to try nearly infinite number of hashes.

This field is not used by the blockchain for anything other than entropy so adding namecoin hash to the field doesn't collide with any Bitcoin transaction.  Once a block is signed the field is never used for anything other than verifying the block valid (by verifying the hash is correct and is smaller than required target).


It's generally a good idea to hold bitcoin in a wallet you control vs exchanges like Coinbase. I wouldn't use Bitcoin Core however as that is primarily a consensus server at this point. Quite a pain to run. Check out other standalone wallets like Airbitz (disclaimer: co-founder) or Mycelium, Electrum, etc.


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.


Raspberry Pi cpuminer error: -bash: ./minerd: No such file or directory

The original CPUMiner software made an executable named minerd. You are using a fork of the CPUMiner software which changed the executable produced to be named cpuminer. The minerd ... command will not work because that executable file does not exist as it is not created. If you are looking up any instructions for using CPUMiner and it says to do ./minerd ..., just do ./cpuminer ... instead. Note that because you are not using the original CPUMiner software not all example commands and options will be the same or result in the same behavior.

There are multiple reasons that you do not see anything on your Slush dashboard. First of all, you are connected to a Bitcoin mining pool and yet you are using the Scrypt PoW algorithm. Bitcoin does not use Scrypt, so whatever you are mining is invalid. Secondly, your hashrate is so low that you are not finding any shares (besides the fact that they will be invalid as you are using the wrong algo), so Slushpool does not know anything about this your worker as it has not received anything back from it.


Can transaction validation really be free?

There is currently no simple way to pay for transaction validation in order to mitigate those risks. I think there should be.

This statement is incorrect. Transactions include a fee which the miner that finds the block will get. Therefore it's in the miner's interest to include transactions and thus validate them.

Once transactions are in blocks, it's in everyone else's interest to validate for themselves and they don't run any risk doing that. (They'd run a risk NOT doing that.)

There is currently no real problem of transactions getting stuck because "it's too risky to validate". There are a few miners that mine empty blocks, possibly for this reason, but more likely because of lazyness and misunderstanding. And that will become even less of a problem every time the block-rewards halve.


Does one of these exchanges have a sandbox to test?

I work for an exchange, I don't know if I am allowed to say which, but have something called a test net, which is similar to what you are describing and which many people use to test trading strategies.


Consider Bitcoin Price goes down to $3000, what will be the effect on miners (will they stop mining) and the affect on difficulty to mine a Bitcoin?

More than a question it seems like you are asking for a prediction of behavior. What miners will do eventually, and how getdifficulty will be affected, has been central to many conversations around Bitcoin.

In my honest opinion, even at 3000 USD per BTC it is still highly profitable for miners. The key factor is if miners need to move their generated Bitcoins to fiat money to pay bills.

If a miner or mining pool manages to avoid these payments based on future price -something they should aim at-, they will be doing quite good with even 1000 USD per Bitcoin.

Remember that we are creating the Bitcoin/Frame/Economy. Trading for fiat currency is just not the main idea behind cryptocurrencies.


using rpccookiefile instead of username and password for antminers

The RPC cookie file is only for local authentication of bitcoin-cli.

For external applications, you should use rpcauth= lines in bitcoin.conf. A tool for generating these lines given a username and password is in the repository.


Wallet passphrase uniqueness (noob question)

The chances of someone "brute-forcing" or guessing your seed is extremely slim. There are more than 5 duodecillion possible combinations of twelve-word seeds. Just so you get an idea of how big that number is, it's more than 1 thousand million million million million million million possibilities.


What does a Bitcoin transaction consist of?

Here's an interactive diagram showing the indivdual steps through the diagram:

http://staging.spectrum.ieee.org/static/how-a-bitcoin-transaction-works

A typical transaction (simplified) looks like:

Spend:
   20 BTC from a transaction using address:ABC123

To:
   10 BTC to address XYZ111
   10 BTC to address JKL222

Here XYZ111 is where you want to send your BTC to and JKL222 is your address for the change.

With transations like this you do not know (reliably) where your BTC are coming from. The next transaction will probably spend from JKL222 as ABC123 is all spent.

This in intentional in the Satoshi client so that it jumbles up the change and the sendee's addresses.


There is a variant of viewing the transaction history at a certain address:
http://ripplerm.github.io/ripple-wallet/

Dont forget to switch the network to the test in the upper left corner. Good luck =)


How do the block explorers do the search by addresses -- do they
  search the entire blockchain at query time, which is very inefficient,
  or do they maintain some sort of index which they update iteratively?

The block explorers parse all of the transactions one by one and create their own database and index using the address generated from the scriptPubKeys. This is expensive the first time, but not as bad when it just needs to stay up to date.

  If they maintain the index, it looks like the index will be pretty
  huge since it will always keep on growing. So how big is the index
  currently?

It is at least as big as the blockchain itself (assuming they are storing all of the data, raw blocks, etc.). As for the specific number, you'd have to ask the specific block explorer.

  Also, can the blockchain nodes currently do such a search (of course
  efficiently)?

If you enable -txindex flag you can search by txid but Bitcoin-core offers no such functionality (search by address) unless it is one of your wallet addresses.


How Bitcoin Core calculate extended private masterkey from hdseed

Conversion from a HD seed to a master private key is specified by BIP 32.

It is done by computing a HMAC-SHA512 where the key is the text Bitcoin seed and the data is the HD seed itself. The first 32 bytes (256 bits) is the master private key. The last 32 byte is the chaincode for the master key.


I'm the author of the paper.

PoW mining may be wasteful, but it's a great distribution mechanism.  Coins and other applications that use Tendermint might want to tack on a distribution mechanism that tapers off over time.  I'm also exploring alternative distribution algorithms that don't require PoW, but for now I'm busy implementing core Tendermint.

Dogecoin could adopt it with a hardfork.  Alternatively, one could take Dogecoin's transaction data and create a new coin using Tendermint's consensus protocol.  The biggest problem with this is that exchanges and wallet services may benefit unfairly.


A NodeJS implementation on creating addresses from a Bitcoin (zpub, xpub) address

I would suggest using a library such as the bitcoinjs-lib library.

Here's a very stripped down example usage:

let bitcoin = require("bitcoinjs-lib");

function fromXpub(xpub, acctNumber, keyindex, callback){
    let address = bitcoin.HDNode.fromBase58(xpub).derivePath(acctNumber+"/"+keyindex).getAddress();
    callback(address);
}

let myxpub = "xpub6C6RXXtdbxSnfB78Y4WjJSjQuChKqHXh9JCZPeKtdGeWRiptL9oJePPtrYKPWaoem9W3Wvp8eEh8dFFuN7u4zT6x6A1H6D67bVVvufv3uJ1";

fromXpub(myxpub, 0, 0, function(cb){
    console.log(cb);
});

    13eX3ohuXCa93YgLCkuQF6NmJk8vUwqa8p


How do exchanges set their transaction fees?

Coinbase does not allow you to set fees, and has been called out for their practices in this regard, as have others. The surest way to have control over what happens with your Bitcoin is to interact with the Bitcoin network directly via a full node, and to not rely on, or trust third party services. This is precisely why Bitcoin exists.


Is there such a service as an unlimited Bitcoin wallet with an API?

While I'm not sure of the technical requirements or limitations you have around building you platform. It sounds to me like your best option is simply running your own Bitcoin node itself. There are lots of online examples that could help you get started. I found bitcoin.org's guides particularly useful:

https://bitcoin.org/en/developer-examples
https://bitcoin.org/en/developer-reference

This will also give you benefit of actually holding the keys to the funds on your platform as well.

For monitor transaction sent to your node's wallet, I'd check out the ListTransactions RPC call, and for broadcasting transactions, you can use SendToAddress, or CreateRawTransaction, SignRawTransactionWithWallet and SendRawTransaction.

I should also add that running your node can be almost free (just need a computer running the server), and that you do not need to actually mine BTC on the node (which consumes a lot of energy & resources). Your node will just be monitoring the chain and broadcasting your transactions.


Will BTC script be Turing complete in future?

Turing completeness includes the capability to run programs that might not terminate or that might terminate after a very long time. This would cause the blockchain to stall, hence it is a must to keep the number of instructions to be run predetermined (like BTC) or to be run according to a budget (like ETH).


I received an email that says someone sent me bitcoin

This sounds like a scam. Receiving bitcoins does not require paying fees.
If you are not otherwise expecting this payment, then you can safely just ignore the message. It is spam.


How do payment processing companies work?

Currently still, most companies want to receive in fiat currency. Most of these merchant payment companies function as a man-in-the-middle, so that you don't have to be concerned about anything Bitcoin-related.

They provide functionality with which your customers can purchase goods using Bitcoin and you will receive all payments in your fiat currency of choice (as long as it's supported by the merchant service).

Like with PayPal, when a users wants to pay with Bitcoin in your site, they will get forwarded to a page from, f.e., BitPay. The user will pay in Bitcoins to BitPay and be forwarded back to your site while you will be notified that the users did indeed pay. Meanwhile, BitPay adds the payment amount to your merchant account, in fiat currency, using the exchange rate of that moment.

Given the high volatility of the Bitcoin exchange rate, this is the best solution for most merchants for now. It's easy and safe.


What type of Bitcoin wallet is more secure than others?

This is similar to comparing apples to oranges.

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

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

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

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

There is no definitive approach to "most secure".


Can you broadcast a segwit transaction using a non segwit node?

Segwit was designed in such a way that segwit transactions, after removing the witness, are valid but non-standard to old nodes.

This guarantees that old nodes won't reject such transactions when they're seen in blocks, but still won't be relayed or mined by old software.


how to calculate Entropy from series of outcome?

Try using the an open source program called ent. Here are the results for rolling a die six times with the result vector of <666666>.

% echo -n "666666" | ./ent

Entropy = 0.000000 bits per byte.

Optimum compression would reduce the size
of this 6 byte file by 100 percent.

Chi square distribution for 6 samples is 1530.00, and randomly
would exceed this value less than 0.01 percent of the times.

Arithmetic mean value of data bytes is 54.0000 (127.5 = random).
Monte Carlo value for Pi is 4.000000000 (error 27.32 percent).
Serial correlation coefficient is undefined (all values equal!).


This project: https://github.com/sr-gi/bitcoin_tools might be what you're looking for...The repo has resources to dump the leveldb database into a JSON like format for review and analysis. They also created a paper discussing the format of UTXO here.


You are correct that changing either block size or block frequency would successfully allow more transactions to be confirmed per unit time.

However, changing the block frequency means changing the difficulty adjustment formula.  This requires a hard fork just like changing the maximum block size would.  In either case, network nodes that do not adopt the new rules will consider the new blocks as invalid, and if not everyone agrees to adopt the new rules, the currency will effectively split in two.

If you are going to have a hard fork anyway, changing block size has somewhat fewer technical pitfalls than changing the difficulty adjustment formula.  For instance, increasing the frequency will lead to a higher rate of orphaned blocks, where two miners each find valid blocks almost simultaneously and neither builds on the other.

Also, increasing the block frequency means that "confirmations" would not mean the same as they used to.  We think of "6 confirmations" as a benchmark for a transaction that would be extremely hard to reverse, but what that really means is "60 minutes of mining time".  If you adjusted the frequency so that the average block time was one minute, now everybody would have to use "60 confirmations" as the benchmark for equivalent security, and all software that counted confirmations would have to be updated.   (For instance, think of exchanges that don't want to credit a user's account until their deposits are sufficiently confirmed).  Any software that isn't updated will lose 90% of its security against double spend attacks.  So this would be more disruptive than changing block size.

Here is an example.  The current Bitcoin difficulty is about 6.8e11.  This means that an average of 6.8e11 * 2^32 = 2.9e21 hash operations are needed to mine one block.  Say you have a transaction in block number 400000 in the main chain, and it has 6 confirmations, so we are now at block height 400005.  In order to double-spend, someone would have to create a conflicting transaction in a conflicting block whose parent was block 399999, so the new block would also be at height 400000.  Then they have to mine 5 more blocks on top of their new block to get their new chain to be at least as long as the existing one, and hope that future miners will mine on their new chain instead of the old one.  So this requires mining 6 blocks = 6 * 2.9e21 = 1.7e22 hash operations.

Now imagine you want the average block time to be 1 minute instead, so you cut the difficulty to 6.8e10.  It now takes only 2.9e20 hashes to mine one block.  So a transaction with 6 confirmations under this new scheme only takes 1.7e21 hashes to reverse.  If you want the same security as before, i.e. 1.7e22 hashes needed to reverse, you have to wait for 60 confirmations.


It would first have to broadcast the first block. The way it works, the hash of the first block (including the nonce that is needed to solve the puzzle) would included in the second block. So the miner can't create the next block without first solving the puzzle for the first block because that's the only way to get that nonce.

So you can't work on two blocks and broadcast them simultaneously. The blockchain defeats that (that nonce which you can't tell till you have actually solved the block). You can work on two blocks to find the next block faster (although I doubt it's really reasonable since you have two split your hashing power between the workloads).

Now it's possible to broadcast the first block and find the next one  or two in quick succession. This happens. Finding the hash is brute force. It's a game of probability, which is basically just a fancy word for chance.


Is Bitcoin Days Destroyed a measure of hoarding?

Are Bitcoin Days Destroyed a measure of hoarding?

Sometimes. But just because bitcoins changed addresses doesn't mean they changed hands.

Is it also possible to derive velocity of bitcoin (money) from bitcoin days destroyed?

Not directly. Although velocity of money and BDD are related, they are not entirely the same. velocity of money is based on a legal definition, whereas BDD is based on a technical definition. Also, BDD weighs the movement of old, rarely used coins as more important than frequently traded ones.
Two differences:
First
BDD is based on transactions in the bitcoin network, whereas velocity of money is based on money changing ownership. A transaction doesn't mean that money changed hands. Examples:

Change. I send you 10 BTC, 5 BTC comes back to my address as change. The bitcoin network sees 15 BTC move, but only 10 BTC really changed ownership.
Laundering. The best example. Lots of bitcoins move around, but at the end, you still have the same amount.
I move my bitcoins from Mt Gox to blockchain.info. Again, there was a transaction, but no money changed hands.

Because of this, a velocity of money estimate based on total transaction volume will be wildly inaccurate.
Also, even if no bitcoin transaction has happened, money can still change hands. Lots of e-wallets support the ability to instantly transfer money between accounts.
Second
Because total transaction volume is such a bad measure of how quickly bitcoins change ownership, BDD was created. It's different from velocity of money in that you can't game it by sending money back and forth because it is much more significant to spend 100 BTC that last moved a week ago than it is to spend 1 BTC a thousand times.


Where is the best information about the contents of bitcoind 0.8.2?

The 0.8.2 makes no changes to the protocol, to make that sure.

The official information on the change that everyone is talking about is this pull request on GitHub.

You can find some people trying to make conclusions about the effects of the change on BitcoinTalk and Reddit. Keep in mind that they are not official representatives of the developer team and that they often proclaim incorrect information.

The only correct statement is the one in the pull request. Probably there will be some release notes as well as soon as the update gets pushed.


What is the difference between listpeers vs listnodes commands?

listpeers

listpeers returns data on nodes that you have connected with OR the nodes with which you have an open channel. If you have an open channel with a node, but the connection with that node has been lost, then the node will still appear in the output, with "connected": false. If you are connected with a node but do not have open channels, then it will return the output with "channels": [].

If you want to get information about a particular peer and not all of them, then you can add the node id of the peer like: lightning-cli listpeers <node_id>. You can also query log entries related to the peer by passing the command: lightning-cli listpeers <node_id> <level> where level can be io, debug, info, and unusual. Log levels can only be queried if a node id is supplied.

listnodes

listnodes will return the information of all the nodes in your local network view. This information is collected via the gossip network. If you pass the listnodes command without a node id, then the RPC will return information of ALL the nodes in your view. If you are interested in the information of a particular node id, then you can do so by passing the command: lightning-cli listnodes <nodeid>.


Is it possible to take advantage of FP16 for mining BTC or ALTs?

No l, floating point operation are pointless, regardless of how fast they are or what precision they have.

Also, BTC is mined using ASICs since 5 years ago or so, using a GPU is a waste of time and money.


Well that depends on what language you are using to parse the JSON.

The output for the API is in JSON format (JavaScript Object Notation). This notation is very common in the API space and when reading raw bitcoin transactions and blockchain data. When you query address information in bitcoin core console it is in JSON format. Think of it as a set of arrays. If you have an array of "Food" and that array contains "Fruit", "JunkFood", and "Snacks", and each of these arrays contain additional values within them. So if you wanted to access "apple" it would be under Food -> Fruit -> Apple.

With the BTC-e API JSON response it gives you the category first of "btc_usd" and then within that array is "high", "low", "avg", "last", etc. So in order to only select "last" it would be under btc_usd -> last.

I typically use PHP and it's quite simple to do.
Here's a phpfiddle: http://phpfiddle.org/lite/code/jsah-t4dv

<?php
$url = "https://btc-e.com/api/3/ticker/btc_usd";
$decode = json_decode(file_get_contents($url), true);
$price = $decode["btc_usd"]["last"];
echo $price;
?>


From what I understand, you only need one bitcoind instance on one machine, while other ones would only run miners that would connect to the bitcoind machine. Running more bitcoind than that is not necessary.

As for the software, you should look into P2Pool - it allows you to earn smaller amount of Bitcoins more often, meaning you'll get smaller variance. It won't decrease the amount of Bitcoins you earn on average though, meaning it doesn't cost you anything to use.


BIP 342 does not add any of these opcodes, and it is not possible to perform elliptic curve operations in it.
The only new/changed opcode semantics in BIP342 are:

Schnorr signatures instead of ECDSA.
OP_CHECKSIGADD instead of OP_CHECKMULTISIG(VERIFY).
OP_SUCCESSx opcodes for future extensibility
Unknown pubkey types for future extensibility.
Changes in resource accounting/limits.


Is it illegal to trade Bitcoin OTC in the United States

Yes it is illegal to trade OTC because you will be consider a money transmitter.

As long as you file with FINCEN, you will be on the clear.


This situation is unprecedented in the software world. In other peer-to-peer systems (think Skype or Bittorrent or whatever), software updates fix bugs or add new features, and if the user doesn't update their software the worst that can happen is that their program will run with some problems.

In Bitcoin the situation is drastically different because the system is entirely based on reaching consensus on something. Bittorrent or Skype don't really need to reach consensus on anything. Sure there's still a protocol that clients should follow for the system to work as expected, but even if these rules are slightly different from client to client, overall the system still functions.

With Bitcoin, consensus is what makes the whole system possible. The rules behind how to reach consensus are embedded (actually hardcoded) inside the client/node that all the people are running. Now, if there's some clients that have different rules than others regarding the consensus, then the whole system branches into different versions creating effectively different versions of Bitcoin.

In fact, one can go ahead and say that Bitcoin is exactly the set of rules (the actual algorithm) to reach consensus. If you're not using those rules, you're not using Bitcoin, you're using something else (Bitcoin 2.0, Litecoin 2.0, whatever...).

Now you understand why this is really an unprecedented situation in the software world (perhaps apart from the fork of 2013). If you change the rules then you're effectively creating a new version of Bitcoin and you must make everyone move onto your new version - and I'm not talking about only miners here; all people that are running clients on their phones, or on their computers; all the web wallets; all the exchanges. They all must update their code otherwise you've essentially created another system which is not Bitcoin.

So to answer your question about "who makes the decision about the rules", it's the actual people running the bitcoin software that decide at the end of the day.

EDIT as was noted in the comments, regarding the specific block size issue, SPV clients don't actually need to be updated because they don't check the size of the blocks - they trust the miners will do the checking for them.


How do I restore a wallet from a backup file in MultiBit HD?

You can't.

Security of a MultiBit wallet is broken into four parts:

A wallet encrypted by the password but not the wallet words
A wallet backup, kept in the cloud, encrypted by the wallet words.
"Wallet words," kept on a piece of paper
A password, kept in your head.

You have 2 and 4, but not 1 or 3. My understanding is that that's not enough to restore your wallet. If you had your wallet words, or access to the computer that created this wallet, it would be different.


JSON-RPC signrawtransaction returns false when using private keys

This was not a case of BitcoinLib malfunctioning in any way. It was simply a case of using wrong privkeys to sign the unspent outputs.


Will Segwit embedded inside P2SH save fee compared to P2PKH?

Spending a P2PKH output in an input of a transaction requires 4 * (36 + 1 + 1 + 33 + 1 + 72 + 4) = 592 weight units. Spending a P2SH-P2WPKH in an input of a transaction requires 4 * (36 + 1 + 1 + 22 + 4) + 1 + 33 + 1 + 72 = 363 weight units. Thus, given the same fee rate in BTC per weight unit, it will be cheaper to spend from a P2SH-P2WPKH output than it is to spend from a P2PKH output.

  He said less efficient. I want to know how much? Transaction size will be smaller than normal...?

P2SH-P2WPKH (P2SH nested segwit) is not less efficient than P2PKH (non-segwit). It is less efficient than P2WPKH (native segwit).


How does the receiver of a transaction check the whole chain of ownership?

There would have to be a public hash-to-transaction mapping somewhere.

Yes. There is a database of utxo - unspent transaction outputs. To be correct - it is an index of blockchain file.


How come some algorithms are better for GPU mining vs CPU mining?

Both are computational units. Algorithms are typically written without making assumptions about underlying chips that are going to run those algorithms, but certain type of tasks can benefit from massive parallel processing that GPUs, which increases GPUs appeal in mining, machine learning, etc.
https://blogs.nvidia.com/blog/2009/12/16/whats-the-difference-between-a-cpu-and-a-gpu/
Specific explanations about ML and mining can be found here:
https://www.quora.com/Why-do-people-use-expensive-GPUs-for-Bitcoin-mining-and-not-multiple-CPUs-like-Quad-Xeon
https://www.quora.com/Why-are-GPUs-well-suited-to-deep-learning


Whats the difference between "txid" and "hash" - getrawtransaction bitcoind

Summary: The difference is when the tx is a segwit tx, the calculation of hash does not include the witness data, whereas the txid does.

The definition of transaction hash remains the same as txid for non-witness transactions (non Segwit). The reason the mainnet tx has a different hash than the txid is because it is a witness transaction. If you run bitcoin-cli help getrawtransaction it will show you:

Result (if verbose is set to true):
{
  ...
  "txid" : "id",        (string) The transaction id (same as provided)
  "hash" : "id",        (string) The transaction hash (differs from txid for witness transactions)
  ...

Segregated Witness

The following is from BIP 141.

Note that the BIP states, "signature data is no longer part of the transaction hash."

Transaction ID

A new data structure, witness, is defined. Each transaction will have 2 IDs.

Definition of txid remains unchanged: the double SHA256 of the traditional serialization format:

[nVersion][txins][txouts][nLockTime]

A new wtxid is defined: the double SHA256 of the new serialization with witness data:

[nVersion][marker][flag][txins][txouts][witness][nLockTime]

Format of nVersion, txins, txouts, and nLockTime are same as traditional serialization.

The marker MUST be a 1-byte zero value: 0x00.

The flag MUST be a 1-byte non-zero value. Currently, 0x01 MUST be used.

The witness is a serialization of all witness data of the transaction. Each txin is associated with a witness field. A witness field starts with a var_int to indicate the number of stack items for the txin. It is followed by stack items, with each item starts with a var_int to indicate the length. Witness data is NOT script.

A non-witness program (defined hereinafter) txin MUST be associated with an empty witness field, represented by a 0x00. If all txins are not witness program, a transaction's wtxid is equal to its txid.


Bitcoin-qt -testnet 0.17.1 Send and Receive buttons do nothing

I believe I should answer this question for the people who may stumble here and would like to know right away what is this issue all about.

If you are building from source and configure your build like:

./configure --with-gui --disable-wallet --SOME-OTHER-OPTIONS

and then you decide you want the wallet and go back to configure and rebuild without --disable-wallet, that is:

./configure --with-gui --SOME-OTHER-OPTIONS

make sure you run make clean before rebuilding.


Yes, its possible for there to be more than one valid hash.  I don't know what the mathematical probability of this is, but if you were to exhaust the entire nonce spectrum, there are likely to be several valid blocks.  Most blocks, however, stop when they get a valid hash, so it seldom is an issue.  Though occasionally, two miners might come up with different valid hashes at the same time, and this results in one of them being rejected.

As for a collision, well, that's effectively impossible.  First, yes, it's possible that the same hash could be found for two different blocks, but that's not a collision.  It's also highly unlikely.  Unlikely to the point of there being no point in dealing with it.

Yes, it could screw up certain software that assumes hashes are indexable and unique, but it shouldn't really be an issue for the blockchain itself to have duplicate hashes.

The only real "collision" would be if an attacker were trying to come up with his own block of transactions, with the same parent that would somehow hash to the same value and trying to "take over" the other block, and that is astronomically unlikely to the point of absurdity.


Been reading the bitcoin source code but unsure what this segment of Serialize.h does

The encoding used fits 7 bits of data in each byte of output. So, to figure out the number of bytes of output you will produce, you need to take the number of bits of input and divide by 7 (since 7 bits of input fit in each byte of output), rounding up.

So, sizeof(n) is the number of bytes of output. Multiplying by 8 gives the number of bits of input. We divide by 7 to get the number of bytes of output needed to fit that many bits of input.

But integer division rounds down. To divide by 7 but round up, we add 6 to the number before dividing. That makes it round up.


Properties of Bitcoin as an Electronic Cash System

When a user pay the electronic cash to a shop, the procedure between the user and the shop should be executed in an off-line manner. That is, the shop does not need to be linked to the host in user’s payment procedure.

Neither merchant nor customer need to be connected directly.

A customer can hand a merchant a previously-signed transaction without using a network connection. However, the merchant can only prove the validity of the coin(s) being spent by contacting the network.


Where can I find the bitcoind bundled with bitcoin-qt in Ubuntu?

If you start bitcoin-qt with the -server option, it also runs an RPC server, making it functionally equivalent to bitcoind.


Exact syntax for lightning-cli txprepare

For readers, this issue has been resolved here.

Note that Gabriele's syntax was correct but that you currently cannot use unconfirmed UTXOs with txprepare [1] ! The documentation has been update accordingly.

[1] This caused lightningd to crash but has been fixed by now.


The Ledger Nano S doesn't support importing private keys because that would defeat the purpose of it being a hardware wallet:

  (ie: your computer might have had malware at some point, and your keys could have been compromised without your knowledge)


How do I get started mining bitcoin with a GPU?

I just did this today...

I found a mining pool (I picked Eligius) from here https://en.bitcoin.it/wiki/Comparison_of_mining_pools

The pools website had further instructions. In my case, I installed a mining client "bfgminer" and followed the instructions to add my ID. It sounds like for a windows OS, GUIMiner might be a good start too.

gui miner thread https://bitcointalk.org/?topic=3878.0

The key thing to realize is that there is a difference being a BitCoin "client", which is what you setup above, and a BitCoin "miner" which requires the steps I in this response.


AFAIK Electrum is the only client that supports Master Public Keys as of now. Electrum uses a deterministic seed and also have an MPK that can derive bitcoin addresses that belongs to that seed. So people can generate addresses to receive, but can't spend from them; this is called a seedless wallet.


Do miners become temporary dictators of blocks they mined?

Can anyone elaborate on what it means exactly, please?

It just seems like a weird phrasing for saying that the miner has complete control over which transactions are included in the blocks they mine.

  Does it really mean that those particular miners who mined the block can do whaterver they want with that block, like setting txs fees and putting txs? What about the other miners who didn't find that particular block? They become powerless until another block is mined?

Miners can select which transactions they wish to include in the block they are mining. However, they cannot change the fee for a given transaction (except in certain uncommon signature types). In transactions using SIGHASH_ALL, the fee is implicitly signed into the tx since all inputs and outputs are signed, and if a miner attempts to alter the fee, they will invalidate the transaction, and thus the entire block. Pretty much every wallet I'm aware of uses SIGHASH_ALL.

A miner is powerless if they don't find a block simply because they cannot control what another miner picks for their block.

Note that after a miner mines a block, they can no longer change the contents of that block, as it would invalidate the proof of work.


Keypool keys are already in wallet.dat.  That's the whole point of the keypool.  When you run getnewaddress, you get the address corresponding to the oldest key in the keypool, and a new key is generated and added to the keypool to take its place.

So if your hypothesis is right, the key is still in the keypool, and if you execute getnewaddress again, you should get the same address as you got before.  Then you'll know you have the key.  bitcoind may not expect that there are already transactions on that address, so you might have to run bitcoind -rescan to pick them up.


A few things to check:

Make sure you are computing the HASH256 on the decoded byte values of the string. In other words, HASH256(0x73656e646572)
Make sure you are doing 2 rounds of SHA256
Using secp256k1 to generate a compressed public key
This is a P2PKH address (prefix is 1) so the steps to generate the address from the public key are:

pubkeyhash = HASH160(compressed pubkey) i.e.RIPEMD160(SHA256(compressed pubkey)
prepend 00 byte prefix for P2PKH
BASE58CHECK(pubkeyhash)

$ echo -n sender | openssl sha256
(stdin)= 0a367b92cf0b037dfd89960ee832d56f7fc151681bb41e53690e776f5786998a

$ echo 0a367b92cf0b037dfd89960ee832d56f7fc151681bb41e53690e776f5786998a | xxd -r -p | openssl sha256
(stdin)= 098f6d68ce86adb2d8ba672a06227f7d177baca3568092e4cda159acca5eb0c7

$ openssl ec -inform DER -text -noout -in <(cat <(echo -n "302e0201010420") <(echo -n "098f6d68ce86adb2d8ba672a06227f7d177baca3568092e4cda159acca5eb0c7") <(echo -n "a00706052b8104000a") | xxd -r -p) 2>/dev/null | tail -6 | head -5 | sed 's/[ :]//g' | tr -d '\n' && echo
04f4e5977bcb050452289ebc750b56be65086bfdf3411bb9c346430716545d66b8dede7516256f34fa362b10b3ec85ccdf58c25733e00e5d33120fb66a79e596f6

# result is even (ends in 0xf6) so prefix first 32 bytes with 02 (for odd use 03)
$ echo 02f4e5977bcb050452289ebc750b56be65086bfdf3411bb9c346430716545d66b8 | xxd -r -p | openssl sha256
(stdin)= cb59a26ae2e385719a66f568476bace40a8789c5fe91d74be6381e29feb20ecb

$ echo cb59a26ae2e385719a66f568476bace40a8789c5fe91d74be6381e29feb20ecb | xxd -r -p | openssl ripemd160
(stdin)= 53178717ab3d70c50fe8ec8598a9c2a8a703abc5

$ echo 0053178717ab3d70c50fe8ec8598a9c2a8a703abc5 | xxd -r -p | base58 -c && echo
18aMGf2AxQ3YXyNv9sKxiHYCXcBJeJv9d1

using base58


Beginning 2017 what estimate of individuals own bitcoin?

There's a hard limit on the amount of people that own one bitcoin: There currently are only 16.1 million bitcoins in circulation, so there can't be more more than 16.1 million people with one bitcoin. However, there are a number of individuals that control much more bitcoin than that, so it is safe to say that the actual number of users that own one bitcoin is much smaller, I'd guess less than one million people.

On the other hand, the number of users that own any bitcoin at all is very hard to estimate as well. There are currently 46 million unspent transaction outputs, so if we'd assume that every user maintains their own balance that would be a strict upper limit. However, many users leave their coins to be managed by online wallets or exchanges, so it's not a reliable limit. On the other hand, the number of people is probably even much smaller than that, because few people own many of those UTXOs. If I were to hazard a guess, I'd say that there are fewer than five million people in the world that own any bitcoins.


Is it ok to use dices to generate seed for trezor on coldcard?

There are many ways to generate seed words that are BIP39 compliant.
It is clear to me that you wish to use dice in order to create seed entropy.  Yes, you can use Coldcard to convert your die rolls into seed words.  Those seed words can be imported into any BIP39-compliant wallet software, including hardware wallets like Trezor.
Alternately, you can use other methods to create seed words from dice.  The top method that comes to mind is the Ian Coleman BIP39 generator.  Check the option to show entropy details, and you will have a spot to enter your dice rolls.  You can select 12-24 words for your output, in three-word increments.


Are there any pools or large miners running "child pays for parent" patch?

According to an offshoot reply in bitcoin-talk it appears that the only mention of this protocol comes from Luke-Jr on Github.  Another topic on bitcoin-talk mentioned that his pool, elegeius, implements this patch.

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

On the eligius FAQ page http://eligius.st/~gateway/faq/following-applies-transactions-being-processed-our-blocks

It mentions specifically = Transaction processing/priority contracts are available (talk to Luke-Jr).


I received multiple transactions at one address, but may have screwed up wallet. Not sure what my options are.

If you do not have your private key for address you must forget about Bitcoin at all and use your national currency only. Point.

Bitcoin stands for "be your own bank". You are too dumb to understand it for serveral years.


How can I analyze the test coverage of the Bitcoin Core codebase?

Marco Falke has a site that analyzes the current line, function and branch coverage for unit tests, functional tests and fuzz tests.
Alternatively, vasild runs clang's tools and then a script to highlight which lines in the coverage report have been modified by a particular patch (PR).


Why can you mine so much more of other cryptocurrencies with a lower hash rate?

Comparing hashes per second for Bitcoin and Ethereum mining is comparing apples and oranges. You can only compare hashes per second, if coins in question use the same hash functions for proof-or-work. Bitcoin uses double SHA256, which is a general purpose hash function and can be massively parallelized and optimized in hardware (ASICs). Ethereum uses Ethash, which is more memory-hard and mostly mined on GPUs. Zcash uses Equihash, Litecoin uses scrypt, and so on.

Miners who have SHA256-specific equipment can only choose between SHA256 coins (Bitcoin, Bitcoin Cash, Namecoin (?)). Miners with GPUs have more options, as many memory-hard hash functions are more or less GPU mineable.


In btc network does the limit of Vin should be less than 1000 in for a single transaction?

Bitcoin Core enforces a standardness limit on the weight of transactions of 400000 (corresponding to 100000 bytes for non-segwit transactions). Note that miners are not required to follow this limit (though most do), and larger transactions are absolutely valid inside blocks.

There is no specific limit on the number of transaction inputs.


Does the satoshi client always send the change of a transaction to a newely generated address?

When you generate a wallet, then the wallet contains by default 100 bitcoin addresses. This is good for many reasons, e.g. old backups of your wallet might be able to recover all loses in case of a harddrive failure, etc.

The "privacy reason" is that someone looking at the blockchain can't see which bitcoin go to the receiver and which is the change of the inputs.

And last but not least, the "security reason" is because every bitcoin addresses is just a hash of a public key, so someone with a working quantum computer can't attack the public key (as he can only see a hash of the key, not the key itself). But whenever you need to spend bitcoins, you need to reveal the public key, so all addresses that have previously spend bitcoins will be "vulnerable" (but new addresses wont).


bitcoind jsonrpc bumpfee not returning hash of newly created transaction

the issue is now tracked on https://github.com/bitcoin/bitcoin/issues/16275...


Is it possible to send coins WITHOUT importing private key?

Basically what Murch said. You have to use the private key to sign the transaction.

There is a point I want to add, however. It is possible to send coins without importing the private key into a computer which is connected to the Internet. In fact, this is how a properly run exchange or online wallet service ought to maintain its cold storage. Normally, funds are just sent to the public address of the cold storage. When it comes time to send coins out of cold storage, the private key is imported into an offline computer, the transaction is generated and signed, and the signed transaction is then broadcast using a different computer (which is connected to the network). This increases security as it prevents malicious attackers from gaining access to the private key because they simply have no way of connecting to the offline computer on which it is stored.


Why hasn't the Bitcoin client advanced to version 1.0?

The software is definitely in beta at the moment. There are many things that need working out before version 1.0 can be declared, like the blockchain for instance - many works in progress. And they're about to completely change the GUI to QT so it certainly wouldn't make sense to declare v1 just before releasing something a lot closer to the actual v1. Patience :)


What is the hash-rate of the Bitcoin network that results in the maximum difficulty?

The hardest possible target is all zeros plus a one (0000000...1). If such a block were ever mined (which is extremely unlikely: on average you'd need 2^255 hashes per 10 minutes, which is 9.6e73 hashes per second), it would definitely crash the network : there can only be one hash at that difficulty, which means that there can only be one block mined at that difficulty.

Of course, if the target is zero, no block can be mined at all.


What percentage of Bitcoin use is legitimate?

Silk road wallet hold 144,000 Bitcoins. It had 1,2B USD in annual volume. This was 2014.

Since then darknet markets have flourished. See Measuring the Longitudinal Evolution of the Online Anonymous Marketplace Ecosystem.

This is mostly for illegal drug related and other purely criminal activity like payment fraud (stolen credit card). This does not include ransomware bitcoins (1B USD). This does not include e.g. bitcoins involved in tax evasion and asset hiding. This does include bitcoins lost in exchange hacks or stolen from exchanges. Furthermore, most peer-to-peer and remittance trading could be accounted as money transmitting business and against local regulations.

Bitcoin transactions are not very useful in casual purchases, thus there has been little mainstream consumer adoption. Bitcoin shines in anonymous online payments and most day-to-day and/or point-of-sale payments don't require this level of anonymity or the complexity it brings along with it.


How can I send a payment to myself with lightening to rebalance 2 channels?

First of all, there are already scripts that automate this process. Check C-Otto's rebalance script, for example.

Secondly, I wouldn't assume that finding a route via queryroute guarantees that the balances in the used channels could actually support your payment. I think it just means that the theoretical capacity in your nodes' view of the LN is sufficient. Knowing if the route actually works involves trying to route across it.

To address your concrete questions, I don't know if queryroute supports loops by now, but from glancing over the above script, it appears that it should.

As for your 2nd question, fees are always taken by the node forwarding a payment for sending across a channel, not the recipient in a channel. So if you try to route you-bitstamp-lpu-you, there are only two forwarding hops here, bitstamp and lpu. And they will require the fees that they have announced for the channel bitstamp-lpu (announced and collected by bitstamp) and lpu-you (announced and collected by lpu).


How to calculate trading fees ahead of time?

Those are Bitstamp trading fees, not Bitcoin transaction fees. Trading fees are automatically calculated and deducted by Bitstamp when executing a trade.

For choosing the right Bitcoin fee, use bitcoin-cli estimatesmartfee or one of the many web services.


What does it mean for a cryptocurrency to be ASIC-resistant?

It means that there will be no significant speedup by implementing the algorithm in an ASIC, as compared to a CPU based implementation.

This is usually achieved by requiring a lot of memory, which when implementing this on an ASIC, translates to needing lots of physical area on the chip.

ASIC implementations derive their power from having many physically parallel and pipelined threads on one chip, each requiring a certain piece of chip real estate.
Now if your algorithm requires lots of real estate even for one step of the pipeline, there will not but much room to actually parallelize or pipeline the algorithm.  Thereby you will lose the parallelizing advantage of an ASIC implementation.

scrypt is such an algorithm. Used for instance by Litecoin.


What happens to old transactions in case of a fork?

What happens to the 'old' version of a blockchain and related transactions/data in case of a fork. Can they still be deleted

In the case of a soft fork, historic data must be kept.  In the case of a hard fork, it's not strictly necessary to keep historic data but it is almost always retained.

Going in to a bit more detail: a soft fork changes the rules everyone follows in a backwards-compatible way by only making the rules more strict.  For example, miners have access to a field called the "coinbase" into which they used to be able to put any arbitrary series of 2 to 100 bytes; later a rule was added that specified in the BIP34 soft fork that the first few bytes of that field had to be the current block's height (distance from the first block).  This is more strict, so everyone who follows the new rule also automatically follows the old rules.  This is backwards compatible because anyone who followed the old rules and isn't already violating the new rules can continue to use their software as normal.

However, for that backwards compatibility to hold true, the data available in the block chain has to not only remain available but stay in basically the same format.  You can sometimes do tricks with that, as segwit did by moving signatures to a new field in transactions, but there's a limit to the scope of changes you can reasonably make.

For hard forks, there rules are changed in a backwards-incompatible way so everyone needs to upgrade anyway.  This gives you a blank slate upon which to make any change to the system you want.  Regarding old block chain history, what you can do is commit to the current state of the system and throw out all history used to arrive at that state.

For example, imagine Alice mines a bitcoin and then pays that bitcoin to Bob.  The block chain will include both the mining transaction and the payment transaction, but if everyone is upgrading anyway, it's simple to just say "Bob starts with 1 bitcoin" and throw away Alice's mining transaction.

If you were to throw away historic data and keep just the current state after a Bitcoin hard fork, you could reduce the current block chain size by about 98%, down to just a few gigabytes.

However, I'm not aware of any hard fork of Bitcoin or an altcoin that ever threw out the historic data and simply committed to the current state.  I don't know why that's the case.


I believe your options are to:

Upgrade to Bitcoin-Qt/bitcoind v0.9 or greater, which takes care of this situation.
Live with it as-is (showing an 0/unconfirmed that will never confirm)
Transfer funds elsewhere and abandon your wallet
Export your keys and import them into another wallet, perhaps a new one
Perform wallet surgery (pywallet to remove the private key used in the double spend, rescan, then import it back in.  Instructions).


How to generate bitcoin target from difficulty?


Test the windows python code below with the private/public key generated from
website. Just to verify the correctness. If correct proceed.
Throw coin 256x get your private key.
Throw dice whatever, until you get 256 bits.
enter the private key in the code below.
you should get your bitcoin address.

Code:

# COMMENTS
import bitcoin
import binascii
PrivKey1 = 'e8ee7398abbbdc8920f53c8fd454e86eab74beae2a9c42d28bf86402f3d87fcb'
PrivKey1Type = bitcoin.get_privkey_format(PrivKey1)
print("Private Key types")
G = bitcoin.encode_privkey(PrivKey1, 'hex',0)
print("Type: hex", G)
G = bitcoin.encode_privkey(PrivKey1, 'hex_compressed',0)
print("Type: hex_compressed",G)
G = bitcoin.encode_privkey(PrivKey1, 'wif',0)
print("Type: wif",G)
G = bitcoin.encode_privkey(PrivKey1, 'wif_compressed',0)
print("Type: wif_compressed",G)
PubKey1  = bitcoin.privkey_to_pubkey(PrivKey1)
PubKey1type = bitcoin.get_pubkey_format(PubKey1)
H1 = bitcoin.encode_pubkey(PubKey1, 'bin')
print("Public Key")
print("Bin format", H1)
H2 = bitcoin.encode_pubkey(PubKey1, 'bin_compressed')
print("Bin Compressed format", H2)
H3 = bitcoin.encode_pubkey(PubKey1, 'hex')
print("hex format", H3)
H4 = bitcoin.encode_pubkey(PubKey1, 'hex_compressed')
print("Hex Compressed format", H4)
K1 = bitcoin.decode_pubkey(H4)
print("decoded format", K1)
Hash1 = bitcoin.bin_hash160((H1))
print("PubKey Hash from Uncompressed PubKey", binascii.b2a_hex(Hash1))
Hash2 = bitcoin.bin_hash160((H2))
print("PubKey Hash from compressed PubKey", binascii.b2a_hex(Hash2))
BTCaddress = bitcoin.pubkey_to_address(PubKey1, 0)
print("Bitcoin Address", BTCaddress)


building bitcoin-qt.exe using Visual Studio 2017

There is documentation about how to build with visual studio
 on this link. It works fine for me.


is bitcoind reliable when depending on it for web services?

I think bitcoind is perfectly suitable for it, if you can securely access it via RPC.

You can easily create a separate bitcoind instance when you experience that only one instance cannot handle the load, but keep in mind that a bitcoind instance can only send coins it has the private key from, so you will have to separate all your queries into two parts, one for every instance.


Do relay nodes need to have money in order to relay transactions?

No, there is no work around for this. If a channel's balance is completely allocated to one side, the channel can only be used to move funds in one direction. Additionally, a channel whose balance is shifted completely to one side is vulnerable to the broadcast of a previous channel state as there are no funds to be lost for the attacker. This does not apply to channels that are unilaterally funded, since no previous channel state exists in that case.

It is therefore not recommended to exhaust a channel completely in one direction. To maintain liquidity in both directions, proposed approaches are to charge increased fees as channels get further out of balance, and to charge lower fees, possibly even negative fees, in the direction that moves a channel back towards equilibrium.

Routing algorithms that minimize the fee for a route would thus be incentivized to help rebalance routes along the path. Additionally, this means that cycles can exist in the graph that actually incur in sum a negative fee, which any member of that cycle could collect by initiating a payment to themselves along the cycle to the collective benefit.

Update: It follows an example for using a cycle to rebalance channels.

Take the three payment channels

Alice 0.8 : 0.2 Bob
  Bob 0.7 : 0.3 Carol
Carol 0.9 : 0.1 Alice

Alice notices the cycle, and creates a three hop payment that pays 0.3 BTC to herself by route of Bob and Carol. She crafts the HTLC, and sends it to Bob, Bob accepts and forwards to Carol, Carol accepts and forwards to Alice. Alice executes the last hop, Carol the middle and Bob pulls in the locked funds from Alice resulting in more balanced channels for everyone.

Alice 0.5 : 0.5 Bob
  Bob 0.4 : 0.6 Carol
Carol 0.6 : 0.4 Alice

Note that Bob and Carol do not know that Alice paid to herself as they can each only see the next hop and previous hop in the contract chain.


This may be connected to the fact that Berkeley DB can't be built on Ubuntu 18.10:

Can’t build Berkley database on ubuntu 18.10. During call to make install getting error: definition of ‘int __atomic_compare_exchange(db_atomic_t*, atomic_value_t, atomic_value_t)’ ambiguates built-in declaration ‘bool __atomic_compare_exchange(long unsigned int, volatile void*, void*, void*, int, int)’


Is there any Bitcoin Exchange that doesn't have fees for euro SEPA deposits/withdrawals?

Would a non-bank transfer work?  How about getting a realoadable prepaid debit card and using that for spending / ATM use?


Problem with receiving bitcoins on my VPS

It looks like the block chain simply hasn't synced up fully for you. It usually takes a few hours to download the whole block chain and during this time the program will have inaccurate balances.

Verify your block count

Check your Bitcoind's block count with the getblockcount command and make sure it matches up with the network's block count. Heres the network block count, maintained by blockchain.info.

Make sure you're downloading blocks

If it doesn't match up, make sure your Bitcoind is atleast in the process of downloading blocks, try the command a minute later and see if it has incremented since then. If the block count stays the same number over a few minutes, it very likely that the following is your problem.

Why a server isn't downloading the block chain

Something that I've seen happen is that Bitcoind may stop downloading blocks at some point in the middle of the full chain. This happens because your server is running out of memory. Downloading the block chain is a heavy procedure because each block needs to be checked. You can remedy this by just manually moving a chain you've downloaded onto the server or get more ram (you need more than .5 gb of ram to run Bitcoind anyways). The community has the block chain available on torrent.


How to store/export coins from bitcoind to papper wallet 'cold storage'

You can create a paper wallet (from a link from here for example) and then send the bitcoin to the address associated to that wallet. Then it is in the so-called cold storage. The paper does not need to know there are bitcoins on it, you just want to have the private key (which is printed on it) associated to the address you have sent you BTC to, whenever you want to access the BTC again

The idea is that you have a private key on the paper wallet, which is the ONLY (so dont loose it ;) ) option to access that specific wallet. Whatever ends up in that wallet is yours, whenever you send it (so before or after printing, but you have to create the address/key before sending of course)


Which address do I use to dump private keys from Bitcoin Core wallet?

It will be the public address that you want the private key for.

The details available in the question here might be useful:
Using dumpprivkey to make a paper backup


how to evaluate if this (or any) bitcoin public key / private key combination is valid?

1) A Bitcoin address is between 25 and 34 characters long

2) the address always starts with a 1 (in this case)

3) an address can contain all alphanumeric characters, with the exceptions of 0, O, I, and l.

(ref: https://thomas.vanhoutte.be/tools/validate-bitcoin-address.php)

Now here comes the hard part: The last four bytes of the address are the first four bytes of Sha256(Sha256(2,3,4...21th bytes of the address))

More info: https://bitcoin.stackexchange.com/a/50879/38618


Where is Bitcoin information (wallet.dat) stored on OS X?

The Bitcoin wallet on Mac OS X is located in ~/Library/Application Support/Bitcoin/wallet.dat.

Mac OS X v10.7 (Lion) came out, and it has the ~/Library folder hidden, see the answer from chilled35 to access it with Finder.

  In order to see hidden folders, such as ~/Library from Finder, simply hit shift + ⌘ (command) + G which will GO to a folder, then paste in this location:

~/Library/Application Support/Bitcoin

  From there, you will see all the files associated with your wallet.