Openssl magic values? Secp256k1 and ECDSA similarities? What makes secp256k1 special?

You are using the eliptic curve function of openssl and providing a serialized bytestring as an input. DER (Distinguished Encoding Rules) is a restricted variant of BER for producing unequivocal transfer syntax for data structures described by ASN.1.

The ASN1 structure for a privkey looks like this:

# ASN.1 STRUCTURE FOR PRIVATE KEY:
#   30  <-- declares the start of an ASN.1 sequence
#   74  <-- length of following sequence
#   02  <-- declares the start of an integer
#   01  <-- length of integer in bytes (1 byte)
#   01  <-- value of integer (1)
#   04  <-- declares the start of an "octet string"
#   20  <-- length of string to follow (32 bytes)
#           3cd0560f5b27591916c643 ... a738d2e912990dcc573715d2c
#           \--------------------------------------------------/
#            this is the private key
#   a0   <-- declares the start of context-specific tag 0
#   07   <-- length of context-specific tag
#   06   <-- declares the start of an object ID
#   05   <-- length of object ID to follow
#   2b 81 04 00 0a <-- the object ID of the curve secp256k1

See also:
Signing transaction with SSL - private key to PEM


Recognize Bitcoin address from block hash, and transaction hash

Block explorers I've seen typically accept the following inputs:

Bitcoin address: 25-34 alphanumeric characters.
Block height: decimal number, up to let's say 10 digits
Block hash: 64 hex digits (0-9, a-f), representing a 256-bit number
Transaction ID: 64 hex digits

So it's easy to recognize a Bitcoin address or block height with a simple regex.

They can't tell apart a block hash from a transaction ID, because in principle any given 256-bit number could be the hash of either (or neither).  So when a string of 64 hex digits is input, they simply search for it as block hash and as a transaction ID, and if one of them is found, they return the appropriate information.  It's overwhelmingly improbable that the same string could be the hash of a valid block and of a valid transaction, so there isn't really any need to handle the possibility that both are found.

They could do some minor optimizations: for instance, if the string starts with a bunch of zeros, it's more likely to be a block hash, so maybe they search that table first.


The run-desktop.sh command must be issued from the Ardor install directory.  The command should do a 'cd' to the install directory at the beginning but it doesn't.  You can either do the 'cd' before issuing the command or add the 'cd' to run-desktop.sh.


Is there any way for me to recover or reclaim a confirmed but unspent transaction that was sent to the wrong address?

Confirmed Bitcoin transactions are final and cannot be undone. Try asking the receiver to send the funds back.

Edit:

If you did the transaction between accounts on an exchange, it probably can be cancelled by the exchange team.


The 51% attack is emergent behavior of the system. It's not because there's a "50%" buried somewhere in the protocol that can just be changed to 60% or 75%. Someone with more hashing power than everyone else combined can, given enough time, always build a longer chain than everyone else.


Why can't I get any miner to work on my PC?

You cannot mine Bitcoin on a desktop (or laptop) computer these days.  If you are trying to mine Bitcoin on Slush, you will need an ASIC.  You can potentially mine ZCash on Slush, if you have a high performance graphics card.  Slush does not support directly mining any other coins.


how to create a transaction that can only run in bch-abc using javascript?

They added it to their examples.md recently.

var privateKey = new bch.PrivateKey('L1uyy5qTuGrVXrmrsvHWHgVzW9kKdrp27wBC7Vs6nZDTF2BRUVwy');
var utxo = {
  "txId" : "115e8f72f39fad874cfab0deed11a80f24f967a84079fb56ddf53ea02e308986",
  "outputIndex" : 0,
  "address" : "17XBj6iFEsf8kzDMGQk5ghZipxX49VXuaV",
  "script" : "76a91447862fe165e6121af80d5dde1ecb478ed170565b88ac",
  "satoshis" : 50000
};

var transaction = new bch.Transaction()
    .from(utxo)
    .addData('bch rocks') // Add OP_RETURN data
    .sign(privateKey);


Where did you send the bitcoins from? Anyways, due to the many unconfirmed bitcoin transactions in the network right now, your fee is relatively low and it therefore takes so long to confirm. If you did send them from a wallet you control, then you can try to use RBF or double-spend it with a higher fee. Otherwise contact the sender of the bitcoins, or wait some more time for it to confirm.

See also here:
Why is my transaction not getting confirmed and what can I do about it?


What is the correct term for bitcoin market cap?

The value of a commodity expressed by its exchange rate in dollars is sometimes referred to as "Total Dollar Value" (example).  That's probably the most commonly used term for referring to the value of all assets at the current valuation.

Incidentally, money stock refers to the amount of bitcoins themselves.  So currently (Feb 2013) there is about 10.8 million BTC.

There is another concept called purchasing power which might be used as well.  Because the value fluctuates, prefixing that definition and referring to it as "current purchasing power" might be an even better term.  Discussion on this was initiated in a forum thread.


The pool calculates your hash performance from the number of shares that your miner produces. With so little hashing power, it's likely that your miner did not generate a single share, so to the pool it's indistinguishable from doing no work at all.


Matching KeyPath in application with Wallet32 Keypath for Bip44 wallets

Response on stackoverflow https://stackoverflow.com/questions/27299204/matching-keypath-in-application-with-wallet32-keypath-for-bip44-wallets/27627358#27627358

Short answer : now the "44'/0'" notation has been implemented, just update your package of NBitcoin.


How to get an average bitcoin to USD price from different sources

You would want to avoid doing this on every page load. Instead I would recommend making it a cronjob that runs every N minutes and dump the values into a database. Then for each page load pull from your database instead of fetching from external sources. This will make your page load faster and you wont have as many api requests. Most sites limit your number of requests and if you are pinging them every page load you might get blocked.


It's possible to get your price equation via their API:
https://localbitcoins.com/api-docs/#ads
As well as the price at which each of the trades are locked in at:
https://localbitcoins.com/api-docs/#dashboard
It should be possible to write a script to scrape this data and calculate the btc_in_usd value using this.
(I'm sure this information is available somewhere in their user panel too, although you might have to look around)


Which altcoin would be the easiest to fork a cryptocurrency from for educational purposes?

You could take a look at Jeremy Rubin's TinyCoin:
https://github.com/JeremyRubin/tinycoin

It is, exactly as the name suggests, a very small cryptocurrency written in python which is designed purely for learning purposes. Might be what you're after :)


Is the label of an address visible for another people?


what is Create wallet using blockchain api (PHP)

This API allows you to create a new Wallet on Blockchain.info. It's the same as if you are registering on the webside but programmatically. On Blockchain.info you can do all thing either of the website or programmatically, which can be very usefull.

If you want to call the api from PHP, you need to send a JSON-Request to https://blockchain.info/api/v2/create_wallet. For a tutorial of JSON-Request in PHP look here

For sending and receiving Payments you need to use this api:
https://blockchain.info/api/blockchain_wallet_api
There are also some examples in PHP on this site.

Blockchain.info does not offer a referral programm, so there is no reward for providing new users.


bitcored + vmware: disk space increases INCREDIBLY fast

It may be because of the nature of the entire blockchain, and the virtual disks itself. 400Gb+ can be the blockchain obtained from the network, temporally persisted, and 13Gb seems to be the amount that is really persisted.

Those numbers are fine in orders of magnitude when operating a full bitcoin node. To control the grow of the space, maybe creating a fixed-size virtualbox will help


How much power for mining single Bitcoin or bitcoin cash?

Here's the quick math I did:

According to Blockchain.info, the total hash power is about 20.1 million TH/s.
If this is all done by the most efficient AntMiner S9 hardware, at 13.5 TH/s, then there are around 1.5 million devices.

Each device draws around 30KWh each day, and they are probably paying around 8 cents KWh, for a daily cost of about $2.40 USD each.

So:

$2.40 per day * 1.5 million devices = $3.7 million daily electricity cost

How much is being earned?

There are around 144 blocks mined every day, with a value of 12.5 BTC, which currently goes for about $9,000.

So the total income is about $16.2 million every day.

How low could prices fall before miners can't even pay their electrical bill?

144 blocks * 12.5 BTC * $X cost == $3.7 million electricity cost
solve for X:
X = $2,055

So, when the price of a BTC gets close to $2,000, miners will no longer be able to even pay their electrical bills.  Then there is hardware, staff, maintenance, overhead, profit, etc.

Side issues:

I assumed the most efficient S9 hardware, but some devices are more wasteful.  It is possible that more efficient miners will be coming out too.

I used some of the lowest US costs for electricity.  Its likely that costs in other countries are less.  I also assumed perfectly efficient power supplies, but checking on some online posts, it seems real-world power consumption may be 30% higher than what I estimated.


Sent bitcoin with no history of transactions

Everything is fine, the bitcoins are back.
With some peculiarity:)


