Unable to sweep account using WIF, Green wallet says "No UTXO found" I am trying to learn the process BTC transactions.
In the process, I generated

Private key : 82e8034869c77744655899d450f9fe2f01fad030bf8af4ea75b310d1a140f554
Corresponding address generated : 2MwVArnwmXQokkhn61Dgi68LnxBEuM1SrxN
WIF : 93NdjSVUcd172o55kErspBPn8jARKq4veeb3pVZyoTSa49bqnpU
Transaction : https://live.blockcypher.com/btc-testnet/tx/8c8140845faef14f860147fcd774355af665098c89cd35b59efee5c8efef3b66/

When I try to sweep using the WIF into Green Wallet by BlockStream, it says No UTXO found. Help me understand what exactly am I doing wrong here.

That WIF private key does not correspond to that address. Not even if you convert the key to its uncompressed format.

That hex private key does not correspond to either the address or the WIF private key.


Do I need an app and internet on my smartphone to enable a Lamassu ATM to detect and scan my QR code? I want to send bitcoins to a friend through a Lamassu ATM. She has emailed me her request QR code and when I went to the Lamassu ATM point, after pressing on the start button and  showing the QR code on my smartphone, nothing happens. I learned that the atm is supposed to scan the QR code and send bitcoins to the request QR code after putting in cash.
I am wondering, if I may need an app or internet on my smartphone to enable the Lamassu ATM to detect and scan the QR code on the phone screen.

You don't need internet or an app. Actually, the machine can either scan a paper QR code or a mobile phone.

The problem would either be that the QR code encodes different information than what you thought it does, or that the scanner of the ATM does not recognize the QR code on the screen. What you need to show is a Bitcoin address.

Try to set your screen to full brightness, be sure not to block any part of the screen when presenting it, and check whether the QR code actually contains a Bitcoin address, and not something else such as a private key or payment request.