Sending a Bitcoin (BTC) to a Bitcoin Cash (BCH, aka BCC) address in Kraken exch. without receiving the private key?

Basically they don't have enough staff with security clearance to handle manual cross-chain recoveries. So only substantial amount will be considered.

  It is Kraken's policy not to engage in efforts of recovery where BCH
  is sent to an XBT address or XBT is sent to a BCH address. Our last
  three blog posts have emphasized this point. Also, as you said,
  recovering your XBT funds will require manually handling the private
  keys associated to your BCH deposit address. Kraken has extensive
  security policies and procedures in place to ensure the safety of our
  customers' and our own funds. This means that the access to any
  private keys associated with any funds is extremely limited.

Source: https://www.reddit.com/r/btc/comments/6vpuy5/14_of_my_btc_held_in_limbo_at_kraken/


How many hash calculation is needed to reach one BTC?

Double SHA 256 follows a uniform distribution that means all hashes are equally likely to occur. So, your chances of finding the block header hash that is less than the target is same for every round of hashing.

With the current mining difficulty of 10183488432890, the target bits are 0x171ba3d1. This means you will need to find the block header hash that is less than or equal to 0x0000000000000000001ba3d10000000000000000000000000000000000000000. For one round of double hash that is a probability of 2.28631x10-23. Let's call it P. So the probability of not finding a valid hash is (1-P). For N hash attempts, the probability of not finding the valid hash is (1-P)N. To be sure that you find a block we need to ensure that (1-P)^N -> 0. Since P -> 0,  (1-P)^N = 1-N*P (using Taylor expansion). Solving both equations you get N = 1/P = 4.3738x1022

At your hash rate of 1 TH/s it will take you 4.3738x1010 seconds which is 1386.91 years.


Can I change current receiving address in Bitcoin Wallet app?

The wallet generates a new receiving address every time you touch the "Request coins" button at bottom left. This is normal and is done for privacy reasons. The last one in the list is labelled "This is your current address for receiving" but you can re-use earlier ones if you don't care about privacy or if you really know what you are doing (e.g. receiving regularly recurring payments from same person).
There is no need to do anything with old addresses. They can be reused if you really need to but there is no harm in leaving them alone.
If you want to generate new old-style addresses for receiving payment from someone with old software, I don't see any way to do that with the current version 8.08 settings menu. It always generates new-style Bech32 addresses with a bc1 prefix so far as I can see.


All wallets will calculate and show the same amount as the "balance" for an address. In your example, all wallets would show the balance as 4 BTC. There are exceptions if a wallet is faulty or is not synchronised (not up-to-date, doesn't yet know about latest transactions).
If you import an address into a wallet, it will show the correct balance but it will show that amount as "watch-only" or "non-spendable".
There is no way to discover private-keys from addresses.


First of all, Coinbase is a little different from the main concept of an "exchange".

Real exchanges, like MtGox or Bitstamp, are really just a medium between traders. People can set limit orders to buy / sell bitcoins for a certain price. The exchange will match buyers and sellers when conditions of both the buyer and the seller are met.

More concrete, there are two types of orders: limit orders and market orders. Limit orders allow a trader to buy bitcoins at a price lower than the current price or sell bitcoins higher than the current price. However, these orders will only be executed once another user accepts them. Market orders will just find the best matching limit order.

So, let's say the last trading price is 100 EUR/BTC. Two people want to sell bitcoins but not for 100 EUR. One sets a limit order for 105 and the other for 110. So the best price to buy bitcoins for is then 105. When a person places a buying market order, it will look for the best price and it will buy from the one trader for 105 EUR. If the buyer wants to buy more than just one bitcoin, he will continually take the lowest price available. Doing this, the "price" of bitcoin will increase as the lower-price sell orders are no longer available.

Coinbase is different because it, as far as I know, does not allow for limit orders. I'm not sure how they implement trading, but it's possible that they charge a little higher price and take the risk for themselves or they may just make your order at another real exchange they partner with. But in any case, if no limit orders are supported, it is not a real person-to-person exchange like most others are.


What does the Bitcoin Core linearize script do? What use cases would make use of it?

By "linear, no-fork" blockchain does that mean throwing away orphan/stale blocks (blocks that were successfully mined but didn't make it into the blockchain due to competing mined blocks)?

Yes.

What use cases would make use of this linearize script?

The script was used to construct the bootstrap.dat file that was previously used to quickly sync new nodes. This method of node initialization has been deprecated and remove as headers-first syncing is faster.


You're right, there is no strict requirement that the private key is strictly less than the group order.

However, it is required that the resulting public key is uniform, which implies that (x % n) must be uniformly distributed between 1 and n-1 inclusive (or at least indistinguishably close to uniform). The easiest way to accomplish this is by saying that the private key must be picked directly uniformly between its bounds. However, you could just as well say you pick a private key uniformly between 1 and 1337*n-1 (except no multiple of n).

To elaborate on "indistinguishably close to uniform": specifically for the secp256k1 curve (which is used in Bitcoin's signatures), the curve order is very close to 2^256, and in general you won't ever generate a 256-bit number that is >= n. This is not the case for all elliptic curves however, and biasing private keys can actually threaten security.


No, each bitcoin is not uniquely identifiable (there is no ‘serial number’). In fact, on a technical level, a ‘bitcoin’ does not actually exist as most people imagine it to.

What I mean by that is that all ‘bitcoins’ actually exist as ‘unspent transaction outputs’ (UTXO). Each UTXO is a record of where the bitcoins reside: it will specify a bitcoin address, and an amount of bitcoin.

For example, suppose you have 2 addresses, each with one bitcoin in it:

Address A: 1 bitcoin

Address B: 1 bitcoin

Each of these addresses will have a UTXO associated with it. Next, you send a transaction, that spends both of those UTXOs to a single address (Address C, we’ll ignore txs fees for simplicity). So now you have:

Address C: 2 bitcoins

Next, send a transaction that spends the address C UTXO, with an output of 1 BTC to each address D and E. So now you have:

Address D: 1 bitcoin

Address E: 1 bitcoin

So now the question is: what can we say about the bitcoins (UTXOs) for address D and address E?

We can trace the history through the blockchain, and know that the address D and E UTXOs have a common history with the address A and B UTXOs, but we cannot say that ”the bitcoin in address D is the one that was in address A”. This allows bitcoins to be fungible, preserving privacy and usability.

Hopefully through this you can see how the bitcoins are not track-able digital objects being passed around, instead they are UTXOs that can be combined and split endlessly, as the user so desires.


My 7850 has very similar characteristics. 1250Mhz works the best. I doubt there is a formula as my 7870 is much happier with 1500Mhz. Remember that video memory has error correction. Sometimes is can run quite high with lots of errors which will reduce your performance.


Remove the paddings from bottom and open screws under them.


Because they are doing two different things.

libbitcoin is taking the entropy and directly using it as a BIP 32 seed to produce the BIP 32 master private key.

However the web based wallet is taking the entropy, producing a BIP 39 mnemonic, then using the BIP 39 mnemonic to produce the BIP 32 seed and from there the master private key. Since BIP 39 mnemonic to BIP 32 seed involves hashes and does not result in the same value used to create the mnemonic, the resulting BIP 32 seed is different from your initial entropy. Thus you are getting two different private keys.


Where do I find my Blockchain wallet's change address?

Go to https://iancoleman.io/bip39/ and download the page to use it offline (you should never enter private keys into a website).

Scroll down and choose the BIP 44 tab. In the text box next to "External / Internal", change the 0 to 1. You should then get all of your change addresses derived below.


Bitcoin Best Practices by the Bitcoin Foundation

I put together a Kindle book, Bitcoin Step by Step, that covers some best practices.  When I was writing I searched the web for what ever I could find trying to make sure what I suggested was indeed the current best practices.  You can find it on Kindle.


Is there a working Open source implementation of litecoin mining application for Linux without GUI

cgminer should work, it is open source, cross platform miner for bitcoins and litecoins (--scrypt key  used for scrypt based coins like litecoin.)


How important is the hash power in solving a block?

Hash power is like a lottery ticket. The more you buy the greater the chance you have that one of your tickets will match the drawn numbers.

But a person with one ticket can also win just the same. Each ticket has the same chance.

Having a higher hashrate simply gives you more chances to win within a given block frame.

In the end it boils down to luck. But the more attempts/lotto tickets/hashpower means your odds of finally matching/winning/solving increase.


Is there a minimum time to be mining a pool to have any results?

Deepbit allows PPS (pay per share) or Prop (proportional) mining. Under PPS, you get credited for each share you mine. Under Prop, you get credited after the pool finds a block, with the 25 BTC split proportionally among the miners based on how many shares they have. Since Deepbit has 1% of the total hashrate (according to Blockchain.info), on average it will take 100 * 10 min = 16 hours to find a block, though I stress this is only an average and variance can be very high. So if you choose Prop, you'll get paid every 16 hours, on average.


Can I use root used to create multiple BIP32 addresses, to spend transactions belonging to these multiple BIP32 addresses?

A BIP32 master extended private key can be used to derive child addresses, but to spend coins sent to those child addresses, you will need the private key of each individual address. The master xpriv key cannot spend the coins located in one of its child addresses.

Remember that an address derived via BIP32 is otherwise indistinguishable from any other address. In order for a transaction spending any address' balance to be valid, it must be signed by the private key of that address.

That said, good wallet software will take care of key management in the background for you, so as long as the derivation scheme is correct you should be able to spend the funds sent to your master xpriv key's derived addresses using a BIP32 & 39 compatible wallet. Again, this will be done by deriving the child addresses and using their private keys to sign transactions.


Bitcoin POS: payments between seller and buyer

There is nothing you can do to speed this process up unless you are running a local copy of bitcoind or btcd to be able to query the blockchain yourself using JSON-RPC.

This is not much of an answer, but unless you can give more specifics, I can't really advise further.


Where does the US Dollar go when you buy a bitcoin? Not From Anyone but from CoinBase ect.

When you buy a book from Amazon (directly, not from its marketplace), who gets the money?  Amazon gets it.  They can use the money to buy more books to sell to other customers, pay their employees, power their servers, etc.

When you buy Bitcoins from Coinbase, who gets the money?  Coinbase gets it.  They can use the money to buy more Bitcoins to sell to other customers, pay their employees, power their servers, etc.


Can the fee be 10 times bigger than the amount that was sent?

The tansaction fee is based mostly on the transaction size (in kilobytes), not its amount (in BTC).

Even more: the bitcoin protocol is quite unfriendly to small transactions to prevent spamming the network. If the transaction output is larger then 0.1 BTC, then the fee could be leveraged (more on fee generation algorithm here)


How to recognize dependent transactions sitting in the mempool?

getrawmempool
getrawmempool(true)
Returns all transaction ids in memory pool as a json array of string transaction ids. If we use verbose as 'true' it returns more than just transaction ids and one of the result is 'depends'.
"depends" : [(json array) unconfirmed transactions used as inputs for this transaction "hex",(string) parent transaction id]
Example:
"2004b140d4b4eb1048cdb7def895a211c279711e47cc402c64f91f1c0d20f0dc": {
    "fees": {
      "base": 0.00000446,
      "modified": 0.00000446,
      "ancestor": 0.00000892,
      "descendant": 0.00000446
    },
    "vsize": 142,
    "weight": 565,
    "fee": 0.00000446,
    "modifiedfee": 0.00000446,
    "time": 1598036451,
    "height": 1807966,
    "descendantcount": 1,
    "descendantsize": 142,
    "descendantfees": 446,
    "ancestorcount": 2,
    "ancestorsize": 284,
    "ancestorfees": 892,
    "wtxid": "4e680766ede2535b53e868c95d1483a443f9ab7f8b9d9ef4fcb355a768faba16",
    "depends": [
      "8b72e7045466d79a60ea13c9700b268ae0d695a7666008fc0c454775d7d95561"
    ],
    "spentby": [
    ],
    "bip125-replaceable": false
  }
}
Child transaction:

Parent transaction which had Unconfirmed input in above case:

Both transactions got confirmed in block 1807995.


Why does Bitcoin-QT not seem to be catching up on my Mac?

Sadly Bitcoin-Qt's (and bitcoind's) default DB cache size is very small for systems like yours.

You should definitively add -dbcache=4000 (use 4GB of RAM for UTXO-set-database [etc.] cache).
This should speedup your sync significant.


How do I optimize my usage of oclvanitygen?

1) Make sure the Vanitygen you use has the AMD patch (if you have an AMD GPU, Vanitygen Plus has it)

2) Update your GPU drivers (can't be done on Mac)

3) Play with each of these constants. Their effect is different among the GPUs and drivers, and you may never know if they can have a (relatively) significant positive effect performance.

-w <worksize> Set work items per thread in a work unit
-t <threads>  Set target thread count per multiprocessor
-g <x>x<y>    Set grid size
-b <invsize>  Set modular inverse ops per thread


How to handle leading 0's (b58 1's) when base58check encoding

Iterate from the beginning until you reach a non-zero byte. Base58 encode the non-zero byte and the following, and add 1s before the base58 string you made for each initial one zero byte (0x00) you counted.
Zero bytes after the first non-zero byte don't need special treatment.
For example, [0, 13, 36], is encoded as 1211 since the value is 1*58^2 and 1 in base58 alphabet is 2. From here, you see that if it's a multiple of 58, no special treatment is needed since the encoding is big endian and the 1s caused by 58's powers are automatically appended to the back


How to get the wallet address of my own LND node?

Use lncli h to view a list of all the available commands.

lncli newaddress will give you a new address for the wallet. You must specify the address type: either p2wkh (pay to witness key hash), or np2wkh (nested pay to witness key hash). For example, lncli newaddress p2wkh.

(Running lnd v0.6.0-beta)


What are the special Ripple accounts ACCOUNT_ZERO, ACCOUNT_ONE, and root account?

The root account is the account that owns the XRP in the initial ledger.

ACCOUNT_ZERO is an account whose 160-bit identifier is zero. When dealing with a currency/issuer pair, ACCOUNT_ZERO is used as both the currency and the issuer to indicate XRP.

ACCOUNT_ONE is an account whose 160-bit identifier is one. ACCOUNT_ONE is used in cases where no account is applicable but the currency is not XRP. For example, in a ripple balance node between two accounts, the "balance" belongs equally to both accounts and is really a property of the two of them. It has an issuer of ACCOUNT_ONE.