Failed to start bitcoind using Ubuntu 20.10 I keep getting this error when I run sudo systemctl start bitcoind.service
Job for bitcoind.service failed because the control process exited with error code.
See "systemctl status bitcoind.service" and "journalctl -xe" for details.
When I input sudo journalctl -xe I get this.
░░ The job identifier is 6033.
abr 15 16:16:36 sats-desktop bitcoind[7207]: Error: Error parsing command line arguments: Invalid parameter -daemonwait
abr 15 16:16:36 sats-desktop systemd[1]: bitcoind.service: Control process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░
░░
░░ An ExecStart= process belonging to unit bitcoind.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
abr 15 16:16:36 sats-desktop systemd[1]: bitcoind.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ ░░ The unit bitcoind.service has entered the 'failed' state with result 'exit-code'.
abr 15 16:16:36 sats-desktop systemd[1]: Failed to start Bitcoin daemon.
░░ Subject: A start job for unit bitcoind.service has failed
░░ Defined-By: systemd
░░ ░░ A start job for unit bitcoind.service has finished with a failure.
░░
░░ The job identifier is 6033 and the job result is failed.
abr 15 16:16:36 sats-desktop systemd[1]: bitcoind.service: Scheduled restart job, restart counter is at 5.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support:  ░░ Automatic restarting of the unit bitcoind.service has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
abr 15 16:16:36 sats-desktop systemd[1]: Stopped Bitcoin daemon.
░░ Subject: A stop job for unit bitcoind.service has finished
░░ Defined-By: systemd
░░ ░░ A stop job for unit bitcoind.service has finished.
░░
░░ The job identifier is 6113 and the job result is done.
abr 15 16:16:36 sats-desktop systemd[1]: bitcoind.service: Start request repeated too quickly.
abr 15 16:16:36 sats-desktop systemd[1]: bitcoind.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░
░░
░░ The unit bitcoind.service has entered the 'failed' state with result 'exit-code'.
abr 15 16:16:36 sats-desktop systemd[1]: Failed to start Bitcoin daemon.
░░ Subject: A start job for unit bitcoind.service has failed
░░ Defined-By: systemd
░░
░░
░░ A start job for unit bitcoind.service has finished with a failure.
░░
░░ The job identifier is 6113 and the job result is failed.
lines 1841-1894/1894 (END)
When I input systemctl status bitcoind.service I get this:
bitcoind.service - Bitcoin daemon
Loaded: loaded (/etc/systemd/system/bitcoind.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2021-04-15 14:13:16 CEST; 21min ago
Process: 5604 ExecStart=/usr/local/bin/bitcoind -daemonwait -pid=/run/bitcoind/bitcoind.pid -conf=/home/sats/.bitcoin/bitcoin.conf -datadir=/home/sats/.bitcoin (code=exited, status=1/FAILURE)
abr 15 14:13:16 sats-desktop systemd[1]: bitcoind.service: Scheduled restart job, restart counter is at 5.
abr 15 14:13:16 sats-desktop systemd[1]: Stopped Bitcoin daemon.
abr 15 14:13:16 sats-desktop systemd[1]: bitcoind.service: Start request repeated too quickly.
abr 15 14:13:16 sats-desktop systemd[1]: bitcoind.service: Failed with result 'exit-code'.
abr 15 14:13:16 sats-desktop systemd[1]: Failed to start Bitcoin daemon.
~
Some idea how can I solve the problem??

Seems that you have an error in bitcoind starting options, you have -daemonwait instead of -daemon, you can check with systemctl cat bitcoind.service
The file to edit should be /etc/systemd/system/bitcoind.service


How does a miner create a transaction input to spend tx fees? I'm wondering where does a miner get an input for a transaction that spends the tx fees received from mining a block? It's not out of the coinbase transaction.

The transaction fees in a block are included in the coinbase transaction, which is a special type of transaction in that it does not have any inputs.

The value of the coinbase transaction’s output can be up to:

Current block reward + (sum of all inputs in the block - sum of all outputs in the block)

Claiming more than this will result in the block being invalid, but claiming less than this is allowed (though probably not in the miner’s best interests!)


How to access Latest Transactions using the Blockchain.info api? I'm new in bitcoin, I just want to return json scrutucture from latest transactions from time to time.

I couldn't figure by searching their reference, I think it requires a level of knowledge in bitcoin I don't have yet.

I just wanted to return plain vanilla json array

thanks

First of all, there's no way for blockchain.info to know which transactions you have and don't have if it's not in a block.

You can get the full list of transactions not yet in a block using this call:

https://blockchain.info/unconfirmed-transactions?format=json

Otherwise, you can get a continuous stream of new transactions using the websocket API:

https://blockchain.info/api/api_websocket

You can subscribe to unconfirmed transactions by connecting via websocket to

wss://ws.blockchain.info/inv

and sending this:

{"op":"unconfirmed_sub"}

That socket will receive every transaction that blockchain.info receives.


Using the output of listtransactions how can I calculate the balance of certain addresses? I have a JSON array of the transactions from the listtransactions call.
How do I calculate the balance of addresses?

My plan. Add up the amounts from all transactions of the receive category for a given address and filtering out transactions that have less than the minimum required confirmations. Is there anything I'm missing or any gotcha's here.

How do I calculate the balance of addresses.

You don't.

There is nothing interesting about the balance of an address.

You may care about how much money you have in your wallet overall; for that, there is the getbalance RPC call.

You may also care about whether a particular payment was received (identified by the address you gave out for that particular invoice). You can use the getreceivedbyaddress RPC.

  Add up the amounts from all transactions of the receive category for a given address and filtering out transactions that have less than the minimum required confirmations. Is there anything I'm missing or any gotcha's here.

That will work, but essentially do the same as getreceivedbyaddress. It won't give you a balance, just how much was received.


What is the purpose of Merkle Tree in blocks? The leaves of the Merkle Tree has the hash of the transactions. How are transactions stored in the block? What is the purpose of Merkle Tree.

Btc wiki: Merkle Trees

A Merkle tree is a hash function value which can be used to validate that every piece of information in a block can be authenticated, in this case, it validates that for each Tx and its hash value, it has not been tampered with in any way, shape or form.

Let's use an analogy: assume we have a file cabinet of files, each file in numerical order. Now, assume each file is sealed with a wax stamp, and each wax stamp has the date spelt in words. If we changed the date at all, the words make it so there's no longer a match (1==>7 is easily done, but not one==>seven!). So we're sure each file (Tx) is legit. Now assume the filing cabinet has the sum of the number of letters used in those words on the Txs' stamps. Any change that was made, say one==>seven has changed the sum of the letter, since seven is two letters longer than one. This is a simplistic analogy of how hashes can easily authenticate a piece of data.

Furthering the analogy, each block (filing cabinet) has a combination lock which references the block (filing cabinet )before that. So minor changes in even one single letter of a single Tx in a single filing cabinet (block) will invalidate whole system.

I recommend looking into the Wikipedia cryptographic hash entry to get a deeper understanding, or books like Mastering Bitcoin


where can I get realtime ticker data for robots? I am writing a trading bot and concerned about rate limits.

I need realtime notifications for change in price either like a PUSH api service.

Bitfinex appears to be the only major exchange that offers PUSH notifications, so I am not concerned with Bitfinex. But all other major exchanges such as Kraken are of concern.

How can I get realtime ticker data for the major bitcoin exchanges?

Poloniex has a PUSH API, check their API FAQ here: https://poloniex.com/support/api/

The other API requests they have said to have 6 request/sec rate limitation, which in my opinion is still pretty close to real-time if you update the Ticker this way.

Kraken does not provide PUSH API, from their FAQ it looks like a normal user (Tier 2) has a limitation on ticker of 1 request per 3 seconds (0.33 request/sec), but will be blocked for 15 minutes when exceeded.

Coinbase has only a PULL API with a 10,000 request per hour (2.7 request/sec) based on their Developer guide, although they operate a separate business called GDAX which has a WebSocket based real-time API.


I sent myself a test BitCoin, now what? I don't see it, how long do I wait? I just created this, sending myself 0.01 BitCoin:

https://tbtc.bitaps.com/b3e8e7dbe13c9939fc3157bef7725282d12594a0e8d14fa73493624ae394f314/mqRkjQjSCCVmsmBzsEQYhwCHEdz9dXRUwW

I've waited for 5 minutes so far and have been checking but nothing:

$ bitcoin-cli -testnet getwalletinfo
{
  "walletname": "",
  "walletversion": 169900,
  "balance": 0.00000000,
  "unconfirmed_balance": 0.00000000,
  "immature_balance": 0.00000000,
  "txcount": 0,
  "keypoololdest": ...,
  "keypoolsize": 999,
  "keypoolsize_hd_internal": 1000,
  "paytxfee": 0.00000000,
  "hdseedid": "...",
  "private_keys_enabled": true
}
$ bitcoin-cli -testnet getbalance
0.00000000
$ bitcoin-cli -testnet getunconfirmedbalance
0.00000000

The transaction has more than enough confirmation, so if it doesn't show up, it's probably because your node hasn't catch up with the network yet.

Watch out though, looking at the numbers in your comment up there, the block height is the mainnet one, testnet figures would be a lot higher. Your transaction has been mined on block 1,584,207.

If this is so, it's totally normal your transaction doesn't show up in Bitcoin Core as they are two distinct networks. You should turn off your node with bitcoin-cli stop, and turn it back on on testnet with bitcoind -testnet. It might take some time if your node need to sync on testnet (but it's usually far faster than mainnet).


Why are miners allowed to change a tx id? BIP 62 proposed to make transaction malleability impossible.

Why was this retracted and why are miners allowed to change a transaction id?

Also, what does it mean when someone says signatures cannot sign themselves?  Is this implying we not only need a signature for the transaction, we need another signature for the transaction + signature?

BIP 62 proposed to make transaction malleability impossible.

No it didn't. It would have outlawed a limited number of known and addressable forms of malleability.

In particular, it did not prevent multisig transaction participants from just creating a new signature, malleating the transaction without invalidation. This type of malleability is trivial to perform, and breaks nearly every smart contract construction imaginable.

BIP62 was retracted because while it addressed some forms of malleability, it didn't and couldn't fix an equally bad one.

Instead, Bitcoin adopted BIP141 (Segregated Witness), which does not remove malleability, but makes it harmless. The transaction signatures just don't contribute to the txids anymore. Thus, while it is still possible to malleate transactions, doing so does not invalidate dependent transactions (as they refer to previous transactions using the txid). Other than BIP62, this solution applies to multisignatures as well, and also against all forms of non-discovered malleability.


Loading to Bitcoin wallets I've downloaded some bitcoin wallets because I am planning to load some amount in it using my ATM. But I don't know how. Will somebody help. How can I have some bitcoins in my wallet?

Firstly

Read

Help
I am new to Bitcoin, how can I get started?
How do you obtain bitcoins?
Can bitcoins be traced to scammers
scam with blockchain

Bitcoin "ATM"/BTM

Scrutinise "ATM" for fees etc to determine exactly how much BTC you will receive.

Open your wallet. Click the Receive button. Enter appropriate details (all aptional). Click the Request Payment button. Carefully write down or otherwise record the generated address. Details depend on exact wallet used.

Follow the "ATM" instructions and make sure you tell it to pay to the address generated by the wallet. You may need to type in the address or will be able to scan the QR-code.

Fiat ATM

Use a service like "local bitcoins" to find someone willing to swap your local currency for BTC.

Consider what you will do if the BTC don't show up for a few days (or never).

Meet them. See above re generated address. Give them your money and the generated bitcoin-address.

Hope they are honest.

Either

Take a careful note of the Transaction Id

After the transaction, wait half an hour and see if your wallet shows the amount of BTC you expected. If not, check your wallet is synchronised and/or wait a couple of hours.

Try doing a web-search for "blockchain explorer" and type in either your receiving address or the Transaction Id.


Ubuntu Linux -- How do I start bitcoind as a service to run automatically? I've got a bunch of other services set up to boot automatically when my Ubuntu server starts (services like wicd-daemon and VPN), but I can't figure out how to set up the bitcoin daemon (bitcoind) to start automatically when the system boots up. (This is on a headless system with no GUI or attached monitor.)

I'm trying to learn how to integrate bitcoin with Python so I can write bitcoin-enabled services, but I want the system to automatically start bitcoind when the system boots so that I don't have to do it manually. (It's a pain in the butt to have to download a whole bunch of block-chain at once. It eats away at uptime.)

If this question has already been asked, please direct me to the answer. I searched but couldn't find it. Otherwise, please help me figure this out!

Thanks so much.

EDIT: Caveat emptor on Ubuntu distributions from 14.10 and forward - init was chosen over upstart and is being phased in the future. I don't know when that will be done nor what impact it will have on upstart scripts.
Extract from the page RentFree refers to; note that it assumes that you have created a user called bitcoinuser for the sake of security:

For those running ubuntu, you may be familiar with upstart, a replacement for sysvinit style booting (/etc/init.d/*).
Configuration files for upstart are stored under /etc/init/*.conf. I've written the following one for bitcoind:
description "bitcoind"

start on filesystem
stop on runlevel [!2345]
oom score -500
expect fork
respawn
respawn limit 10 60 # 10 times in 60 seconds

script
user=bitcoinuser
home=/home/$user
cmd=$home/bin/bitcoind
pidfile=$home/bitcoind.pid
# Don't change anything below here unless you know what you're doing
[[ -e $pidfile && ! -d "/proc/$(cat $pidfile)" ]] && rm $pidfile
[[ -e $pidfile && "$(cat /proc/$(cat $pidfile)/cmdline)" != $cmd* ]] && rm $pidfile
exec start-stop-daemon --start -c $user --chdir $home --pidfile $pidfile --startas $cmd -b -m
end script

Put the above configuration in /etc/init/bitcoind.conf, then run sudo initctl reload-configuration. To start bitcoind, run sudo start bitcoind. To stop bitcoind, run sudo stop bitcoind.
You'll probably want to change the user, cmd and pidfile to something that matches your configuration, or you can use the following as a template:
/home/bitcoinuser
/home/bitcoinuser/bitcoind.pid
/home/bitcoinuser/bin/bitcoind

Though one user suggests the following correction to the configuration:

home=/home/$user
cmd=/usr/bin/bitcoind
pidfile=$home/.bitcoin/bitcoind.pid

and another suggests setting nice for the process so it doesn't hog the CPU

exec start-stop-daemon --start -c $user --chdir $home --pidfile $pidfile --startas $cmd -b --nicelevel 15 -m


PHP Coinbase Callback POST I've a problem with the callback.
The post data is not right, because the users cents is not update.

My Code:

    public function bitcoin($secret) {
        if($secret == App::Config(ROW_CONFIG_COINBASE_SC)) {
            if($_POST) {
                $total = User::Get($_POST["custom"], FIELD_USERS_CENT) + $_POST["total_native"];
                User::Set($_POST["custom"], FIELD_USERS_CENT, $total);
            }
        } else {
            die("error");
        }
    }

the post data:

{
    "order {
        "total_btc":{"cents":269800,"currency_iso":"BTC"},
        "total_native":{"cents":100,"currency_iso":"EUR"},
        "total_payout":{"cents":0,"currency_iso":"USD"},
    }
}

You're not accessing the post data correctly.

$data = json_decode(file_get_contents("php://input"))['order'];
$total = User::Get($data['custom'], FIELD_USERS_CENT) + $data['total_native']['cents'];
User::Set($data['custom'], FIELD_USERS_CENT, $total);

See also.


Unconfirmed Transaction - Paid Fees wondering if anyone can help me.  I moved funds from one wallet to another with transaction 582386d5b5480804535cf382727ab72b9a09dd1435b3444f18c20617d3198a65.  Fees were dutifully paid by my wallet.  I've never had a transaction take more than an hour or two to confirm if fees are paid.  Says it spent unconfirmed inputs?  Anyone know what it is, and how to get my money back if it does not confirm?

Thanks much!

Perhaps this is due to the "malleability attack" that was going on; it can be that the transaction has gone through with a different transaction ID.  It would be easier if you disclose the input and/or output address.


Relative licensing restrictions of Ethereum and other projects- Open Source? Is Ethereum open source?

I've heard different things from different people.

Stephan Tual has written:

"Everything at Ethereum, including our website, our tools, our whitepapers and of course our all of our software and compilers are 100%, wall to wall open source and under the GPL."

But then what about the Ethereum Foundation?

How does the open-sourceiodicity of Ethereum compare to that of Bitcoin? How does it compare to that of the proposed "private blockchain" Hyperledger project?

Is Ethereum open source?

Yes. You can find all the source code on Github.

Technically, Ethereum - as in the idea - is open source since you can read the full specification in the yellow paper.

Ethereum - as in the software - is open source and you can find all major and minor implementations on Github: geth, mist, etc. (GPL, LGPL)

  But then what about the Ethereum Foundation?

Yes. You can find a general statement here


Is possible specify who can send bitcoins to me? I have an idea to store data in OP_RETURN, but…

The main problem is it need to easy to review all the transactions. I mean, every user need to have access to the OP_RETURN, giving the public key address. But, most block explorers show all transactions, by default. The “blockchain.info” shows all the transactions, a common user will not use the “Filter”.
Someone are capable to send many “small fractions” of bitcoins. In this way a user will see many transactions, creating some “pollution”. Also, the software will need to filter it, because the fee will be higher than bitcoins that the “malicious users” are sending. Also, the software need to get all the OP_RETURN too, so they need to check one by one.

My solution is simple, restrict who can sent the bitcoin. In this case, anyone could know my public key, but no one can send bitcoin to it, only allowed people. So, I can restrict the address X to send me a bitcoin, but the address Y can’t.

It’s possible in the Bitcoin? If not how is the easiest way to make it easier for software and for a user?

Not possible.  Anyone who can spend a utxo can create a transaction sending those coins to any address, or any script, that they wish.  There is no way to forbid people from sending coins to your address.

Your software will need to filter the transactions and determine which of them were authorized by you.


Are there already several ways to do "smart contracts" with cryptocurrencies? I have heard a lot of "buzz" about Ethereum, but apparently its 1.0 version won't be released for a while yet.

I have heard a lot of talk about "smart contracts" from people who admire Szabo, but I haven't seen many implementations.

I notice that Ripple lists "contracts" under "future" features, which seems to imply that they are not ready for use yet.

https://ripple.com/wiki/Main_Page

The one implementation I have seen is at :

http://erights.org/

Are there any other, more popular ways to implement "smart contracts" that are already in use?

Thanks

There is Orisi.org - you can read the whitepaper here Orisi.org/distributed oracles whitepaper, and run an example Timelock contract here.

The differences between distributed oracles/Orisi and Ethereum are:

Orisi works on top of Bitcoin, so there are no other currencies inbetween
oracles can reference external inputs, so you can create a contract that finalizes based on weather/currency prices, or even mechanical turk
it's available today
on the other hand, it has a different trust mechanism than Ethereum - oracles are supposed to be run by trusted independent parties. So, instead of proof of work, you have a proof of identity.

You can also read this blogpost by one of the bitcoin core devs: bit-thereum. It explains why m of n oracles might be a good solution for contracts.


Have there been any ICO (Initial Coin Offerings) that has been backed by redemption of a physical product? I'm doing some research on ICO's and wanted to see if there has been any ICO's that is backed by a physical product provided by a company? Aside from just funding the coin's development, the coin can function as an in store credit system? Which company or coins had this implemented?

I know at least two such ICO's EcoBit, which claims to be the "WORLD'S FIRST-EVER GREEN BLOCKCHAIN PROJECT".

One thing that I like about the project is they have actually started physical work and have posted videos of their progress on their Facebook page (do check them out).

Another one that I know so far is mona.co,

  Introducing Monaco - world's best cryptocurrency card. Spend and send
  money globally at perfect interbank exchange rates, saving EUR30-40 on
  every EUR500 equivalent spent.


BOLT #7: Can receiving node requirements in channel_update message give rise to malicious attacks? Following requirements have been placed on the receiving nodes related to the channel_update message in BOLT #7.

  if timestamp is NOT greater than that of the last-received channel_update for this short_channel_id AND for node_id:

  SHOULD ignore the message.

  otherwise:

  if the timestamp is equal to the last-received channel_update AND the fields (other than signature) differ:

  MAY blacklist this node_id.
  MAY forget all channels associated with it.

According to my understanding the receiving node will first check the signature of related the dsha256 of the entire message before verifying the timestamp and not check the remainder of the message if the signature is invalid. So if other fields apart from signature are changed, then the signature will not be valid (as the message has changed) and the node will not process the message further.

Now here's the thing I'm wrestling with: If the node still plans to check the message (as shown in the quoted text above) even though the signature is invalid and then go forward to blacklist the node, it can give rise to DoS attacks. A malicious nodes will just take a channel_update message that it received in the past from a node, change some fields like htlc_minimum_msat and rebroadcast to other nodes. Those receiving nodes will then simply blacklist the node_id without any wrongdoing from its part as (1) the timestamp is equal to the one it received in the past, (2) signature is same AND (3) other fields have changed.

So I feel that this check is simply not needed and if the software goes on to process this message despite checking the signature then it can give rise to attacks from malicious parties. Where am I incorrect in my thought process?

According to my understanding the receiving node will first check the signature of related the dsha256 of the entire message before verifying the timestamp and not check the remainder of the message if the signature is invalid. So if other fields apart from signature are changed, then the signature will not be valid (as the message has changed) and the node will not process the message further.

This is the correct understanding. It is stated earlier on in the receiving rules. Although the client implementation must read at least the chain_hash and short_channel_id from the message in order to retrieve the public key associated with that channel from its storage (if it exists), in order to perform the signature check.

    if signature is not a valid signature, using node_id of the double-SHA256 of the entire message following the signature field (including unknown fields following fee_proportional_millionths):

    MUST NOT process the message further.
    SHOULD fail the connection.

The checks on the timestamp and other field are performed only if the signature is valid, and the purpose of the check is to prevent spam from a valid signer. It is assumed that more than one channel_update in the same second is a DoS attempt, and therefore, the node responsible for signing such messages ought to be blacklisted.


CGMiner freezing on anything above intensity 16 I have 2 x Sapphire 7950 Boost cards running on Windows. I can only get them running stable on intensity 16 using CGMiner. Anything above that and the whole system freezes up (screen stays on but everything else is unresponsive).

Previously I had them on linux running BAMT, and I could get them running fine on intensity 18/19 for longer.

So I'm positive the cards should be able to handle greater than intensity 16, and I have two more PC's with just a single card in running around 600 KH/s, so I know they can.

What could be causing the system to freeze?  Is it the cards or could it be drivers etc?  Theyr'e only clocked at 1000/1250, with 24768 for thread-concurrency. Nothing over the top, and settings which are fine on the two single card PC's.

Here's my config file:

"kernel"            : "scrypt",
"scrypt"            : true,
"no-submit-stale"   : true,
"temp-cutoff"       : "85,85",
"temp-overheat"     : "80,80",
"temp-target"       : "70,70",
"auto-fan"          : true,

"api-listen"        : true,
"api-port"          : "4028,4028",

"intensity"         : "16,16",
"vectors"           : "1,1",
"worksize"          : "256,256",

"lookup-gap"        : "2,2",
"thread-concurrency": "24768,24768",
"gpu-engine"        : "1000,1000",
"gpu-fan"           : "0-90,0-90",
"gpu-memclock"      : "1250,1250",
"gpu-memdiff"       : "0,0",
"gpu-powertune"     : "0,0",
"gpu-vddc"          : "0.000,0.000",

"expiry"            : "30",
"gpu-dyninterval"   : "7",
"gpu-thread"        : "1",
"sharethreads"      : "32",
"log"               : "5",
"queue"             : "1",
"retry-pause"       : "5",
"scan-time"         : "30",
"temp-hysteresis"   : "3",
"shares"            : "0",

"kernel-path" : "/usr/local/bin"

I eventually figured out this problem, and it was solved by lowering the voltage on the cards to 1100 or 1150.

Stock Sapphire 7950 boost cards are volted at 1250, and when running both cards concurrently it was making the system unstable and thus it would crash.  Even so, I would have expected a Corsair CX750 to still be able to handle them both, but it seems not.

Lowering the voltage through Sapphire Trixx makes the whole rig stable, and I can now run at 18/19 intensity without any problems. Heck I might even try 20 soon ;)

Hope this helps anybody out in the same situation.


Does flattr complement or compete with bitcoin? I realise that the underlying technologies for Bitcoin and flattr are different, but do they serve the same purpose?

For example: if I set up a webapp that uses micropayments for revenue (like github - being able to buy private repositories) would it make more sense to use flattr or Bitcoin?

Would I use them in concert - Bitcoin for micropayments, flattr for "charity" like payments for people who just want to support the site, but don't need extra functionality?

Does Bitcoin have a clear advantage over flattr for certain situations and clear disadvantages in others?

Flattr is a social micropayments system. Bitcoin is a currency.

There is no reason the two could not be integrated together, pay with bitcoins and then share the bitcoins out using the same method as flattr.

In fact, I would go as far as saying this would be an excellent idea due to lack of transaction fees and friction for small amounts.

Flattr is the service, Bitcoin is the currency. They don't compete; they could certainly complement each other though, in my opinion.


What public data sets are available that could used for correlation in bitcoin analytics? What data sets exist out there that can be used for engineers to perform statistical analysis against? Hopefully this data is not needing to be scraped, but is available in an importable format or API, though I am open to suggestions on data that APIs need to be written for.

Historic trade data is available from the Bitcoin Charts Market API
Bitcointalk.org forum stats, impression stats for ads, e.g. new member sign-ups per day
Google Trends data for bitcoin. (Can be exported as a CSV file with links at bottom of the page)
Blockexplorer.com stats query page
Blockchain.info API
The Bitcoinstatus.RowIT page has graphs on the number of bitcoin hosts connected, client version and data on hosts/country. Don't see an API but some data is in tables so probably easy enough to scrape.
Chris Moore's answer to this question provides a lot of useful stats.
Of course the blockchain itself.


Does MtGox charge commission in USD or in BTC? When we buy BTC using USD on MtGox,

Does MtGox charge 0.6% of the USD then do a trade, or does MtGox do a trade first, then charge 0.6% of the BTC we receive?

Similarly, when we sell BTC for USD on MtGox,

Does MtGox charge 0.6% of the BTC then do a trade, or does MtGox do a trade first, then charge 0.6% of the USD we receive?

Mtgox charges the fee from whatever you're buying.

So if you buy 100 btc for however many USD, you'll buy the BTC, then you'll be charged 0.6% of your 100btc as fee.

If you buy 100 USD for however many BTC (i.e., sell some btc), you'll get your USD, and will be charged 0.6% of your 100USD as fee.

Edit: This is actually configurable. If you go to the mtgox settings page in your account, you can set the fee to be taken out either as above (default), or out of your USD balance always.


Associating a bitcoin address with a user in a shared wallet How can I associate a transaction with a unique user in a shared online wallet? It makes no sense to have one wallet account per user in the shared wallet as it would degrade performance (say I have 1M users).

Thus, I need to have bitcoind running in parallel with a database that hosts all the users and when a transaction comes in update the balance of the particular user.

My question is: how do I identify with which user this transaction is associated?

You generate and store the receiving bitcoin addresses of each user in the database. Then you poll bitcoind for new transactions for the all the receiving address you have in your database. When the receiving bitcoin address has incoming transaction, then you follow the relation from the receiving bitcoin address to the user and then credit the transaction on the user's database balance.

Some of this is covered in my tutorial Accepting bitcoins in Django application.


Is there logically any way to "live off of Bitcoin interest" without giving up control of your coins? All my life, I've been told that rich people don't need to spend any of that wealth. Instead, they just have a bank account where they receive a percentage of the total sum on the account every year or month or whatever time period, simply for allowing the money to be there rather than at home in the mattress or as gold bars in a safe. And then they live off of that amount, meaning they never spend any of their "actual" money.
But if you own 10 BTC, that's 10 BTC... and then it's 9.999998... and then 9.999997, and so on. Its absolute number slowly decreases until 0, unless you keep buying new coins for fiat money (or otherwise obtain them) to add to your wallet.
I frankly don't understand why any bank would give you money (rather than charge money from me, as my bank does) for simply keeping your money there, but since it's apparently a thing, I thought that I should at least ask if this is logically possible with Bitcoin.
And I do not mean sending my BTC away to some website or any kind of third party. I'm talking about retaining control of them in my Bitcoin Core fullnode wallet on my encrypted PC.
Is there some way, or planned future feature of Bitcoin, to get "interest" on your coins simply by holding on to them? So that they always grow a little, not just in terms of their "value" in the real world, but as in increasing ever so slightly?
Maybe they would never do this at this point, now that Bitcoin's rules are somewhat "established", and maybe it's not logically possible without sending your coins somewhere and trusting that party (which I would never do), but I need to at least ask.

This is possible, but not exactly in the way you're expecting!
Consider what you really want here: is it just an increased number of dollars or BTC? Nope! What you want is an increase in your buying power. Stop to think about the difference here for a second - it is important!
The goal is an increase in buying power, which means you want the ability to buy more tomorrow, than you could today.
Banks pay interest on deposits because they will use those deposits to make investments of their own, and those investments will (hopefully) do well and make the bank some profits. The actual cash money itself doesn't just magically grow! It is the investments that provide the profits. With the money itself, the opposite is true: as the money supply grows (unpredictably!), each individual dollar will hold less buying power than it did before. So just keeping dollars stored under a mattress is actually a pretty bad idea: that money will have less buying power tomorrow, than it did today. If the goal is to increase buying power, then clearly just holding dollars is bad, and so the prudent individual will find investments that can increase in value over time. With enough money invested, they can 'live off the interest' of those investments.
Bitcoin, on the other hand, is a very different type of money, in that the supply of it cannot be inflated, so the act of just holding coins does not suffer from the same issue of unpredictable dilution that dollars do. If BTC maintains current adoption/use rates*, and society progresses and grows in GDP, then each BTC will accrue more buying power over time.
The difference should be obvious: dollars are a bad asset to hold, they lose purchasing power over time due to an (unpredictable) dilution of supply. Bitcoin does not suffer from this, so a holder might expect their purchasing power to increase over time. Many people call bitcoin a 'hard money', as in, 'it is hard to produce more of'.
So all of that is to say: just like dollars, if you hold enough BTC, you could maintain a certain amount of purchasing power over time, while still living off the nominal increase in purchasing power of your BTC. The actual number of BTC you own would slowly shrink, but this is somewhat inconsequential if your goal is to just live off the interest while maintaining your net purchasing power.

*of course, bitcoin is currently in a young stage of growth, so it is a fairly volatile asset in regards to purchasing power over short time frames. But consider what the situation would be if it were as widely adopted as dollars - that is the more interesting situation in regards to the idea I mean to put forth here. Of course, if bitcoin continues to grow in popularity and use, then we might expect the buying power of a coin to increase, and vice versa.


How to calculate coin supply at each block height from all transactions? We are working on a small project and imported all block information to mongoDB. Right now we're aiming to calculate the coin supply regarding to the block number.

My plan is to loop through all transactions per block and parse vout and vin. However, I'm not sure how to distinguish mined coins and previously existing coins transferred users. Plus, how to account for transaction fees?
Can I track only "valueOut" and that's all?

{
   "txid":"0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098",
   "version":1,
   "locktime":0,
   "vin":[
      {
         "coinbase":"04ffff001d0104",
         "sequence":4294967295,
         "n":0
      }
   ],
   "vout":[
      {
         "value":"50.00000000",
         "n":0,
         "scriptPubKey":{
            "hex":"410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac",
            "asm":"0496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858ee OP_CHECKSIG",
            "addresses":[
               "12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX"
            ],
            "type":"pubkeyhash"
         },
         "spentTxId":null,
         "spentIndex":null,
         "spentHeight":null
      }
   ],
   "blockhash":"00000000839a8e6886ab5951d76f411475428afc90947ee320161bbf18eb6048",
   "blockheight":1,
   "confirmations":601155,
   "time":1231469665,
   "blocktime":1231469665,
   "isCoinBase":true,
   "valueOut":50,
   "size":134
}

Any help would be appreciated!

The first transaction in every block is called the coinbase transaction, it is a special transaction that pays the miner their reward. This transaction adheres to different rules than the rest: it has no inputs, but has output(s).

The coinbase transaction outputs are allowed to be equal to or less than the block subsidy (newly minted coins) + all transaction fees in the block.

The block subsidy is a set amount, as defined by the code. The subsidy started at 50 BTC, and that amount is cut in half every  210,000 blocks (25, 12.5, 6.25, etc).

The transaction fees for the block are found by taking the rest of the transactions in the block (ie everything that isn’t the coinbase transaction), and calculating the difference between the inputs and outputs in them. This value (input value - output value) is the implied fee.

Note that there are some odd cases to account for, this question has a bunch of great info in this regard.  in addition to this, there is a non-zero amount of BTC that has been ‘burned’, by being sent to addresses or scripts that are un-spendable, or at least have an extremely small chance of someone actually knowing the private key for them (eg the 1BitcoinEater... address). Depending on how you define ‘coin supply’, it may be worth account for these coins as well.


Bitcoind linux disk usage I'm running bitcoind (086) on a dedicated linux machine with about 35Gb of disk space. Earlier today I discovered the machine ran out of space (blockchain was 33 gigs) and proceeded to delete the whole directory. Now all bitcoins in the wallet are missing, balance shows 0, although I did back up and restore the wallet.dat file.

Is it normal for the blockchain to grow to that size?

Is there another way to clean it up periodically, say, via a cron job?

Should I keep hoping that the missing coins will return to the wallet somehow, maybe after it downloads the blockchain again?

TIA!

The blockchain is around 30 gigabytes. Unfortunately, if you want to use a full node client like bitcoind, you need all of that data. It's possible to prune the blockchain to just the unspent transactions, but the core devs have not implemented this yet on bitcoind. So no, you can't reduce the blockchain size as you need all of that data for a properly running bitcoind.

There are alternatives like electrum which use something called SPV to make the footprint of the application much smaller. This does require that you trust electrum servers, but it's very hard to fake that data, so it's fairly safe.


Is there a Bitcoin price alert application that can use data from BitcoinCharts.com? Is there a Bitcoin price alert application that can use data from BitcoinCharts.com?  Something like a windows desktop alert is what I have in mind.

I need this as I am trying to monitor prices of different exchanges such as localbitcoins.

If not then I may write a quick application for it and post it here.

Thanks

The wiki maintains a list of currently available software tools.

I don't see anything on there per-se but it might be an included feature in one of the pc tools.

But I say go ahead and write one if you have the time and desire.  It's nice to have options even if that feature already exists somewhere. I'm mostly Mac desktop guy these days so I'm a fan of multi-platform tools when possible. But that's tough to do for the kind of thing you're taking about. But if you open-source it there's always room for someone to port it or expand upon it!


How can I get address wise UTXO balance for Zcash t-address I tried to create user specific account wise zcash t-address, got the following error

zcash-cli getnewaddress "testaccount"
error code: -11
error message:
Accounts are unsupported

Is it possible to create account wise t-address?

But I have created zcash t-address successfully without account. Once I sent some amount to another t-address, remaining balance shifted to newly created t-address. Please assist me how can I get user specific address wise t-address balance?

You can get UTXO balance for Zcash t-address using https://chain.so/api/ api https://chain.so/api/v2/get_tx_unspent/ZECTEST/t2BqpZq16caHXC92LDTWg2pc8RQdmRFw5dF in testnet.


What is 'spendability of coinbase transaction after 100 blocks' in Mastering Bitcoin referring to? Ch7 of the book writes at the end of the Introduction section:

  "After 100 blocks back there is so much stability that the coinbase transaction—the transaction containing newly mined bitcoins—can be spent"

Can someone explain what is the author trying to convey with an example?

This part of the book is referencing blockchain reorgs (reorganization). This occurs when a node determines that it is no longer validating the longest chain.  When a node sees that there is a new longest chain on the network it moves over and begins verifying the blocks.  This can cause previously mined blocks to be orphaned.  Often times this only occurs at the tip (the last couple of blocks) of the blockchain.  When a block is a 100 deep into the blockchain, the risk of a reorganization that goes back that far is very unlikely, and, therefore, it is very unlikely that the block will become invalidated (orphaned).


App for managing multiple crypto portfolios I know I can use Blockfolio to manage/monitor multiple crypto-currencies. However I'm starting to feel the need to subdivide them by the type of asset (different risk classes, price points etc).

I have however been unable to find an app that allows me to create multiple portfolios. I really like Blockfolio in every other way though.

Any ideas?

Just clone your blockfolio app with appcloner
https://steemit.com/cryptocurrency/@tektao.tips/blockfolio-a-trick-to-manage-multiple-portfolios-on-android


How to create a bitcoin transaction without inputs How can I create a transaction without inputs and it will be broadcasted but of course won't get confirmed? I would like the simplest method to do this

This is not possible. Only the coinbase transaction is allowed to have a null, or non-existent input, and the only way to create that is to mine a block. Moreover, it must adhere to additional rules, such as the inclusion of the block height in the coinbase section of the vin (the scriptSig) as per BIP 34.

Unless you happen to run a mining pool, or have enough hashpower to solo mine a block, you cannot do this.

Creating a transaction with no inputs whatsoever is not possible without a hard fork.


x , y coordination division python code

def inverse(x, p):

    return pow(x,p-2,p)

p = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f

#private key 2 -->(x , y) value

xx =  0xc6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5L
yy =  0x1ae168fea63dc339a3c58419466ceaeef7f632653266d0e1236431a950cfe52aL

#private key 4 -->(x , y) value

x  =  0xe493dbf1c10d80f3581e4904930b1404cc6c13900ee0758474fa94abe8c4cd13L
y  =  0x51ed993ea0d455b75642e2098ea51448d967ae33bfbdfe40cfe97bdc47739922L

a= (x*inverse(xx,p))%p

print "x = " + hex(a)

b= (y*inverse(yy,p))%p

print "y = " + hex(b)

output

x = 0x1d8a71dd4218a520a1f976b6a4f66ed600880baf69d401a73dd010dd60f859ffL
y = 0x8f73b0d00f8d9e262cc230b7a6bee35d44ac898986195e819d68ecafd6b7803bL

normal math 4/2 = 2

but here private key 2 x,y value divided by private key 4 x,y value, not provide correct value of x,y

bitcoin , math learning

There is no such thing as multiplication (or division) of two points in the world of ECC math. This is because the points on an Elliptic Curve form a mathematical Group, rather than a Ring.

As such, you shouldn't expect the coordinates of 4*G and 2*G to be related by the method you described. The result of 2*G is not the same as multiplying each of G's coordinates by 2. You can verify, however, that

4*G - 2*G = 2*G

The subtraction here is actually shorthand for a complex, but formulaic, procedure for two ECC points. Note that subtraction is simply addition of the additive inverse in the ECC group. This is very different than the multiplicative inverse in the modular field that your Python method defined.


What library or wallet can be used to test segwit transactions on testnet? Is there any code snippets / wallets to send segwit transactions on the testnet at the moment?

I'm more looking for a code snippet or any library to support this to do some tests and make them public as a testing suit for wallet services.

bitcoin core supports this

addwitnessaddress "address"

then compose your transaction and send it, you can do it all via RPC calls, so any programming language that can do rpc calls will work (python, php, go, etc. etc)

help addwitnessaddress

addwitnessaddress "address"

Add a witness address for a script (with pubkey or redeemscript known).
It returns the witness script.

Arguments:
1. "address"       (string, required) An address known to the wallet

Result:
"witnessaddress",  (string) The value of the new address (P2SH of witness script).
}


Is the mnemonic passphrase enough to backup with deterministic wallets? I'm using a greenaddress.it wallet, but assume this will be the same for all deterministic wallets. (If not, please correct me!)

Since the first and all further bitcoin addresses my wallet will ever use can be determined by the "mnemonic passphrase", is there anything else I need to backup / store securely?

For all wallets, which support BIP-0039 (still draft status), the mnemonic passphrase is enough to completely backup your wallet. As I can read from the greenaddress.it website they support BIP-0039 (not tried), so all you need is the passphrase (seed).

Theoretically, you can import the seed into any other wallet implementation and manage your bitcoins from there. However e.g. the popular Electrum wallet doesn't comply with BIP-0039. So you have to take care if you want to switch wallets.

For a detailed understanding of deterministic wallets, I can only recommend you reading the section on wallets in the book "Mastering Bitcoin".


rewriting past transactions in Bitcoin Is it possible to rewrite past transactions in Bitcoin?
For example, lets say, we have a super computer with any desirable speed, that would be able to calculate hash as fast as we want. Would it be possible to take for such computer, a block that is 2 weeks old from now and create (from that block) a new chain that is bigger than today's chain with its own transactions? If so, the current network would accept our new (forged) chain and all the past transactions would become invalid.

Is it possible to rewrite past transactions in Bitcoin?

Yes. If you have more than half of the hashpower, you can eventually rewrite a chain of any length.

  For example, lets say, we have a super computer with any desirable speed

Cryptography is based around protecting against adversaries with finite computing power. As soon as you suppose that you're going up against someone with infinite computing power, there's no public key cryptography system that you can use, because your adversary can just try every possible private key.

It's kind of like asking, "How do banks protect against thieves that teleport money out of safes?"

  If so, the current network would accept our new (forged) chain and all the past transactions would become invalid.

Yep.

  Then you make the deal with the government to destroy bitcoin.

I don't really see why the government would care if people used Bitcoin. Given that there are really trivial things they could do to make it very difficult to exchange or use Bitcoin, which they are not doing, I doubt they care.


Permissioned blockchains on EVM: are these private ledgers os it all on ETH main net? Private blockchains using EVM: is this really the equivalent of the library of tools in hyper ledger or do these blockchains run on the public main net?

They are completely separate networks, with a different genesis block.

Geth and parity support running your own private networks that can utilize the features of ethereum (and the ecosystem of tools for it), without having to interact with the public network.


How to buy and sell Ardor I know this community is for bitcoin but I couldn't find any community to talk about crypto-currencies in general so I thought this may be the right place to ask.

I am interested on investing money on Ardor but I am kind of new in the world of crypto-currencies. So if someone could explain me how to buy and then sell Ardor in an easy way and avoiding places that could end up like mt.gox that would be nice.

If you have bitcoins you can buy Ardor fastly and easily in Poloniex.
If not, you can buy Ardor with $ here


How to use electrum RPC to get address balance on windows $ ./electrum-3.2.3.exe --testnet setconfig rpcport 7777
true
$ ./electrum-3.2.3.exe --testnet setconfig rpcuser blah
true
$ ./electrum-3.2.3.exe --testnet setconfig rpcpassword blah
true

$ ./electrum-3.2.3.exe --testnet daemon start
Traceback (most recent call last):
  File "run_electrum", line 433, in <module>
AttributeError: module 'os' has no attribute 'fork'

I can't install on linux as centos 7.5 can't compile python3.  I won't try any further since I have already wasted a day on compilation issues.

$ ./electrum-3.2.3.exe --testnet

starts up a gui client which is fine

$ curl --data-binary '{"id":"curltext","method":"blockchain.scripthash.get_balance","params":["mveNDYcr9Bb1xjnNeCRumiDHKU3n3CJBuk"]}' http://blah:blah@127.0.0.1:7777
{"result": null, "id": "curltext", "error": {"code": -32601, "message": "Method blockchain.scripthash.get_balance not supported."}}
$ curl --data-binary '{"id":"curltext","method":"get_balance","params":["mveNDYcr9Bb1xjnNeCRumiDHKU3n3CJBuk"]}' http://blah:blah@127.0.0.1:7777
{"result": null, "id": "curltext", "error": {"code": -32601, "message": "Method get_balance not supported."}}
$ curl --data-binary '{"id":"curltext","method":"getbalance","params":["mveNDYcr9Bb1xjnNeCRumiDHKU3n3CJBuk"]}' http://blah:blah@127.0.0.1:7777
{"result": null, "id": "curltext", "error": {"code": -32601, "message": "Method getbalance not supported."}}

I also tried without specifying the bitcoin address with the same results.

https://bitcointalk.org/index.php?topic=1894185.0
discusses the same issue and states
isnt giving an error about the wallet being loaded, which is why I am getting the error above.  Assuming the poster didn't mean "isn't" but rather "is", how would I "unload the wallet"?

note: mveNDYcr9Bb1xjnNeCRumiDHKU3n3CJBuk is an address in electrum's wallet

Turns out that electrum doesn't have to be in daemon mode to receive api requests, but it has to be in daemon mode before it supports them.


Fraud Detection & Prevention What are controls that are in place to detect and/or prevent fraud within the bitcoin system?
Are there any know exploits, or potential threats to the system?

The primary mechanism of attack in most financial systems, Bitcoin included, is a "double spend" attack which essentially allows the spending of the same money in multiple places either by duplication of funds or by revocation of the earlier of two transactions. We've actually addressed a number of such attacks on the StackExchange site here. Try looking at questions with the doublespend tag.

The two most commonly discussed are the 51% attack and the Finney attack.

The 51% attack requires the attacker to hold 51% or more of the complete hashing power of the Bitcoin network. Once the attacker holds the majority of all hashing power he/she may spend bitcoins and then fork the blockchain in such a way as to not include the block they were spent in. This is incredibly expensive and not arbitrarily done. It would also be somewhat detectable as the forking blockchain would regularly cause problems with other transactions until the 51% attack completed.

The Finney attack can be done by a solo miner without 51% of the network hashing power. The miner waits until they solve a block and place a transaction in that block in which they send all their coins to another address they control, but withhold their result. They then spend coins from the originating address elsewhere and then release the block. This essentially breaks the order of operations and makes the valid transaction impossible since the originating address no longer contains an adequate balance to have sent the coins.

These have both been discussed at great length and from many angles here on the StackExchange site. Again, try looking up the doublespend tag.


Why does bitcoin-cli not show the correct TXID for this transaction? I've been decoding some transactions on Testnet, and I've found one that bitcoin-cli decoderawtransaction seems to "fail" to decode correctly.

Here's the TXID: 400bb081cfea4802a1cdd8c365c886b9ccc0da59addd3d0b1f92cf0c04870738

For example:

1) You can retrieve the raw data as normal:

bitcoin-cli getrawtransaction 400bb081cfea4802a1cdd8c365c886b9ccc0da59addd3d0b1f92cf0c04870738

0200000000010129b0f742d41c6aad58dd0e779ca53b8bed1790465ed59ed20d2b6a3ecc6744920100000000ffffffff0178cdf5050000000016001443aac20a116e09ea4f7914be1c55e4c17aa600b702483045022100e8877e9351abcfc5dc20a9c9f55d7bcde8d64993d135a20568b5b8628ea3f7b102203801629aad6a7ec0960b4d830aedac673d620179753cc6f197eaed866a4959ba012103335134d7414e1d1a154600b124a96f5ef2c6ca21434d2622469a96bd5262fd5600000000

2) But when you decode that same raw data, you get this TXID:

{
  "txid": "ec4529406c0f8fb337114a3b8e270dd6e3ec9712299daa3eb17d1fc69aa58251",
  "hash": "ec4529406c0f8fb337114a3b8e270dd6e3ec9712299daa3eb17d1fc69aa58251",
  "size": 192,
  "vsize": 192,

Question:

Why is decoderawtransaction returning this TXID?

This is a segwit transaction, and it is returning the full hash for the TXID (including the witness data). Why?

Edit:

Here are some more:

a24cec50d5cf861d1af4b634f8ed1968c0e9484724bfef5af7f8c383605978c8 (testnet)
1f3f7e0543f4eeb88d2e04a2e4d04e4ef321ebc69e58e9bfd607c7d2b565ea66 (testnet)

decoderawtransaction in 0.14.2 has some issues with decoding segwit transactions. Sometimes it will decode segwit transactions as non-segwit. These should mostly be fixed in Bitcoin Core 0.15.0.


Alternative clients and the Bitcoin API Which of the alternative clients support any/some/all of the standard API calls? I am looking for a possible alternative client to replace Bitcoind on my server.

The Blockchain.info API includes Bitcoind as a JSON webservice. It's pretty cool.


What did getmemorypool do? To speak the truth, I don't really know what getmemorypool did before, I'm having a hard time trying to figure out.

And why is getmemorypool obsolete? What replaced it for internal work generation?

I don't find much documentation about it in search engines.

getmemorypool gave you the data needed to construct your own mining work and make a valid block. It was/is frequently used by mining pools for generating work for miners. It could look like this:

> bitcoind getmemorypool
{
  "version" : 1,
  "previousblockhash" : "00000000097f17d16fee37a160d300e27ce13632bb4468f0f31ae816e6186a18",
  "transactions" : [
  ],
  "coinbasevalue" : 5000000000,
  "coinbaseflags" : "062f503253482f",
  "time" : 1350541369,
  "mintime" : 1350537485,
  "curtime" : 1350541369,
  "bits" : "1c2f36c0"
}

Normally transactions would be a long list of transaction data.

getmemorypool is no longer supported in bitcoind since version 0.7 which has getblocktemplate instead. getblocktemplate is more flexible and suitable for pool mining. It is now in use both for getting data from bitcoind and for miners to get work from pools.


X11 | multiplier & maxDiff number to multiple the shares by in order to display hashrate What is the correct formula for X11 to calculate hashrate?

  right maxDiff number to multiple the shares by in order to display
  hashrate

We need hashrate multiplier and the maxdiff

Example:

scrypt: 2^16

sha256d: 2^32

maxDiff with:

scrypt: 0x0000ffff00000000000000000000000000000000000000000000000000000000,
sha256d: 0x00000000ffff0000000000000000000000000000000000000000000000000000


Does a LN route with N channels at most require N-2 fee payments? Assume we have a route n1 -> n2 -> n3 -> n4. My intuition here is that n2 charges n1 a fee and that n3 charges n2 a fee for routing payments. However, there's no fee for the last hop where n3 forwards the payment to n4. Is this correct? And if so, is this just an implementation detail, or is this somehow enforced on the protocol level?

The last channel in the route does have an impact on the fees of the payment. It's a bit counter-intuitive but when a payment is being forwarded by intermediate nodes it pays to the node the fees necessary to traverse an outgoing channel of that node. In a situation A -> B -> C A sends to B amount + fee(BC) because A knows that B will subtract the fees according to the cost of traversing the channel to C namely 'fee(BC)'; note that if there are multiple channels between B and C, A can't choose which one to traverse. In the case of the last hop you want to it to have the amount that was requested in the invoice (or whatever amount you want it to receive), in the { A, B, C } example A is effectively paying for the last hop even though the amount that comes out of B is without fees because B takes them in advance (before forwarding it to C).

As reference you can look here and specifically in the field descriptions: every forwarding node has to respect the equality incoming_htlc_amt - fee >= amt_to_forward where incoming_htlc_amt is the amount being received upstream and
amt_to_forward is what will be sent downstream.So to answer your question, an LN route with N channels requires exactly N-1 fee payments.


Which crypto exchanges charge zero maker fees other than GDAX? GDAX charge zero maker fees and I thought it is a common practice until I realise many other exchanges charge a fee around 0.20%. What are other exchanges that has zero maker fees?

According to this list, these exchanges have zero maker's fee:

GDAX
Coinfloor
itBit
Luno
Cex.io

There are probably more exchanges, but those aren't listed there.


How miners validate each transaction? There is a locking to each transaction? and sender also attach his digital signature to that transaction?

When this transaction comes to miners then how they validate this transaction is valid.

What I understand is they check locking and digital signature. but locking contains receiver address. Then how digital signature of a sender will work with locking (which contains receiver address)?

How miners validate each transaction?

Miners do not validate transactions. The nodes validate transactions, see Node Operation under Bitcoin Mining. The miners get a block template from the node, which includes the block header that they will try to hash until the hash value is less than the target. See Bitcoin Hashing Algorithm.

Nodes will make sure that the transactions are valid by checking the following:

The outputs signatures satisfy the input locking script. (The spender has access to spend the funds).
The output values are less than the inputs.
The values and the format is valid.

  There is a locking to each transaction? and sender also attach his
  digital signature to that transaction?

Yes, transaction outputs have a locking script that the next spender must be able to satisfy with a digital signature. See the verification section in Transaction.

  What I understand is they check locking and digital signature. but
  locking contains receiver address. Then how digital signature of a
  sender will work with locking (which contains receiver address)?

"A Bitcoin address is only a hash, so the sender can't provide a full public key in scriptPubKey. When redeeming coins that have been sent to a Bitcoin address, the recipient provides both the signature and the public key. The script verifies that the provided public key does hash to the hash in scriptPubKey, and then it also checks the signature against the public key," see Transaction Verification.


What's the best way for a website to detect payments from green addresses? Does any proven third party code exist for this?

Edit*

To be more specific, what I haven't been able to find out is how to get the sender's bitcoin address when receiving a transaction. As far as I know, bitcoind doesn't have a command that shows the prev_out hash.

It is now possible to determine the list of addresses that sent a transaction using the raw transaction JSON-RPC API calls that were released with bitcoind and bitcoin-qt version 0.7. The pseudo-code to accomplish this is:

txid = <relevant transaction id>
addresses = []
raw_tx = decoderawtransaction(getrawtransaction(txid))
for(input in raw_tx['vin']) {
  input_raw_tx = decoderawtransaction(getrawtransaction(input['txid']))
  addresses.push(input_raw_tx['vout'][input['vout']]['scriptPubKey']['addresses'][0])
}

Once you have the list of sending addresses stored in the addresses array, you can compare these addresses to a list of pre-approved green addresses. In most cases, you should expect there to only be a single unique address in the addresses array.

In order to get a list of suitable green addresses, you could hard-code it into your application, or you could use a dynamic source, such as Deepbit's JSON feed. This feed however, is notably missing Mt. Gox's Green Address


Is there a bitcoin source, fork available that does not include a GUI? I would like to try to download and compile a barebones variation of the Bitcoin daemon.  Specifically, I'd would prefer to not have a copy of the code with any GUI implementation.

Does such a reliable, and maintained, forked project exist on Github or any where else?

Yes. If you compile the bitcoin client using the following commands, it will not build the GUI components:

./autogen.sh
./configure --without-gui
make


Any other sites for exchanging bitcoin for ripple apart from shapeshift and changelly? I want to buy some ripple using bitcoin, but shapeshift sets a minimum for the transaction that is way above the initial deposit of 20 XRP necessary for an unfunded ripple wallet. At the moment of writing this, shapeshift requires a minimum deposit of 0.01451925 BTC, which is 93.43467259 XRP. But I don't want to buy so many XRPs.

Besides, changelly doesn't currently support ripple.

You can view all exchanges that support converting XRP <-> BTC on coinmarketcap.com . Here are all the markets that XRP trades on. Just look for markets that say XRP/BTC.

I've successfully exchanged XRP on Bitstamp and Poloniex.


bitcoin-cli commands like createrawtransaction not working with json on command line I am trying to create raw transaction using the createrawtransaction api on testnet using the Windows7 command line. I always get an "error parsing JSON":

C:\Users\amjad>bitcoin-cli -testnet createrawtransaction '[{ "txid" : "12b8e7ede
4992f4d30f93idj3085746951d945e39f40becebd7c290af8c2e7ad", "vout" : 0 }]' '{"mxh3
H416KCRoBDiweSESew5YJyAk1nxLrN": 0.025, "mkrzDhhZtzQm8zgckSs4fMNrvtNJ66zaFe": 0.
0245}'
error: Error parsing JSON:'[{

Does anyone have an idea what I'm doing wrong?

When looking at the Bitcoin Developer Reference I saw an example where they use two additional '' before and after the list of inputs in comparison to you. For your input, I also got "Error parsing JSON", but with

bitcoin-cli -testnet createrawtransaction '''[{ "txid" : "12b8e7ede4992f4d30f93idj3085746951d945e39f40becebd7c290af8c2e7ad", "vout" : 0 }]''' '{"mxh3H416KCRoBDiweSESew5YJyAk1nxLrN": 0.025, "mkrzDhhZtzQm8zgckSs4fMNrvtNJ66zaFe": 0.0245}'

it parsed correctly.


Does Ripple use NTP? Does Ripple use NTP or expect the nodes to do so?

If not, why not?  It seems that Ripple is a little more closed than your standard cryptocurrency, so this doesn't seem like an excessive demand.

The Ripple server has SNTP support to tolerate system clocks that are inaccurate.

The consensus process also builds a consensus network time. Each validator pulls the consensus network time a bit closer to their local time. This consensus network time becomes the close times included in ledgers that support features like expiring cross-currency offers.


Segfault when attempting to run cgminer on ubuntu 10.04 I recently wanted to try mining some crypto-currency, and litecoin seemed to be a good way to start since it doesn't require too specific hardware.
However, running cgminer after install (which was completed without errors) ends in Segfault.

Machine configuration :
Ubuntu 10.04
ATI Mobility Radeon HD 4500 series

I might be missing some packages, since no tutorial has the same list, but since the install didn't complain, I assumed everything was OK.

The steps used so far :

got the cgminer-3.7.2 x86_64.tar.bz2 (seems to be the last that supports GPU mining)
installed AMD APP SDK 2.9
mkdir amdapp_2-9

cd amdapp_2-8
tar -zxvf ~/Downloads/AMD-APP-SDK-v2.9-lnx64.tgz
sudo ./Install-AMD-APP.sh
sudo reboot

installed ADL SDK 6.0

mkdir ADL_SDK
cd ADL_SDK
mv ~/Downloads/ADL_SDK_6.0.zip .
unzip ADL_SDK_6.0.zip
cp include/* ../cgminer/ADL_SDK

installed cgminer

CFLAGS="-O2 -Wall -march=native -I /opt/AMDAPP/include/" LDFLAGS="-L/opt/AMDAPP/lib/x86_64" ./configure --enable-opencl --enable-scrypt
make
make install

did some exports

export DISPLAY=:0
export GPU_USE_SYNC_OBJECTS=1
export GPU_MAX_ALLOC_PERCENT=100

And finally, I wanted to test via

./cgminer -n

That failed miserably, as all I got was a Segfault.

Here is the result of the configuration step :

cgminer 3.7.2
------------------------------------------------------------------------

Configuration Options Summary:

libcurl(GBT+getwork).: Enabled: -lcurl
curses.TUI...........: FOUND: -lncurses
OpenCL...............: FOUND. GPU mining support enabled
scrypt...............: Enabled
ADL..................: SDK found, GPU monitoring support enabled

Avalon.ASICs.........: Disabled
BFL.ASICs............: Disabled
KnC.ASICs............: Disabled
BitForce.FPGAs.......: Disabled
BitFury.ASICs........: Disabled
Hashfast.ASICs.......: Disabled
Icarus.ASICs/FPGAs...: Disabled
Klondike.ASICs.......: Disabled
ModMiner.FPGAs.......: Disabled

Compilation............: make (or gmake)
CPPFLAGS.............:
CFLAGS...............: -O2 -Wall -march=native -I /opt/AMDAPP/include/
LDFLAGS..............: -L/opt/AMDAPP/lib/x86_64 -lpthread
LDADD................:  -lcurl   compat/jansson-2.5/src/.libs/libjansson.a -lpthread -L/opt/AMDAPP/lib/x86_64 -lOpenCL    -lm  -lrt

Installation...........: make install (as root if needed, with 'su' or 'sudo')
prefix...............: /usr/local

I realize this question is 8 months old but this information may be of value to others seeking a resolution to a segfault as there seems to be no information available at all on the problem. The APP SDK seems to be incompatible with ATI legacy drivers.

The APP SDK is probably causing the segfault. I have a HD4770 and it was working with a pre-compiled copy of cgminer.

When I installed the APP SDK to compile sgminer everything seemed ok, sgminer compiled ok

However is gave me a segfault and when I tried to run cgminer that was working it too gave me a segfault.

After 3 days, I have been unable to restore things the way they were and undo the changes the APP SDK install made.

I fear that a complete OS reinstall will be my only solution.

Also. the flags '-march=native' enables special cryptographic instructions that are incompatible with AMD CPU's before Bulldozer.


jsonRPC calling createrawtransaction in PHP I can't get createrawtransaction to work in PHP using jsonRPC.

I found this thread https://bitcointalk.org/index.php?topic=133769.0 from a few months ago describing the process. It won't work however, no matter how many different ways I try it...

$arg1 = array( array( "txid"=>$lasttx, "vout"=>$n));
$arg2 = array( $address=>$coins);

array(1) {
  [0]=>
  array(2) {
    ["txid"]=>
    string(64) "valid_tx_id_goes_here"
    ["vout"]=>
    int(1)
  }
}
array(1) {
  ["valid_address_goes_here"]=>
  float(0.01)
}

$this->bitcoind->createrawtransaction($arg, $arg2);

EDIT: All of the other commands work, like getblock and etc. So I'm connected to the RPC server clearly. The errors aren't helpful either -- it says unable to connect when I output the error for createrawtransaction, but all of the other commands go through the RPC fine and are able to connect. I wish I knew how to even begin debugging this.

you should pass parameters as an array.

try like that:

$bitcoin->createrawtransaction(
    array(
        array(
            "txid"=>"aed23bb3ec7e93d69450d7e5ea49d52fcfbef9d380108f2be8fe14ef705fcea5",
            "vout"=>2
        ),
        array(
            "txid"=>"b28c740c66726ab2f0397be29f2d25f091b8ab353b98b9ebf9e6ccfd080cdf49",
            "vout"=>3
        ),
    ),
    array(
        "1GTDT3hYk4x4wzaa9k38pRsHy9SPJ7qPzT"=>0.006,
        "1ApD64wpNUM6GBeSmKYhsyaNwFot3FMC5y"=>0.004,
    )
);


Definition of confirmation time in blockchain.info, Part 2 In my previous question (Determinant of confirmation time), I asked

"What will be the definition of confirmation time and data used for

https://blockchain.info/charts ?"

Now I read

"The classic bitcoin client will show a transaction as "n/unconfirmed" until the transaction is 6 blocks deep. " (https://en.bitcoin.it/wiki/Confirmation)

Then is it correct to say that, in a simplest approximation it takes 6 times the confirmation time in the graph to get a transaction done?

Then is it correct to say that, in a simplest approximation it takes 6 times the confirmation time in the graph to get a transaction done?

Not quite, the first confirmation is different from all subsequent confirmations, I’ll explain how:

For the first confirmation, there are a couple of factors at play:

how long until the next block is mined
how high the tx fee is, relative to other transactions in the mempool

For all subsequent confirmations, there is just one factor:

how long until the next block is mined.

The average time between blocks varies, but usually averages just below 10 mins. So a simple approximation of time for 6 confirmations could be:

(Time for first confirmation) + 5*(average block time)

As an example, let’s say we have a tx where the first confirmation takes a while due to a low fee (let’s say, 40 minutes). The next block (next confirmation) will, on average, arrive 10 mins after that, and the next one 10 mins after that. So we might expect the time for 6 confirmations to be (40 + (5*10)) = 90 mins. Whereas under your assumption we would expect it to be (40*6) = 240 minutes.

It’s worth noting that 6 confirmations is often considered as being ‘fully confirmed’, to help mitigate the risk of a chain reorg happening after one or two confirmations. This number is calculated by considering the cost of an attack to reorg the chain, against the value of the transaction being sent. For high value transactions, you’d want to wait more confirmations, because eventually the cost of an attack to reorg the chain will outweigh the value of the transaction (so a miner would spend more resources attacking the chain than they would gain by reversing the transaction).


What are the pros and cons of premined altcoins? When starting an altcoin from scratch, how would distributing premined coins to a certain community affect the currency?

pro's:

dev gets paid
some bounties and coin distribution can occur

con's:

depending on the size of the premine, developer could get an unreasonably large amount of coins for what is essentially a copy and paste job.
negative preconceived opinions about the coin because it is premined.
dev could be a scammer and dump all the coins, rapidly deflating the price(ie, a pump and dump)
those who claim the bounties may run with the money and pull the services at a moments notice once the bounty is paid.
coin may be subject to 51% attacks, difficulty stranding attacks, and other undocumented forking attacks from anti-premine "activists", who may be the vocal minority but often have the majority of hash on any given coin.
the coin will be under constant attack from trolls


What exchanges offer trail orders? Trail orders are extremely useful, much more so than simple stop loss orders. Are there any exchanges that offer trail orders?

Using a trail order, the stop price would track the market price as long as it goes in the same direction, but not if the market price moves in the opposite direction. For example, say BTC is bid 250 USD and I place a trail stop (sell) order for 10 USD below the bid price. Here's what happens if BTC moves:

start => my trail order will have a stop of 240
BTC bid 260 => my trail order will have a stop of 250 now
BTC bid 265 => stop 255
BTC bid back to 262 => stop 255 stays in place
BTC bid 268 => stop 258
BTC bid 263 => stop stays 258
BTC bid tunnels down to 255 => market SELL order triggered as soon as the bid went <=258

As of June 2013, Tradehill does not offer stop orders.

This answer needs an update. As of 2017, the following exchanges support trailing stop orders:

Kraken - fees up to 0.16% - 0.26%
Bitfinex - fess up to 0.10% - 0.20%
Bitstamp - fees up to 0.25%

However, there's an important warning to be heeded: by placing trailing stop orders with any exchange, you expose yourself to very short-lived price spikes that are not reflected anywhere else. Here is a screenshot from Kraken where the three red dots represent trades triggered by the price falling by 25% for a minute, only to shoot back up immediately afterwards. The trailing stop didn't offer any protection here; on the contrary, it caused a loss.


Where to find rpcauth.py for configuring rpcauth in bitcoin.conf on Ubuntu I can't find the python file to create the rpc credentials. According to the documentation it should reside somewhere here:

  using the output from the script in share/rpcauth/rpcauth.py

The python file is not provided if you installed bitcoind through PPA.

You can download it yourself

wget https://raw.githubusercontent.com/bitcoin/bitcoin/master/share/rpcauth/rpcauth.py

And run the program as follows

python3 rpcauth.py myusername mysecretpassword


How to find a block containing a transaction using transaction hash only? Well, the title says it all.
I have  a transaction hash and I want to find this transaction in the blockchain.
I am working with bitcoinj.

I am probably missing something very obvious here, but I cannot find how to do it.

The transaction does not know the block in which it was integrated.

https://en.bitcoin.it/wiki/Protocol_specification#tx

There are many services around like blockchain.info or blockexplorer.com which stores the blockchain and have indexed all transactions, which you can search.


How do I add a miner's fee to a BTC transfer I would like to pay a miner's fee.  Places like MtGox allow the option of adding one.  I would like to add one.  Often I will add 0.0005 BTC to the end of the amount, but no miners take my fee.  May I ask how I get those good, hardworking miners to take my fee?

Depends what you're using to create and broadcast the transaction (txn). If you're using a web/GUI wallet, then there's usually an option somewhere. If you're crafting txns by hand or interested in the protocol, the miner will receive any unspent BTC from the txns (any amount from the input that's not sent to the recipient or back to you as change).

In theory, the lucky and hardworking miner that's solves the block containing your txn will be rewarded handsomely with 25 BTC and the fees from all txns contained in the block. In practice, most miners are in a pool, so the reward will be shared with all miners participating in the same pool as that lucky and hardworking miner


Understanding Kraken Trades API (market/limit) I want to build historical OHLC data from the Kraken trades. Since Kraken does not provide historical OHLC data (at least not going far back), they recommend one builds it oneself using the list of trades (https://support.kraken.com/hc/en-us/articles/218198197-How-to-pull-all-trade-data-using-the-Kraken-REST-API). Their trades API does indeed return trades as far back as October 2013, but I do not understand how to interpret the data.

They return the following information for each trade (see https://www.kraken.com/help/api#get-recent-trades):

Price
Volume
Time
Buy/sell
Market/limit

All of these make sense except the last one, market/limit. How can a trade be a market trade or a limit trade? I am very familiar with market and limit orders, but I thought that every trade is a market order matched against one or more limit orders. So how can a trade be market or limit?

Can I perhaps treat a market sell trade as a limit buy trade and vice versa? And so it would just be random whether they call it market sell or limit buy? This would seem a little odd to me...

Any insight would be appreciated!

Indeed they don't specify what it means, but the only sane option is that market/limit tag comes from the type of order that closed the deal.

For example there are two lowest sell(ask) orders hanging in the order book:

0.05 BTC at 2000 EUR
0.03 BTC at 2300 EUR

I come to Kraken and place a Market order, buy(bid) for 0.07 BTC, thus the first trade will be for 0.05 BTC, and the second will be for 0.02 BTC. Both will have designation 'market'.

It is possible, however that I want to buy some bitcoin, (let's say 0.9 BTC), but not higher than 2300 EUR. Then to make sure I don't pay more than planned, I make a LIMIT order and the two awaiting orders are matched to mine and what is left of my order amount may hang in the order book on the Buy side. In this scenario the trades as seen via API will have designation 'limit'


I am new and I did not get bitcoins I am new to Bitcoin. So, I downloaded the Windows Bitcoins software from the official website and used the "request bitcoins" option to request bitcoins from my exchanger.

My exchanger charged me $20 and told me he will send me bitcoins corresponding to $20. But even after 18-20 hours I didn't receive any bitcoins.

Additionally, the Bitcoin software is showing synchronizing with network : x years xx weeks remaining.

What should I do? Should I wait for the synchronizing to complete or file a complaint against exchanger?

Yes, wait for it to finish synchronizing. You will not see your coins until it finishes.

(Note that the time shown is not the estimated time until completion; it represents the age of the old transactions currently being downloaded. Depending on the speed of your computer and internet connection, you can expect it to finish in a few hours to a few days.)

In the meantime, you can enter your address in a "block explorer" site like http://blockchain.info to check whether the seller made the transaction as agreed. (This is safe; your address alone cannot be used to steal your coins.)

If you don't want to download the entire block chain, you can use a different client such as Multibit, but you will have to import your wallet.dat from Bitcoin Core into your new client software. Its documentation should explain how to do that.


Question about BTC-E fee's I'm looking into trading on btc-e but can't find too much info on the trading fees. All I see is a general 2%. Is there a fee for trading btc in or out? What else is there? What's the 2% calculated off of?

0.2% is taken from each trade, so if you sold BTC for $100 USD you'd get $99.80 in your account.

Coin deposits are free, withdrawals are subject to a generous miners fee.

Fiat deposits/withdrawals vary from something like 1% to 6% I can't recall off the top of my head.


why is cgminer slowing down over time? I noticed something queer about cgminer, when I first started using it I got an ok amount of shares, but over time that number has been slowly dropping. it's the same difficulty,same temperature,but slightly less wu/m. it runs under the same conditions software  wise every day(i.e. no extra programs are running,Windows is not updating,etc) but yet it's still slowly dwindling away. not by huge chunks like suddenly stopping, but in general it's receiving less accepted shares(still 0 rejected shares, so it's not just failing at calculating them)
why is this happening, and is there anything I can do to help it?

It might be a signal your GPU is slowly decaying away, or may have to do with competition.

What coin are you mining, and at what pool? I've noticed that as more miners with more powerful machines enter a pool, they tend to give partial results very quickly so the pool orders a work restart more often - lowering the number of shares I get. If your pool allows you to manually set difficulty then set it to a lower value: better to send some shares for a lower difficulty than no shares at all.


Where is the configuration file? This is strange!

The documentation on running the Bitcoin daemon on a Ubuntu machine is clear. The configuration file is supposed to be at $HOME/.bitcoin/ location. And yet, I cannot locate it! I looked for clues at /etc, /var, and /tmp too; nothing there. In fact, in one of my attempts to launch the daemon, the debug.log (created at $HOME/.bitcoin/) did call out the configuration file to be $HOME/.bitcoin/bitcoin.conf but the file itself wouldn't be listed. Permissions? - I don't know.

Can you please tell me where to look for this file?

This is on Ubuntu-16.04, 64-bit where bitcoin was installed via PPA. Yes; I am working with Bitcoin code for the first time.

The configuration file is definitely in $HOME/.bitcoin/. If you cannot see it, the most likely explanation is that you have not created it. Just use your favorite text editor to do so. As far as I can tell, bitcoind -daemon will run without bitcoin.conf being present and you will still get the message 'Using config file /home/user/.bitcoin/bitcoin.conf' in debug.log even when no file exists.


What prevents anyone from spending utxos from a native segwit address? I read that transactions spending utxos from a native segwit address ( an address starting with bc1) are seen as anyone can spend transactions by legacy nodes.

So what prevents someone from taking a utxo from a native segwit address and using it to fund a transaction with  a scriptsig of OP_TRUE or null ,and submitting it to a legacy node or directly to a miner?

Segwit is a soft fork.  A supermajority of miners have agreed that they will not include such transactions in their blocks, and will orphan any block that does include such a transaction.

If you send such a transaction to a legacy node, it will see it as a valid unconfirmed transaction, but the network will never confirm it.

Potentially, if there are still some miners running legacy code, the transaction could get included in a block by a miner who also sees it as valid.  But the majority of miners will reject this block.  The only way that the legacy node would ever see this transaction as reaching, say, 6 confirmations is if those legacy miners were to mine 6 blocks in succession.  Since those miners are at bet a tiny minority, this is extremely unlikely.

If you send the transaction directly to an updated miner, they'll reject it.  If you send it to a legacy miner, they might include it in a block, but then their block will eventually be orphaned out of the blockchain.


How do you determine whether Bitcoin Core is synced fully or not from the RPC API? I keep getting the wrong numbers returned daily in the beginning of the day because Bitcoin Core has not yet synced the blockchain from the computer being powered off during the night. So I need a way to determine if it's been synced fully or not, so that I can avoid using the numbers until it has synced fully.
I've looked through https://bitcoincore.org/en/doc/0.21.0/ but can't find anything such as "getsyncamount" or "isfullysynced".
How is it done?

Use getblockchaininfo and check the value of the initialblockdownload field. If it is true, BItcoin Core is still syncing. If it is false, it is done syncing (or very very close to done).


How do miners detect double-spending? Assuming I spent 1BTC, then waited a few months and then spent it again. How is this detected? Do the miners go through the entire blockchain to assure the coin was never spent before?

The other two answers explain what has to be done to discover doublespends. I'll try to explain how it works.

There are no "balances", there are "coins"
A common misunderstanding is that there is a register of balances for addresses, and when you spend bitcoins, some of your balance gets deducted from your address. Actually, that's not a good description of what's happening. Under the hood, it's more akin to receiving a "coin" whenever you get paid, and drawing upon your available "coins" when spending.

Spending "coins"
When someone sends you a transaction, they create an "unspent transaction output (UTXO)". This UTXO is uniquely identifiable e.g. the first output of the transaction with the id X. UTXOs are like coins: They have a specific value and can only be spent completely. To spend part of one, you have to give up the complete coin, get back change.

Example:
You have two Unspent Transaction Outputs ("coins") worth 0.03 BTC and 0.09 BTC. They were created as "first output of transaction X" and "third output of transaction Y" respectively. You want to send 0.10 BTC to Bob.

You cite these specific two UTXOs as inputs to your transaction Z. I.e. you order "I want to spend the first output of transaction X, and the third output of transaction Y. I'm converting them to first and second output of transaction Z. – Here are the signatures for X.first and Y.third.".

X.first   0.03 BTC                       Z.first    0.10 BTC (spendable with Bob's signature)
                       ---- tx Z  --->
Y.third   0.09 BTC                       Z.second   0.02 BTC (spendable with your own signature)

In this example, you use up your two "coins", to give one "coin" to Bob to pay 0.10 BTC, and get back the change as another new "coin" which goes to yourself. Your transaction Z spent X.first and Y.third, and converted them to two new "coins" Z.first and Z.second.

Now, as described by Greg and Jestin, every full node has worked through the whole blockchain. Every single transaction references one or more "coins" that get spent, and creates new "coins" as in the example.

While a node works through the blockchain, it keeps track of the "coins" that exist, and updates this database with every transaction that happens. The database is referred to as the Bitcoin network's "Unspent Transaction Output Set". So, when you're up to date, the node has a list of every "coin" that is available for spending.

Back to the question
So, you sent 1 BTC to Bob one month ago. Now, you're trying to use the same "coins", X.first and Y.third a month later to send money to Carol. The nodes look at their "coin" database, and see that they are not in it. They can immediately say "Those coins have already been spent.".


What is saved in wallet.dat exactly? As I know, wallet.dat saves all related data for a bitcoin wallet.  However, I don't understand what precisely is saved in the wallet.dat.  I think it must contain several private keys. Does it also contain the corresponding public key, and seed value?  Anything else?

The wallet.dat file contains your private keys, public keys, scripts (which correspond to addresses), key metadata (e.g. labels), and the transactions related to your wallet. If you have an HD wallet, it also includes the HD seed and and the derivation paths for each private key.


How can I copy the blockchain from my working client for use with a live CD savings wallet? I have the Bitcoin client installed on my Windows PC, but I want to set up a savings wallet with better security that I access with an Ubuntu live CD. I don't want to have to download the entire blockchain though - can I use my blockchain from Windows in the Ubuntu OS?

And how can I copy the blockchain from my existing Windows client installation to, say, a USB stick for use by an Ubuntu live CD, then into the Bitcoin client folder?

You can find the blockchain in this directory:

C:\Documents and Settings\YourUserName\Application data\Bitcoin (XP)
or
C:\Users\YourUserName\Appdata\Roaming\Bitcoin (Vista and 7)

As blk0001.dat and blkindex.dat. Copying those files to a proper folder on your Ubundu (~/.bitcoin/) should spare you from redownloading the entire blockchain.


Getting historic exchange data through an API I'm trying my hands on a trading bot, but I need a website to pull trade data for min. the last 3 days. This can be from any major exchange. Eg. the exact same as this:
https://www.bitstamp.net/api/transactions/

But this only allows retrieval of transactions max. 1 hour old (or am I wrong?)

Have a look at the API of Bitcoin Charts. They have trade data available for all the major exchanges but delayed by 15 minutes. You can then fill up the gap using the available exchange APIs.


Zapped transaction, did rescan - bitcoin lost... :( I made a transaction, realized the fee wasn't high enough, so I restarted Bitcoin-QT (MacOS) with -zapwallettxes, and removed the transaction.

Then restarted with -rescan, (been almost 24h since scan finished) but the funds are still missing. and there's no trace of the original transaction.

I don't find any trace of the transaction in the blockchain either...

Have I lost my funds? :-/

-- edit
When I import all the addresses from Bitcoin-Qt into Electrum, I can see all my funds...
Bticoin-qt still has some missing.
What am I doing wrong?

I don't think so. If the transaction is removed from the blockchain, it means it was never confirmed.

Thus the UTXO is still unspent, and should still be in your wallet. Are you sure your wallet is updated?

Maybe see if you can find the adresses by executing

listreceivedbyaddress 0 true

Or, if that doesn't show anything, dump all the private keys of your wallet and import them in something like electrum?


Remove Orphan blocks from "personal" blockchain Alright, so I've been trying to learn a little more about the blockchain and blockchain-development lately. For every other altcoin, I've noticed that there's such a thing as a bootstrap.dat-file which, as I understood it, essentially is a file containing the "correct" blockchain which simply get imported to the computer in order to speed up the synchronisation of the blockchain of a certain coin. I would like to learn how to create one of these bootstrap.dat-files by myself (or at least learn the theory behind it).

I found this post. I followed the instructions in the second answer, running this cat blk000*.dat > bootstrap.dat code in Terminal which did create a bootstrap-file. I imported this to my second computer, started the client (Fastcoin 0.8.7.2) and while this worked I was unable to restart the client as it almost immediately freezes while it keeps reading data from the disk. I have to force quit the client to get out of this. I emailed the support and while I wait for their answer I figured I'd try to make some research by myself.

According to this thread on Bitcointalk, a valid bootstrap.dat-file does not contain orphan blocks (which I know mine does) and have the blocks in the correct order (which I'm not sure how to check). I read that Bitcoin uses a linearize.py-script to resolve these issues, but as I understood it it doesn't use the data on disk to do this but rather from a server which is not what I'm trying to do.

Since the code in my third paragraph actually did create a bootstrap-file, I figure I might be on to something that way. But how do I avoid the orphan-blocks/sort them out as well as getting the "valid" blocks in the correct order? All help will be greatly appreciated!

It is basically impossible to do what you want without verifying the blocks yourself and constructing the chain status yourself. The easiest way to do this is to run the client that downloaded those block files in the first place as it will know the chain status to be able to construct the main blockchain. This piece of software has the server that the linearize script interacts with. So just run that with the linearize script and it will construct you proper bootstrap.dat file.


How Does Bitcoin network prevent from the same transaction being included multiple time in a block Assuming that there is multiple miners in the network that have access to the same transactions that were submitted by users. How does Bitcoin network prevent from accidentally including the same transaction into different blockchain blocks? Im thinking that if multiple miners successfully mine new block at the same time (very close), the notification that some transactions were included in a block might not have propagated to others soon enough. Could this race condition cause some issues in blockchain or is this allowed to happen and then duplicate transactions are simply ignored?

First of all let's discuss what would happen if a block indeed contains a transaction that was already included in the chain:
All full nodes validate all blocks, and will not accept a block with any invalid transaction in it. If a transaction is repeated, it means its inputs are already spent by the first instance. The second one will thus be considered a double spend, and regarded as invalid, which by extension means the entire block in which it was included the second time is invalid. Thus, the entire block will simply be ignores by the network.
This means miners have a very strong incentive to not do this. It doesn't really matter how they do this, but if they risk including a transaction twice, they'd lose the entire reward (subsidy + fee) from that block if they'd win it.
Turns out, it doesn't need much to prevent it, and arguably with existing software it is much harder to do include duplicates than not. Recall that every block needs to contain the hash of its parent block. This means the miner needs to be informed of that parent block first, and gets to see it. A new block tenplate (with transaction selection) can't be constructed before the previous block is known. Since building on top of an invalid block is also invalid, software will also validate that new parent when it comes in. As a side effect, it knows about its transactions, and thus knows what a successor block is allowed to contain (which excludes duplicates of course, but also other forms of double spending).
There is sort of a shortcut that is sometimes taken in practice. When a new block is found, miners may learn about its existence faster than that its validation nodes have learned and processed the full block. In this case, a miner may instruct its hashers to temporarily switch to mining on top of an empty block (which is certainly valid). When the new parent is fully procsssed, hashers get an upgraded template with actual transactions. This can be dangerous, and has caused a significant fork of empty blocks building on top of an invalid block, around the time BIP66 activated.