ACCOUNT_ONE is also sometimes used as a flag in internal arithmetic operations to indicate that non-XRP semantics are desired. XRP amounts are stored as integer drops (millionths of an XRP) while other currency's amounts are stored in exponential notation. Sometimes an amount isn't in any particular currency (for example, when outputs and inputs are divided to compute an offer's quality). To indicate non-XRP semantics without having a valid currency, ACCOUNT_ONE is used. It essentially means "not XRP".


How can I recover btc that did not register to address

The transactions to/from the address you linked have been confirmed and cannot be reversed.  If you click on the transaction IDs (e.g. cbbae668...), you will see the number of confirmations; currently in the thousands.

  How can I recover my btc when davor is not responding?

You cannot.  Davor owns those coins now, and any attempt to do anything with them will need their cooperation.  All you can do is ask them to credit your account and/or refund their coins.  You can ask politely, or rudely, or with the assistance of the legal system (i.e. try to sue them).  But this is no longer a problem that can be solved via technology.


When I've had this happen it's been because of a non-clean shutdown. Something about the disk state ends up being inconsistent and this (understandably) results in the system wanting to verify all the information it has on disk.


Open source updated blockchain explorer for altcoin

you can use
insite api. You can customize the code for any altcoins. They provide UI and API for explorer services


Promise-to-pay functionality without escrow where sellers vote if they should pay

That is referred to as M of N transactions.  So you have 6 buyers, and at least three must agree to the transaction for the funds to be delivered to the seller.

It's coming.

Why are m-of-n transactions not used today?


Importaddress taking a long time to run / does not work

Use Bitcoin Core 0.14 (or higher) and the new importmulti RPC call.

importaddress does always a complete rescan (back to the genesis block) which can take serval hours. Very inefficient if you import multiple addresses.

where importmulti can import multiple keys/addresses at once only requiring a single rescan.
You can also set the according address birthday timestamp to avoid rescanning the complete chain from the genesis block.


Change port 8333 to other. (Running multiple docker instances)

Yes you can and the node will still sync and push transaction data.

Most of the nodes are behind NAT and not reachable anyway from the internet.
These nodes are initiating connection against random nodes and then the communication become bidirectional, allowing to receive blocks.

Nodes that are exposed to the internet are important, to bootstrap nodes behind NAT and for SPV clients.


There is a lot of information available, just not consolidated. After searching for sometime, I found the best answer from this link.

The format of each file is:

4 bytes: Magic bytes
4 bytes: Encodes size N of next upcoming block.
N bytes: Block encoded in standard format (with header)
--
above repeats

Quotes from the original link:

4 | 4 | 80 | TxData | 4 | 4 | 80 | TxData | 4 | 4 | 80 | TxData | ...

First 4 bytes: magic bytes (identifying which network you are on)
Second 4 bytes: the number of bytes of the remaining block
Next 80 bytes: block header itself
Next NumBlockBytes - 80 bytes: Transaction data in this block [ numTx | Tx1 | Tx2 | Tx3 | ... ]

What I don't understand is why are the magic bytes repeated? We could very well have used:

4 | 4 | 80 | TxData | 4 | 80 | TxData | 4 | 80 | TxData | ...


Can two or more transactions sent from the same address be mined in the same block in Bitcoin's blockchain?

Will both Bob's transactions be confirmed in the same block?

This cannot be guaranteed. They might or might not.

  consider the case when Bob sends all 10 bitcoins to Alice in one transaction and simultaneously issues another transaction to send Uncle Tom the same 10 bitcoins.

Bob's wallet will not allow him to double-spend. If Bob circumvents this, one of the transactions will be rejected by the network. In the worst case there may be a short period where it is unclear which transaction will win.

Each node in the network, whether a miner or a wallet will verify incoming transactions and mined blocks and will reject any that attempt to spend TXOs that are not UTXOs - i.e. which that node knows are already spent.

It can be that one miner selects the payment to Alice for inclusion in a block and another miner selects the payment to Tom. Other nodes will reject the second of such blocks that they receive, eventually the blocks with the most proof of work will be the only ones accepted, including by both miners.

Related questions:

How to return Tx to mem pool from orphan block
What's the longest chain of orphan blocks? (How many confirmations have been necessary?)
How is a blockchain split resolved?
Selfish Mining: stale or orphan?
Is there a correct way to refer to "orphan" blocks?

and

What is an "unspent output"?


Which is the better estimator for future mining intervals, the 10 minute protocol target or the observed, historical average?

For a good portion of its history the bitcoin network has seen continuous increases in difficulty, which warps the average block time to be below 10 minutes until the next difficulty adjustment. If the reverse were true the block time would be longer in kind.

This latency serves to protect nodes against isolation attacks where you could otherwise disconnect them from their peers and wait until their relative difficulty dropped to a suitable level for you to mine blocks at.

The best estimator of the interval is probably to look at the current window and make a guess as to the direction of change, but this is very error prone due to the low sample size of the block interval.


Redeeming physical bitcoin and transfer from mini private key to my wallet

Import it into a Blockchain.info wallet.

Or use the python script from: http://en.bitcoin.it/wiki/Mini_private_key_format#Decoding


What's the purpose of a maximum block size?

Why is this limit present?

1. To Maintain Consensus

There has to be clearly defined rules about which blocks are valid and which are not for the network to agree. Obviously no node will accept a block that is 10 million terabytes, it would be near impossible to download even if it were valid. So where do you set the limit? And what if one node sets their limit differently than other nodes on the network? If this were to happen, the network would no longer be in consensus about which blocks were valid when a block was broadcasted that met some nodes' size limits and did not meet others.

Setting a network limit on the maximum block size ensures that everyone is in agreement about which blocks are valid and which are not, so that consensus is achieved.

2. To Avoid (further) Centralization of Pools

Suppose we remove the 1 MB cap entirely. A large pool says to itself, "I wish I had a larger percentage of the network hashrate so I could make more profit."

Then they realize that since there's no block size limit, they can make a block that is 4 GB large by filling it with nonsense. They and a few other pools have bandwidth large enough to download a block of this size in a reasonable time, but a smaller pool does not. The tiny pool is then stuck trying to download a block that is too large, and continuing to mine on their previous block until they finish downloading the new block. This means the small pool is now wasting their time mining blocks that are likely never to be accepted even if they were solved, since they wouldn't be in the 'longest' chain. Since their hash power is wasted, the original pool operator now has effectively forced smaller pools out of the network, and simultaneously increased their percentage of the network hashrate.

3. To Make Full Nodes Feasible

Essentially, larger blocks means fewer people that can download and verify the chain, which results fewer people willing to run full nodes and store all of the blockchain data.

If there were no block size limit, malicious persons could artificially bloat the block with nonsense and increase the server costs for everyone running a full node, in addition to making it infeasible for people with just home computers to even keep up with the network.

The goal is to find a block size limit with the right tradeoff between resource restrictions (so that someone on their home computer can still run a full node), and functional requirements (being able to process X number of transactions per second). Eventually, transactions will likely be done off-chain using micropayment channels, but no such solution currently exists.

  When was it added?

This commit, from July 2010, shows the actual commit that added the MAX_BLOCK_SIZE parameter. The commit doesn't actually even mention that the max block size was added, strangely enough. I suspect that it was done as part of a release that fixed a critical bug, so Satoshi could be sure that everyone would upgrade.


Bitcoin will not open instead I see: error loading blkindex.dat

Close the client, go to C:\Users\(Your Username)\AppData\Roaming\Bitcoin and delete everything in the folder except for wallet.dat - do not delete wallet.dat under any circumstances (and empty your Recycle Bin), then restart the client. Somehow your block index file became corrupted.


Bitcoin mining may reduce the lifespan of my video card?

Heavy usage will certainly decrease the lifetime, but I think it's not incredibly much as long as it's not overclocked. You will probably even buy a new card (because the current becomes too outdated/slow) before the current one breaks down.

Keep an eye on the temperature for a few hours (or as long as it's not stable/maxed out), it shouldn't exceed about 75-80 °C. Otherwise you may want to invest on cooling, regardless of bitcoin mining (games also make the card warm). If it's at an okay temperature, you should be good.


The person hopes that the future ratio of how much money they can earn with a given hash power will be more favourable, so they enter a long-term contract.
The person wants to increase the hashrate of a mining pool they own, whether for test purposes or to attract more people with a high hashrate.
The person holds some other cryptocoins and wishes for their price to increase due to higher difficulty the extra hashing power would bring.
The person wants to mine coins, be they Bitcoins or otherwise instead of buying them at an exchange (one may not exist, or the person does not want to use it for some reason).
The person wants to do other activity that can use hashpower for. The person would need to make special arrangements with the owner of the rig, but it could be possible to use the hashpower for generating vanity addresses for example.
The person wants to launch a 51% attack on a smaller cryptocoin network.
To commit money laundering. Renting hashpower is not regulated under anti-money-laundering laws like the exchanges. On the other hand, the mined coins can't be traced back, so they can be sold at any exchange with ease.


Where do the majority of Bitcoin transactions take place?

Because bitcoin is a pseudonymous digital currency, there are no hard statistics available.

Because one popular service, SatoshiDICE, uses static Bitcoin addresses as the wagering mechanism for the players of its online "Dice" game, the amount of activity related to them can be measured.  It currently represents the majority of bitcoin transactions (but not value) that crosses the network.

Currently the Bitcoin network is hitting about 50,000 transactions per-day.  Some of these transactions will be performed for the purpose of mixing coins to protect the privacy of the sender.

By far the biggest interest in Bitcoin to-date (going from an educated guess) has been for speculative and investment purposes.  As such a large amount of the activity is transfer of funds to and from (and between) exchanges.

The ratio of this type of activity versus commerce involving digital and physical goods will heavily favor the speculative/investment but by to what degree is unknown as that data is not shared by the private parties who trade these goods and services.  If it were a ratio of 25:1, that would not be surprising to me.

While the ratios may change over time as bitcoin gains traction for more mainstream use, any use established at this early time will likely continue -- it will just represent a shrinking slice of a rapidly growing pie.


How Ripple actually transfer money from one bank to another?

I think it's necessary to first consider the question: Without ripple, how do banks "actually transfer money" from one bank to another?

Suppose that you and I are banks, and I want to send you $10 million. I'm probably not going to actually physically ship you $10 million worth of bills and coins. Instead, there are a few ways we could do this:

You and I privately agree that I now owe you $10 million. I don't send you the money, just an IOU. Next month you might want to send me $8, and so you just cancel $8 million of that IOU. We keep track of who owes who how much, but might never actually need to resolve it, since in the long run we're both sending a lot of money back and forth. This is difficult, however, because every bank has to maintain debt with every other bank.
You and I make an arrangement through a mutually trusted third party. I agree to owe them $10 million, and they agree to owe you $10 million. Later, someone else might send me $10 million the same way, negating my debt to the third party. A "wire transfer" in the US is just this, where the third party is the Federal Reserve.
You and I announce to a trusted third party that $10 million of my money should now be considered yours. This third party isn't a middleman who holds debt, like the central bank described in #2 - it simply keeps track of IOUs and regularly announces to all parties who owes who how much. The ACH system in the US (a.k.a. "Direct Deposit") works this way.

So, for the most part, bank's don't actually send money to each other at all -
 they just keep track of who owes who how much. Actually settling those debts, if it happens at all, has to happen outside of the systems above.

Ripple, as I understand it, can be thought of as a decentralized version of #3. It's basically a distributed public ledger of IOUs. (And those IOU's can themselves be traded as currency, when they're written by a trusted party.)


Without indication if your bitcoin.conf belongs to the client or server, I leave you some guidance on what to check:

Make sure your server bitcoin.conf has the following line:
rpcallowip=your.client.ip.address

Both server and client bitcoin.conf should contain the same rpcuser and rpcpassword lines
rpcuser=foo
rpcpassword=bar

Make sure your client bitcoin.conf has the following line:
rpcconnect=your.server.ip.address


BTC missing after strange negative transaction

It looks like, using just the 17nu address here:

https://longhorn.bullpay.com/?gateway=2&data=17nu7oViEtGCYaYwrKKVGyrs7jkcNwpVf2

Only 2 transactions occurred. This transaction:

https://longhorn.bullpay.com/?gateway=2&data=fae9171eea55eb69cbe73f8a23003f9267b71e5a7292d2bcd7b396a58aa82827

Resulted in the UTXO for 1 BTC to 17nu.

That UTXO was then used in this one:

https://longhorn.bullpay.com/?gateway=2&data=4837f44e4169f287ca6802c45ceab2dfef36ab7d8ecaa0eaebfa59ea6c76e17b

But it was combined with other transaction unrelated to the wallet. I'd say your wallet was compromised. Your transactions got bundled in with other UTXO's elsewhere not related to your wallet.

The address it was sent to:

https://longhorn.bullpay.com/?gateway=2&data=1NqJgMT4eLPycaD2i7T7xzbd9F9fycWE9u

had a flurry of activity on 5/6/14 within a 2 hour time period. In some cases with massive bundling of UTXO's. 34 inputs, 56 inputs. The transactions moving BTC from that wallet out left it with a zero balance.

Almost all of this funnels into address 17gH1u6VJwhVD9cWR59jfeinLMzag2GZ43:

https://longhorn.bullpay.com/?gateway=2&data=17gH1u6VJwhVD9cWR59jfeinLMzag2GZ43&grid-page=1

Which processed 17,990 transactions between March 2014 thru October 2014. The entire wallet was left empty with 120,347 BTC passing through it.

Either this address is used to launder BTC or simple as a convergence point for distribution. Either way this address is tied to a number of google search results in people getting hacked. Eg: https://bitcointalk.org/index.php?topic=754624.0;all

Final answer. You were hacked in some way.

Note: I added all the text in here to show how i traced his BTC from his address to an address known for hacking. This was to demonstrate how i came to the conclusion it was a hack and not an anomaly, software error, bug or something other.


0x30 is there it's '0' in ascii (second character in your bytes1)

>>> b'\x30'
b'0'

You also want to extract the signature from the scriptSig before passing it to a decoder, right now it contains both the signature and the public key.


Is Ripple's Contract language intended to be Turing complete or sub-Turing complete ?

It should be Turing complete. However, every time a contract is invoked, the maximum number of operations the contract can perform is limited. Operations that access a contract must specify an operation count limit to get a limit higher than the default. Higher limits require higher transaction fees.


Replay protection is only needed in the case of a Hard Fork.

To understand why this is true you should first understand what HF and SF are.

A great answer on the difference of Soft or Hard Fork can be found here


Bitcoin Core Re-install- Don't want to Overwrite Chain Previously Downloaded

The Snap (v.0.20.0) is having various issues, some of which are mentioned here.  As mentioned above, the Ubuntu PPA is saying that it shouldn't be used.  There is apparently a second PPA that is at least semi-official.  That works and doesn't overwrite my chain.


Why P2Pool fails to attract more users and other pools surpassed it?

Many of these are irrational, but this is the summation of feelings from the P2Pool thread on Bitcointalk. P2Pool would be preferable for decentralization, but without a larger share of the global hashrate it seems doomed to obscurity.

P2Pool has high latency, high variance payouts. You get paid as much on average as any other pool, but people generally appear to be uncomfortable about not getting a payout for many days. Centralized pools have more consistent payouts and lower variance.
P2Pool requires more than a bare minimum of support hardware. Miners usually have their own computers on board but they do not have enough power to run a Bitcoin node and P2Pool client, so miners need an external computer to run this software on. Regular pools are more convenient and do not require additional hardware.
P2Pool is actively hampered by bitcoin mining hardware that throw away valid blocks. The high announce rate of new work (30 seconds) means that a lot of common configurations throw away valid blocks that just happen to be stale P2Pool share chain blocks, effectively performing a block withholding attack against the network and lowering its productivity.
P2Pool is perceived to have lower luck.


BIP 84, BIP 173 Implementation in BitcoinJ

i don't think bitcoinj support BIP-173 but you can read more from
Bitcoinj repo

For Segwit
 Bitconj 0.14 branch is ~2 years old and has got no support for segwit at
all. For receiving on native Segwit addresses, you can use the master
branch. For receiving on P2WPKH-P2SH, I'm not sure. If master doesn't
work you can try the segwit branch (but that one isn't tested well).

  Warning: master currently has no support for spending segwit outputs.
  So only use testnet or really small amounts for now.


Is there an approach to exchange Bitcoin with formal currency with keeping anonymity?

You are possibly looking for a Bitcoin ATM or a private transaction with a cold wallet. There is no real anonymous way to exchange for fiat over the internet. Most exchanges have regulations from the government in place that require you to verify to fight money laundering. Also it would force you to verify a bank account that needs a name.


ERROR: ReadBlockFromDisk: Errors in block header at CBlockDiskPos(nFile=0, nPos=8)

It seems the -reindex parameter solves the issue.

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


Is RPC Miner still the preferred BTC mining software for a Mac?

Mining bitcoin with a CPU/GPU is now basically impossible, the network is secured by ASIC machines that are many orders of magnitude more efficient than a CPU/GPU miner could be. You could plug your Macbook pro into a mining pool, but you will literally just waste money on electricity, and get zero payout in return.

Not only that, Macbook Pros (or any other laptop for that matter) are not build to be run as hard as mining requires. You run a serious risk of damaging your computer, with basically no chance of reaping a reward.

You will literally have better odds buying a lottery ticket with the money you would spend on electricity.


32k Transaction Size, 0.0005 Fees. Will it ever be confirmed?

If you take a rule to spend 20 satoshi per byte you should spend 651380 Satoshi which is 4 times more than you provided in the transaction. It could be likely that you won't get confirmed by a miner, you could make a new transaction and put it through of course.

Both won't go through that's for sure.


Benchmark it and see, although be aware that bitcoind has never been optimized for handling thousands of accounts with hundreds of thousands of transactions. In particular, calls like 'getbalance' get slower the more transactions that are in the wallet.

Happily, there are now other implementations that claim to be better at handling lots of accounts/wallets/transactions.


Is there online tool to check if bitcoin transaction is bip-125-replaceable

getmempoolentry does it. However this is restricted to txes currently in mempool.


Why are imported private keys stored to addressbook instead to recieving wallet?

Yes, you can send coins to this new address.  If you restart your client you'll see the address will have moved to your receive list of addresses.

The new address initially posts in your address book because of the need to scan the blockchain for all transactions associated with that private key.  But you have to actually restart your client to move the address to your receive list of addresses.


Unconfirmed incoming transaction for a long time

The fees are quite low indeed. If you check the transaction instead of the address, you can notice that they are paying 51 Satoshi/Byte.

According to bitcoinfees.21.co, the recommended rate to get a transaction confirmed as soon as possible is around 220 Satoshi/byte nowadays.

So, what you can do is either wait until the transaction get confirmed, or spend the UTXO by creating a new transaction with a high fee, following a Child-pays-for-Parent (CPFP) approach.


How can I validate the amounts of these wallets (https://bitinfocharts.com/top-100-richest-bitcoin-addresses.html) on my bitcoin full node?

A wallet is not related to whether the blockchain has to be downloaded. The blockchain is not stored in a wallet. Rescanning does not redownload the blockchain unless you are using a pruned node.

To use importaddress, you must have a wallet. It cannot work without a wallet file. If you don't have a wallet file for some reason, starting Bitcoin Core normally (i.e. without any wallet disabling options) will have it automatically create a wallet for you. If you have a wallet and just want to import the address into another one, you can create one using the createwallet command. If you have another wallet file, you can move it to the Bitcoin data directory and load the wallet using the loadwallet command.

However loading or creating a wallet is not what you really want to do. You really don't want to import an address into your wallet; you really want to check if that address actually has the amount of Bitcoin that you see listed on a website. To do that, you can just use the scantxoutset command which was introduced in Bitcoin Core 0.17. It does not need a wallet and works way faster than a rescan. See it's help text (by using help scantxoutset) for how to use it.

What scantxoutset does is it scans the UTXO set for any UTXOs that match a given pattern. This will tell you what UTXOs are associated with an address or output script. From there you can sum their values and calculate the total available balance. This will give you the information you want to see without needing a wallet and without scanning the entire blockchain.


To answer the question , yes. If some one has access to your private keys, then it is easy to steal them and more or less there is no way to get them back.


Are there any Mining OS to be started from USB?

LinuxCoin is probably the closest thing to what you're looking for. According to the wiki, Linuxcoin is:

  A lightweight Debian-based OS which includes in the image everything
  that is necessary to run as a Bitcoin client and everything needed to
  get started mining on ATI hardware.

Edit: It may also be worth looking into BAMT if your operation is of significant size

Update: How things change... BAMT is now the de facto mining distro. I'm now having a difficult time even finding a live link to download LinuxCoin from and BAMT has gone from experimental to a full-fledged mining distro usable for nearly any scale. I highly recommend BAMT over LinuxCoin.


Programmatically, How does Bitcoin core differentiate transactions category?

Bitcoin Core has three types of transaction categories: send, receive, and move.

It differentiates between these as follows:

move - This tx is not an onchain one, and has no transaction id. It is simply moving BTC from one wallet account to another (accounts are not addresses, but groupings of addresses). This is done using the move RPC call
send - A send tx is one where an utxo from your wallet is used as the input to a transaction. This usually have a fee, since the fee is debited from the total sum of the utxos.
receive - A receive tx is one where a new utxo spendable (or watched) by your wallet is created. These don't have a fee as you don't pay anything to receive Bitcoin.

You can see the ListTransaction code here.


Bittrex API, generating a wallet address for XRP returns a tag but no address

No you're not allowed to have multiple addresses on Bittrex and by so a generated addresse will always be the same. You can confirm it


Thanks a alot - I found the solution:

This worked perfectly:

apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update sudo apt-get install bitcoin-qt


What's a good resource to learn how [technically] bitcoin works?

Take a look into the technical wiki pages: https://en.bitcoin.it/wiki/Category:Technical

For example, Technical background of version 1 Bitcoin addresses explains how Bitcoin addresses are generated, or the Protocol specification might help you as well.


What do all of the items in the output from p2pool mean?

P2Pool: 17401 shares in chain (9127 verified/17405 total) Peers: 11 (0 incoming)

This means that P2Pool knows of 17405 shares, 9127 of which have been verified (indicating that you haven't been running p2pool for more than 24 hours), and 17401 of which are in the selected chain (meaning that there have been 4 orphaned shares globally in the past few minutes).

Local: 1689MH/s in last 10.0 minutes Local dead on arrival: ~3.8% (2-8%) Expected time to share: 29.8 minutes

You have 1689MH/s mining, with 3.8% of shares invalid due to latency between P2Pool and the miner. It's expected that you'll get your next share in half an hour.

Shares: 3 (1 orphan, 0 dead) Stale rate: ~33.3% (6-80%) Efficiency: ~73.5% (22-104%) Current payout: 0.0174 BTC

You found 3 shares, one of which was orphaned (33.3% of them), indicating that your normal stale rate if you continue falls between 6% and 80%, with 95% confidence. Your efficiency is 73.5%, meaning that you'll only get 73.5% of what you should, based on your stales, though in the future, the true value will fall between 22% and 104% with 95% confidence, so there's no evidence currently that something is wrong (since 100% is in that interval).

Pool: 415GH/s Stale rate: 9.3% Expected time to block: 6.3 hours

The pool has a total of 415GH/s of hashing power, and 9.3% of discovered shares aren't integrated into the sharechain. It's expected that we'll get a block in 6 hours.


How to generate Electrum address with pybitcointools

Electrum's addresses will only start with 3 if you are using some sort of Multisig (i.e. you either have a Multisig wallet or are using the TrustedCoin 2FA thing). With Multisig, you will need to get the master public keys for the other signers in order to create the right addresses. If you do have those keys, then you can use the bip32_hdm_addr function to create those addresses.

Non-multisig addresses will start with 1, and that is what most wallets will create by default as multisig requires multiple parties.


Best way to get the entire bitcoin transaction history

There are two ways of doing that.
You can read blocks directly from the disk and process them or you can ask a Bitcoin client (like Bitcoin Core, for example) for the info via RPC calls.
The second way is easier but it may be slower.

For each block get all the hashes
 For each hash get details and write to your choice of storage

There are RPC call for each of the actions.
Just type help into the console in a Bitcoin client and you can see them all.


That said, when the next block is being mined, again the same person will win because of his computing power.

No. Higher mining power means just higher chances to mine a block.

If there are 3 miners:

Miner A with 4 Gigahashes per second
Miner B with 6 Gigahashes per second
Miner C with 1 Gigahash per second

Together, they can hash 11.000.000.000 times per second (4+6+1 gigahashes).
The probability for the first miner to win is 4/11 = 36%, the probability for the second miner to win is 6/11 = 55%, the probability for the third miner to win is 1/11 = 9%.

If miner B hashes the block, the next block can of course also be hashed by miner A, B or C.


How to handle VirWox transfers and invoices that expire quickly?

AFAIK VirWox is an exchange. You're trying to use it as a wallet. Since it isn't built to be a wallet, you're experiencing difficulties.

Instead, withdraw your bitcoins to a wallet after buying them on VirWox. Then use your wallet to pay your invoice.

You can find an overview of wallets here: Choose your wallet


What was your purchase amount set at? 0.03120000??

It would appear that you tried to buy at 0.03120000

however as there was a sell order already placed at 0.03116670 you filled that order first, then completed your buy with the rest of the amount at the 0.03120000


Bitcoin accepted charities or organizations

GiveBTC by the Bitcoin Foundation Canada / Bitcoin Embassy is the best directory I've seen.  Linked from the top of that page, they also have an excellent handbook for charities considering accepting bitcoin donations.

  I need to know the charitable bitcoin address. I mean that using payment processer, like bitpay, are not useful in my case.

I'm sorry to hear that.  Neither individuals nor organizations should be reusing addresses because it reduces their privacy and the privacy of all Bitcoin users they transact with.  Here's a related answer I wrote.


What is the command line command in electrum to get my public bitcoin address from my private key?

There is no cli command that can do this. You can do it via 3 methods:

In the Electrum GUI go to the view menu > show console and switch to the console tab. On the console tab type this:

bitcoin.address_from_private_key("<privkeyhere>")

Then once you have the address clear the console history or your private key will be saved to disk:

window.console.history = []

Another option is to simply import your private key into a new electrum wallet. File > new/restore, enter a unique filename and click next, choose to import addresses or private keys and then follow on-screen instructions for the rest.
OP has clarified that he wants to do this via bash so a third option is to write a custom python script:

#!/usr/bin/python3
from electrum import bitcoin
import sys
print(bitcoin.address_from_private_key(sys.argv[1]))

Put the above in a file and chmod +x it. Then run it with the private key as an argument. Obviously anyone else who runs ps on the same system at the same time will see your private key so this approach is not recommended.


Why unstuck transaction is sending again and again and how to solve this problem?

If you're running a new version of Bitcoin Core, you also have to delete mempool.dat when you try to remove an unconfirmed transaction, as it will be in the mempool as well.


How do you broadcast a transaction programatically?

You should not use an online service for broadcasting transaction. This online-service would have full control (censor?) over your transaction. The service could analyze your data behavior and/or decide to not broadcast your transaction regarding some rules.

Wladimir van der Laan (current bitcoin-core project maintainer) has written a neat tool: https://github.com/laanwj/bitcoin-submittx

Another option would be to install bitcoin-core, sync (takes serval hours and around 40GB traffic) and use RPC sendrawtransaction.


Pruning does not only keep the UTXO set. It also keeps the latest few hundred blocks, in order to assist with reorganizations.

Pruning was experimental in Bitcoin Core 0.11, and incompatible with the wallet. Since 0.12, it's a fully supported feature that works fine with the wallet.


Two out of Four transaction with excluding some key pairs

Out of curiosity, what's the use case for a configuration like this?

Is it possible to do this using the bitcoin scripting language? Yes, absolutely. Making it and actually having it included into a block is questionable, mainly because it would be a non standard transaction type.

There aren't really a lot of tools to help you do it, though. I can describe what the scripts would have to look like, but not sure how you would actually make such a transaction. This question might be of interest to you as well.

The assumed scriptSig, where we don't know what combination of signatures we have:

0 {sig1} {sig2}

The scriptPubKey would be a standard P2SH pub key script:

OP_HASH160 {hash} EQUAL

The redeemScript (in this P2SH transaction) might look something like:

3DUP 2 {A_pub} {B_pub} 2 CHECKMULTISIG DUP NOTIF
    3DUP 2 {C_pub} {D_pub} 2 CHECKMULTISIG DUP NOTIF
        3DUP 2 {A_pub} {D_pub} 2 CHECKMULTISIG
    ENDIF
ENDIF

I believe this would work, but if someone could check the logic of this script here, I'd appreciate it. The OP_3DUP is necessary because the scriptSig should have 3 items on it already (2 signatures and the OP_0 to satisfy the off-by-1 error in the original client), and those 3 items need to be used more than once.


What's the difference between PoW and PoS?

The following points try to simplify/abstract:

A cryptocurrency has its own blockchain to store all the transactions that occurred.
A proof of work/stake algorithm are different methods (or algorithms) to achieve consensus on which block will be added next to the blockchain
Proof of work (PoW) requires proof that work of some kind occurred. In the case of Bitcoin miners are required to do this work before any of their blocks is accepted by others.
Proof of stake (PoS) requires users that have a high stake at the currency (i.e. hold a lot of coins) to determine the next block. This has a high risk of some party achieving monopoly of the currency but there are several methods to prevent that (by allocating random stakeholders to agree on a new block, and others).

The main difference could be summarized in that proof of work requires burning an external resource (mining hardware) while proof of stake does not. Proof of work could be criticized that if price/bitcoin rewards/fees drop then less people have incentives to mine thus the security of the system is reduced. Proof of stake could be criticized that since it is free to stake/add new blocks to the blockchain you could use it to stake several similar coins at the same time (see "nothing at stake" problem in PoS link above).

Examples:

Bitcoin, Litecoin and many others uses the PoW method.
NXT, BitShares and others uses the PoS method.
Ethereum uses PoW but is scheduled to change to PoS.
Peercoin uses a combination of PoW and PoS.


What is the best method of getting the originating address of Bitcoin transaction?

"Originating address" is not a valid concept in Bitcoin.

Some sites (like Satoshi Dice) try to make an educated guess but they might as well be throwing darts blindfolded.

The only safe way to refund Bitcoins is to explicitly obtain a refunds address from whomever you're accepting a payment from.

Anything else you do is going to break sooner or later when a customer pays you via a type of wallet or transaction which you weren't anticipating.

"Break" here means sending funds to the wrong entity, or even worse: permanently losing them by sending to an address for which no private key exists.


What does "proof of reserves" and "proof of liabilities" mean?

Proof of reserves: This is proof that you actually control at least a particular amount of particular assets.

Proof of liabilities: The is proof that you do not owe more than a particular amount of particular assets.

So, for example, if an exchange can prove that it has reserves of 15,000 Bitcoins and that its owes its customers no more than 14,500 Bitcoins, then it has proven that its Bitcoin holdings are solvent.


Is there any guarantee that mining will be profitable?

There is no guarantee of profitability for any miner. What's more is that it is extremely difficult to estimate how profitable it will be because there are unpredictable variables involved. The mining difficulty is regularly re-targeted to account for increased mining power. The market exchange rate for BTC into dollars (or whatever currency your electricity bill is presumably paid in) fluctuates wildly, and the value of fees paid by users varies depending on mempool size or speed they wish to have confirmations. These variables are entirely out of anybody's control because they're a result of the actions of individuals.

Mining has been largely profitable due to the block subsidy which halves every 4 years. There is no guarantee that mining will remain profitable for existing miners when the next subsidy halving occurs (in 2021). If mining becomes unprofitable for them, they will have to scale back their operations or shut down and auction off their mining equipment. This will cause the difficulty to lower temporarily, which may make it profitable for new market entrants willing to take the risk.

Ultimately, mining is a risk-taking business and may never pay off. There are some obvious ways to try and increase your chance of becoming profitable though: Find the cheapest source of electricity you can and get the most efficient mining hardware for your price point.


When does the Ardor - NXT to Ignis snapshot occur and which exchanges support the snapshot?

No set date for release yet but with in the next few months. 1NXT will get you 0.5IGNIS.


you must describe you bitcoin.conf , default was home folder user  .bitcoin

here i have some example BSV script for change defaut values such location wallet data block and etc.

example script manage blockchain

you can check in bsv folder there was running custom script and example config .


Hard time distinguishing change and withdraw amount for P2SH address

It is not possible to discern with absolute certainty which output is a 'payment' and which is the change address (I put payment in quotations because a transaction does not always represent a transfer of coins between two parties, sometimes it might just be someone moving coins to a new wallet they also control, for example).

Sometimes it may be possible to make an educated guess based on input/output values, but this is not always the case. In fact, some wallets may be designed to intentionally obfuscate this data, in an effort to maintain user privacy.

Unless I am misunderstanding your question, there is no difference between P2PKH and P2SH in this regard. The bitcoin address and payment amount is clearly listed for each output in the examples you provided.


Transaction marked as "Newly generated coins" on Blockchain.info

No inputs means that the coins are coming from a coinbase transaction, that is, they were only moved "once", when they were created.

Transactions will have different numbers of confirmations based on how recently the funds were moved.


Is there a class or sequence diagram for BitcoinCore?

You can use source code browsing tools like Source Insight(proprietary) or doxygen(Free software) to create dependency diagram of functions and files.

The doxygen documentation for Bitcoin source can also be found at https://dev.visucore.com/bitcoin/doxygen/


Without verifying the transactions themselves, there's no guarantee that the transactions you get from either method are valid. Nodes can lie about what transactions they have in their mempool, for example, and send you gibberish. On the flip side, nodes also don't have any obligation to send you transactions that they have. There are non-standard transactions, for example, that many nodes simply don't relay, so you have no way to find out about them, but they may still get mined in the next block.

In order to actually verify unconfirmed transactions, you're going to need to be a full node with the entire blockchain stored so you can validate them yourself. There are no guarantees about the behavior of any other node on unconfirmed transactions and assuming that they're valid is simply not a good thing to do from a security perspective.

That said, if you want the largest set of unconfirmed transactions possible, the easiest way is to connect to as many nodes as possible and get whatever transactions they have in their mempools. The bitcoin network protocol has a lot of very useful commands for this purpose that you can create. Of particular interest are the inv and getdata commands.

Of course, that's exactly what bitcoind already does and it verifies all the transactions to boot, so you'd really honestly be duplicating that exact same function. The big optimization opportunity here would be mostly on choosing the best peers that somehow are "most informed" about unconfirmed transactions.


In your example, if block 99 actually did hash to the same exact value (infinitesimally unlikely), then there is nothing that distinguishes it from the actual block 99, so it would not be considered fake, and would not be propagated because it already exists in the inventory vector. The property of the hashing functions used to create the block hash would prevent this because without the same exact data, it will not result in the same block hash. See Digital Fingerprinting.

The block hash is created by creating a hash of all of the transactions (using a merkle tree), and hashing that along with the other meta data in the block header. Changing a transaction (even just the order of the transactions) will change the merkle root, and thus change the block hash. See https://en.bitcoin.it/wiki/Block_hashing_algorithm


multiple parties to sign a transaction before being broadcast (or after, but either way be associated with)

You could do something along those lines:

Create a transaction to a multisig address with private keys that the different parties control.
The parties sign a transaction having for input that multisig (which shows they agreed and signed) and for output the OP_RETURN.


Blockchain Tools for Voting Among Small Groups?

Blockchains are a bad solution for voting, and in my opinion the widespread interest in using them for this purpose is misguided.
One of the important properties of a voting system is making sure that it is impossible for a voter to prove after the fact what vote they cast, in order to avoid vote selling or intimidation. Because of this, systems that do allow voters to prove what they voted for are in fact outlawed for government elections in many jurisdictions.
The property you want is auditability (individual users need to be able to check their vote was counted, and verify that the tally was computed correctly), but that doesn't require publication. A blockchain is however inherently a publication mechanism, and systems that rely on a blockchain to tally votes imply that everyone can see all votes.
In practice, modern cryptographic voting systems (see E2E auditable systems) actually have very good properties, without the need for publication. They rely on a central server which can see the IP addresses of the voters (but can't see the encrypted votes, and Tor can conceal IPs), let a group of trustees jointly decrypt the resulting tally, and let individual users verify after the fact that their vote was included in that tally.
But isn't that centralized? Yes it is. But decentralization is only a means to achieve a goal. In Bitcoin, we need decentralization as it's the only alternative to having a central party with transaction censoring rights. In a voting system, having a central party who can censor encrypted votes is typically preferable to allowing the whole world to see your vote (and still allow a 51% majority to censor and thus influence the outcome).
I also recommend reading Ben Adida's blog post on the matter: https://benlog.com/2017/12/28/blockchain-and-voting/


Why there is no block index or block height included in the block header?

The chances of two blocks having the same hash are extraordinarily low. Having the same hash would essentially ensure that they must be the same block (two copies of the same block with the same transactions at the same height with the same ancestor).

While the blocks themselves do not contain the height, most full node software keeps track of the height of each block. In Bitcoin Core you can use getblockchaininfo to see how many blocks your node has or, getblockcount to see how many blocks your node knows about.


To mine the testnet genesis block you would use.

python genesis.py -z "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" -n 414098458 -t 1296688602

If you want to create a new genesis block run the following with your own time and leave out the nonce, you will be generated a new nonce.

python genesis.py -z "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" -t 1501755824

Here is what I get when running the above command, it will just take some time to find a block.

python genesis.py -z "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" -t 1501755824
04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73
algorithm: SHA256
merkle hash: 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
pszTimestamp: The Times 03/Jan/2009 Chancellor on brink of second bailout for banks
pubkey: 04678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5f
time: 1501755824
bits: 0x1d00ffff
Searching for genesis hash..
183984.0 hash/s, estimate: 6.5 h
nonce: 835054047
genesis hash: 00000000ad3d3d6aa486313522fdd4328509feefe8c37ead2a609884c6cbab92

To add your new genesis block to the Bitcoin testnet update the src/chainparams.cpp file, also delete any checkpointData entries on the testnet as those no longer apply to your new testnet chain.


How to verify signed bitcoin messages on my own website?

You don't need all of bitcoind just for this functionality. Look at the code on the brainwallet.org page you posted: http://brainwallet.org/js/bitcoinsig.js

It seems like you could take this exact code and implement it on the server-side with a JavaScript interpreter such as node.js.

It depends on the programming language you're using but I'm sure this functionality is available in most of the bitcoin libraries: https://en.bitcoin.it/wiki/Software#Libraries


Three different HEX having same wallet address how possible?

Private keys are 256-bit numbers. The first "HEX" you list has 64 characters, which corresponds to 256 bit, while the other two have 66 characters. Since all three share the same first 64 characters, I surmise that the library you're using simply drops the additional data beyond the first 256 bit.


Could cryptocurrency "insurance" slow Bitcoin adoption?

If anything, I believe the ability to buy insurance on cryptocurrency investments would speed up adoption by making it less risky to traditional investors.  Simply having insurance available doesn't mandate that everyone buy it; we'd all still have the choice whether we opt-in or not.

Traditional investments tend to have insurance policies on the insurance policiy of the insurance policy of the initial investment.  While it's a somewhat yucky business, it's also a standard practice in today's financial ecosystem.  Having these options available for bitcoin only strengthens bitcoin's value proposition and familiarity to traditional investors.


Why would a Bitcoin miner take less than the full reward?

Likely you're correct, it's not useful in practice. People could, however, use value destruction as an costly signal.

Voting example; I run a poll of mining pools; number of Satoshis less than the full block reward, up to 5, is the vote for which of 5 proposed algorithms to run in the future. Once a majority of blocks over some time period vote for option X, everyone agrees to switch protocols. (This could allow identityless voting by miners.)

Commitment example; A miner can "promise" something, and commit the value destroyed as a signal that they are willing to do it. If a miner wants to extort the network, such commitment could be effective in showing that they are serious.


How does bitcoind generate a new address if the wallet is encrypted

It gets it from the keypool, which has 100 pre-generated addresses by default.  The next time you enter your passphrase, it will refill the pool with new addresses.

Here's an example that shows the pool running out, and refilling when the password is supplied.  The following commands were performed by a trained professional.  Please don't try this at home (especially the first 2 commands):

$ cd ~/.bitcoin
$ rm wallet.dat
$ bitcoin-cli -daemon -keypool=5
bitcoin server starting
$ bitcoin-cli encryptwallet mypass
wallet encrypted; bitcoin server stopping, restart to run with encrypted wallet
$ bitcoin-cli -daemon -keypool=5
bitcoin server starting
$ bitcoin-cli getnewaddress
1Bf6TrgiBxzZhdtEWZuWuREkbfoAtmZ5xa
$ bitcoin-cli getnewaddress
1JzjmeH1LHzJ5JYzUu3wh36N7LWvfVeB2u
$ bitcoin-cli getnewaddress
1sjVdVJAAWB6JTsja4nEVezdnqiE6Ko3V
$ bitcoin-cli walletpassphrase mypass 3600
$ bitcoin-cli walletlock
$ bitcoin-cli getnewaddress
1DVZHRNbdBivqRKzas7iFT8emsb8EtcJT1
$ bitcoin-cli getnewaddress
1HBXkVkWCVhntzgkxdb9hnUxNeMdFqVssQ
$ bitcoin-cli getnewaddress
18n17UHshaufcufo5z1PBPAdErPWxesBhs
$ bitcoin-cli getnewaddress
1CofrGkqWrAmibBUgtLysknXdsBpDJARTs
$ bitcoin-cli getnewaddress
1NwWuba3khc31ebZU8fVAept2MDdnSndgV
$ bitcoin-cli getnewaddress
16QVdikDatH2FkQNkrRgGXrQ9LbEooHAPF
$ bitcoin-cli getnewaddress
error: {"code":-12,"message":"Error: Keypool ran out, please call keypoolrefill first"}
$ bitcoin-cli walletpassphrase mypass 3600
$ bitcoin-cli walletlock
$ bitcoin-cli getnewaddress
1BSDX4PiHKvdssjAzDLVACAAQvwiijmETV
$ bitcoin-cli getnewaddress
1JJphgnC5gqunLtbbLAwtN8LXRnCUYWARm
$ bitcoin-cli getnewaddress
17UJqrpuakgPPuxPTLa8LeeWVAKijZW66x
$ bitcoin-cli getnewaddress
16itq5LpuwyhtfbiHbQxVzJYYdGE7nQRoz
$ bitcoin-cli getnewaddress
1QA4EnXPUHquK9WBxBppicfBTD2gYTB9ic
$ bitcoin-cli getnewaddress
12bgaABsakRouK9NZyUAK1RAD9nmDtHQKa
$ bitcoin-cli getnewaddress
error: {"code":-12,"message":"Error: Keypool ran out, please call keypoolrefill first"}
$


I'd check out the python library Coinkit - it's for generating cryptocurrency wallets (Bitcoin, Namecoin, Litecoin, Peercoin, Primecoin, Dogecoin and a bunch of others are currently supported).

Just do "pip install coinkit".


How does Multi-Signature Pay 2 Script Hash (P2SH) enable stronger security?

Multi-signature is a feature to protect against theft.

From securing your wallet

  Bitcoin includes a multi-signature feature that allows a transaction
  to require the signature of more than one private key to be spent. It
  is currently only usable for technical users but a greater
  availability for this feature can be expected in the future.
  Multi-signature can, for example, allow an organization to give access
  to its treasury to its members while only allowing a withdrawal if 3
  of 5 members sign the transaction. It can also allow future online
  wallets to share a multi-signature address with their users, so that a
  thief would need to compromise both your computer and the online
  wallet servers in order to steal your funds.

Traditional Bitcoin addresses are secured with a single private key. P2SH addresses can associated with three private keys. Depositing funds into is the same as depositing funds into a standard Bitcoin address. However, withdrawing funds from the address requires at least 2 of the 3 keys to sign.


How can I sell my Bitcoin Gold? Do any exchanges support BTG deposits?


Dividends do indeed go into your GLBSE account balance, which you can withdraw to a Bitcoin address if you so wish. (Source)


Unclear on double-hashing previous Transaction when creating a new Transaction

I've figured it out.

So in this case (and if you look up a previous transaction on sites like blockchain.info) the transaction ID is already the double-hashed transaction. The input to the new transaction is just the reverse of the transaction ID.

So my previous transaction starts:
90 72 c9 13 ...

and the full transaction created by coinb.in ends in:
... 13 c9 72 90


Can I cancel a transaction that has not been successfully broadcast yet?

I did a trick back in the day when I send btc I did not mean to. If you have a backup of your wallet then load this up on a new machine and u can send the coins from that address to another, thus double spending and voiding your initial first transaction. So long as first transaction has not been broardcast then this should be possible.