text:
unconfirmed payment
I was trying to purchase something online using bitcoin.  after submitting the payment I got a screen that said "Payment has been received but needs 2 bitcoin confirmations to be accepted. Please return to merchant and allow up to 30 minutes for the bitcoin network to confirm payment."  after 30 minutes I received a screen that said "unconfirmed transaction."    What do I need to do now?   The amount has been withdrawn from my wallet but the merchant has not received payment.  Is the money just gone now?

Did you include a transaction fee with your payment?  Are you able to see the transaction on sites like http://blockchain.info?  The money is not gone, and most likely it will eventually be confirmed if you just wait longer.

If you've gotten that far, it means that your transaction was sent and received by the network and also by the vendor.
"Unconfirmed Transaction" means that the transaction has been sent but has not been made permanent in the blockchain yet.  Blocks are mined on average every 10 minutes, but due to random chance this time can increase to over an hour at some points.  You just have to wait until these confirmations occur and then the vendor will accept your payment.
If you want to watch newly mined blocks in real time, check out https://blockchain.info/.  On their homepage, the most recently mined blocks are listed and newly mined blocks will appear as soon as they're mined.

authors: יהוידע שטינמץ


text:
Bitcoin transaction scripts : does ScriptSig or ScriptPubkey run first?
I'm confused as to the order regarding which script is run. For examples sake: say I want to spend 1 Bitcoin which was given to me by Alice in a single transaction of value 1 Bitcoin. I understand that the input to me is 1 Bitcoin and the output is 1 Bitcoin, but I am not sure about the which script runs first when i want to 'claim' this transaction
Edit: after reading the other question, I'm not sure if this is a chicken and egg kind of question. its a cycle where one runs after the other...

After reading the other question, I'm not sure if this is a chicken and egg kind of question. its kind of like a cycle where one runs after the other?

I see. The funding transaction defines the spending  condition in the scriptPubKey, and the spending transaction provides the solution in the sigScript. When the tx' script logic is executed, the sigScript goes onto the stack, followed by the scriptPubKey. I recommend Andreas' book "Mastering Bitcoin", chapter 6 (Transactions, page 132ff). It is freely available online... and Ken Shirriff explains it very well (http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html).

Thanks , I have always wanted that book but thought it will be better to cover the basics via the Coursera Princeton course .... however it was the course's lecture on scripts which got me confused as to the order of scripts

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Sending bitcoin unconfirmed, now wallet balance is unconfirmed
I am using Multibit HD 0.4.1. I was trying to send 0.5 bitcoin, but it seems to be unconfirmed for an hour.
I tried repairing my wallet, thinking that was the issue, but now my previous balance became unconfirmed! I had about $340 in my balance but now it says $0, with $340 unconfirmed. Will the balance be confirmed once the sending transaction is confirmed? This is time sensitive, so I need to resolve this issue quickly.

The other guy is wrong, I have the same problem as you( http://prntscr.com/cv38x1 - the coins were confirmed in 2015 but it shows transaction status as unknown).
Your issue is most likely the one described below:
https://github.com/keepkey/multibit-hd/issues/862
- this didn't work for me, but I recommend you try it as it did help some other people.
Now if you still have the problem, I figured out how to recover around $100 out of $146 by using the Mnemonic phrase to generate my old private keys, but for some reason it only generated some of them (I suspect that the reason I couldn't recover all of them is due to an issue with BIP32 compatibility Multibit had a year ago).

Please note that Stack Exchange's aim is to provide open Question & Answer pages that help the whole community, for free. Therefore it is not allowed to offer off-site help e.g. by asking to contact you by email. Of course advertising non-free help is not allowed either.

Keep clicking 'receive' to generate the next addresses that you received the coins on, then you will see your balance on those addresses. Multibit only generates 1 address at a time. If you received coins on an address from 10 addresses in the future, then you won't see it until you click 'receive' 10 times.

Having an unconfirmed balance simply means that that wallet is involved in an unconfirmed transaction. This can be a transaction made by that wallet or a transaction by a different wallet which pays to that wallet. Your wallet's balance will be confirmed once every transaction its involved in is confirmed.
Currently, there are more unconfirmed transactions than usual. You can check how many unconfirmed transactions there currently are by clicking this link. That's why your transaction didn't go through yet even though its fee is high enough.
Repairing your wallet will not make the transaction go through faster. This only depends on when a miner decides to include your transaction in a block. And as I already said, your wallet's balance being unconfirmed simply means that your wallet is involved in an unconfirmed transaction.

The unconfirmed balance is showing up even when there are no pending transactions.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
What should I say when I "sign" a message, to prove that I own an address?
This reddit thread discusses a user who lost some coins and is trying to prove that he owns that address.
There was a question in how he signed, and what he signed in the message fields, since it's easy to become an imposter the way he did it.
Question
What should (and should not) be written in the message field to prove ownership of a particular address?
Examples might include:
- Date
- Nonce?
- ID such as Username, email address, full name, pgp public key, etc.
- To

Should the first "When" in the question title be "what"?

@JoshuaTaylor: Apparently so.  I edited it.

The problem stated here is that the message signed was only four uppercase letters: "DJFC." Apparently this is the person's Reddit username, but it's also a very tiny amount of data which can often be problematic. Mathematically speaking, the more entropy in your signed message the greater confidence it inspires. Simply signing your username is also not typically enough to reasonably prove that the poster and the signer are the same person.
I would personally take a hint from the sorts of cryptographic handshakes that automated systems use. Typically these involve a server-side nonce and a client-side nonce. Each of you should choose a large chunk of random data from a good entropy source (random.org, etc), publish those nonces publicly and then sign a message which includes both nonces as well as your intended message.
Having another entity provide a nonce for you to sign is known as a "challenge" and ensures the validity of the signature by providing a large amount of input entropy that the signer can have no prior knowledge of. Including your own nonce and publishing it publicly alongside the signed message proves that the person signing the message also controls the posting account. For example:
The challenge:
twentyseventy: DJFC, please sign the following nonce in addition to a nonce of your choosing:
ff 44 45 1a 5d 78 3a 19 a8 45 cf 83 05 cf 86 a1
64 1b 1e cf 8e ad 69 3a f2 5f 6e 12 12 2e af 76

The response:
TheDJFC: I have chosen the following nonce:
96 c4 41 1a 5e 27 22 0c 64 15 6d 3e 02 ea bd e4
99 dc 47 82 ba 30 2c db 49 e2 7a bb 87 c4 5f 32

---- BEGIN SIGNED TEXT ----
ff 44 45 1a 5d 78 3a 19 a8 45 cf 83 05 cf 86 a1
64 1b 1e cf 8e ad 69 3a f2 5f 6e 12 12 2e af 76
96 c4 41 1a 5e 27 22 0c 64 15 6d 3e 02 ea bd e4
99 dc 47 82 ba 30 2c db 49 e2 7a bb 87 c4 5f 32
---- END SIGNED TEXT ----
<insert signature here>

If security is less paramount, one could perhaps forego the complexities of a nonce-based system and simply sign a much more detailed message. For example, instead of:
Message: DJFC

One could sign a message like:
Message: 2014-06-02 11:43AM PST. I, TheDJFC, in response to a request to be found at the
specified URL, sign this message as proof of ownership of the specified Bitcoin address.
Address: 1P6iT6SJe4fZkKdzZBvMGoNj4KLnpSgNSp
URL: http://www.reddit.com/r/Bitcoin/comments/273vi2/if_you_just_received_800_bitcoin_out_of_the_blue/chx4wjc

Why all this drama? Well, I can think of a half-dozen ways off the top of my head to trick someone else into signing an arbitrary message with their Bitcoin address. Without the context of a Reddit user named "TheDJFC" that four letter "DJFC" string just looks like random letters, easily confusable with a nonce. It's also worth noting that the message was only signed with one of the input addresses, while the transaction in question references multiple addresses. In such cases, signatures from all addresses used would be preferable, especially where such large amounts of money are involved.

In this particular instance, I think you could say:

2014-06-02 20:08 UTC I am Reddit user TheDJFC, who posted http://www.reddit.com/r/Bitcoin/comments/273vi2/if_you_just_received_800_bitcoin_out_of_the_blue/ and am requesting a refund to 1P6iT6SJe4fZkKdzZBvMGoNj4KLnpSgNSp of my 800 BTC that I accidentally sent to an unknown party with transaction 4c1c085b39a64bcbdc8e651d5ffc3cddbb212d43c455c14d652c4600aa751fd6

And sign it with all 5 input addresses (signing it with 1 of them only really tells me that the sender of 200 of those BTC signed it, not the owner of all 800.00197476). And if I wish to challenge him with a nonce by saying, "I have the 800 BTC, send me the same message but include nonce 18291312", then he should be able to sign (again with all 5 input addresses)

2014-06-02 20:08 UTC I am Reddit user TheDJFC, who posted http://www.reddit.com/r/Bitcoin/comments/273vi2/if_you_just_received_800_bitcoin_out_of_the_blue/ and am requesting a refund to 1P6iT6SJe4fZkKdzZBvMGoNj4KLnpSgNSp of my 800 BTC that I accidentally sent to an unknown party with transaction 4c1c085b39a64bcbdc8e651d5ffc3cddbb212d43c455c14d652c4600aa751fd6 nonce 18291312

In other scenarios, including other things you mention (date, email address, full name, PGP public key) would be a good idea. E.g. if someone wanted to send an email to me, I might sign a message saying

2014-06-02 20:08 UTC My PGP public key fingerprint is a1b2c3a1b2c3a1b2c3a1b2c3 and my email address is myname@gmail.com

The above examples don't really need a date, IMO: the Reddit thread has its own date (and really, I don't care whether he signed this message 5 minutes after or 2 minutes ago), and the PGP fingerprint refers to a dated public key (which can be expired if need be, I think). But, it never hurts, and it might help clarify and solidify things.

What's the point?
Here are some ways I could twist a simple signature like his (just "DJFC" from one of the addresses) to my benefit:

I could create a Reddit account that looks like "DJFC", and say the same thing
I could ask someone to sign (purporting it to be a nonce) the message "DJFC" with their address, and pretend that means I'm that person.
The multiple inputs on the transaction might have been different parties. Let's say 200 of the BTC were mine, and 600 were DJFC's. I could sign a message requesting a refund to me (and me alone) from one of the addresses, but I couldn't sign it from the others.

authors: Михаил Пелевин

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Transaction with slightly changed script is never relayed
I am playing with bitcoin transaction a bit now.
I have a question. Normally, the output script looks like
OP_DUP OP_HASH160 (hash) OP_EQUALVERIFY OP_CHECKSIG

Now that is understandable. However, when I slightly change the script with an outgoing translation to
OP_DUP OP_DROP OP_DUP OP_HASH160 (hash) OP_EQUALVERIFY OP_CHECKSIG

this transaction is never relayed (as far as I can say) and never reaches any miner, even when it's 100% legal.
What is going on? Why is it not relayed? I even added quite large fee on it.
And a second question - if my suspicion is correct and it is actually never relayed - what would happen if some miner actually accepted it and this transaction ended in the blockchain? Would it be a valid transaction? Would the client be able to "see it" when he is not able to relay it?

How did you change the script? I've been trying to figure out how to do that

with playing with the source code.

The standard client will not relay non-standard transactions. However, if you get them directly to a miner that accepts them, clients will process them correctly and the transaction will work.
You can send your transactions to 173.242.112.53. This is a server run by Eligius that will relay all valid transactions and they will include even non-standard transactions in the blocks they mine. Others who are willing to relay or include free and non-standard transactions also tend to link to this node, so it can get your transaction included in blocks mined by other pools as well.

OK, this is interesting. Thanks! What is the reason for this client behaviour?

It's a way to prevent the network from being flooded with a large number of very small nuisance transactions. Someone could move the same coins back and forth over and over, bloating the block chain and flooding out legitimate transactions. The decision not to relay "non-standard" transactions is kind of mysterious and I'm not sure what the thinking is.

"Someone could move the same coins back and forth over and over" - which is basically exactly what I am doing now :D

If you're testing, you might want to consider running on a test network rather than the real one.

Hm, I have never heard about "test network", it seems interesting, I am probably going to use that. How do I get "test bitcoins"?

From the test faucet of course.

David Schwartz : By the way, for your information: I was never able to send the transaction with the non-standard script, even when I sent it to 173.242.112.53. It doesn't appear, even in transactions confirmed by Eligius. (If I can trust the way blockchain.info is tracking it)

This is for sending transactions directly to Eligius: http://eligius.st/~wizkid057/newstats/pushtxn.php

In fact this should be a comment to David's answer instead of a new answer. Also, you are not meant to include a footer with a tip address in an answer.


text:
Is blockchain always "public"?
Is the following definition of blockchain by its wikipwdia page correct?
Where it is mentioned:

A blockchain is a decentralized, distributed and public digital ledger
  ...

Cannot we have a private blockchain? And if so, is the above proposition wrong ? when it says always a blockchain is public.
An example: Consider a company or organization which aims at using (permissioned) blockchain such that it is visible only for its (internal) employees. So, it uses ex. visibility property of blockchain but limited only to internal employees.
Please Note that here the question is NOT if using a permissioned blockchain is logical or not, but also the question is the exact definition of a blockchain. So, according to definition of blockchain in its wikipedia page, a permissioned blockchain is real blockchain?

Ok, you can create your own private blockchain. It will be visible only by yourself. Nobody will not even know about it. I do not see any reason for it, but you can call it "blockchain" if you want. You can call it "my private blockchain" or even give any name for this technology, for example "nsdfuishgreryuiw"

Consider a company or organization which aims at using (permissioned) blockchain such that it is visible only for its (internal) employees. So, it uses ex. visibility of blockchain but limited only to internal employees.

Their are two kinds in blockchain

Permission less
Permission-ed

In Permission less blockchain (Bitcoin) it's public. And anyone can join network.
In Permission-ed blockchain (Private company) ,participants are known and it may not be public to everyone.

In regards to bitcoin, yes, the blockchain is always public. The reason behind it is that it needs to be. Without having public access to the bitcoin blockchain the whole system would not work. A miner for example could not verify pending transactions because how would he know if they are valid or not without checking the blockchain? The public blockchain is a part of what makes bitcoin so special - without it, bitcoin would not be a decentralized network. You would need a central authority which manages the blockchain and keeps it private, just like a ... bank.
So in conclusion, the blockchain need to be accesible to everybody who wants to take part. As bitcoin wants everybody to be able to take part, everybody needs access to the blockchain.

Thank you, but my question is, in general, blockchain and not necessarily Bitcoin blockchain.

If you could extend your question and describe what you are actually trying to achieve we might be able to help you more.

I edited my question. My main question is about correctness of proportion of blockchain wikipedia page (i.e. blockchain is alway a public ledger?) and permissioned blockchain.

Well of course you could deploy some kind of "private blockchain technology" inside a company. But why not simply use the existing and working system?

It's not my purpose, but also I want to be sure that if the existing definition of blockchain in its wikipedia page is correct? Is a permissioned blockchain public ? The fact that deploying a private blockchain is logical or not is another question. The question is definition of a blockchain.

By the pure technical definition: no, a blockchain does not need to be public. It must however be accesible to everybody who wants to take part in the system. The reason why the wikipedia page says it is public is because there they are talking about real world applications like bitcoin.

OK, but the page is not about only Bitcoin BC, but also it defines generally the BC. From my point of view, to have an immutable BC, we need the blockchain to be maintained by a decentralized consensus, otherwise in case of using ex. PoA and permissioned approach, since it's a centralized approach, there is no guarantee for a BC user that in future what happens for the BC and if the BC will exist after years? So, in this case, there is no guarantee for existing transactions history in future. And   at this point question is why do we use such a blockchain?

blockchain is not immutable

@amaclin It depends on which consensus mechanism we use. ex. in case of using PoA, if pre-selected validators decide to change/remove the whole of blockchain, it's possible. When we talk abut blockchain, we don't talk necessarily talk about Bitcoin blockchain. Meanwhile, do you mean action history? and if so, blockchain is not reliable anymore.

I think the 'public' in this definition is not equals to the 'public' for public blockchains.
We may consider whether a blockchain is public in these points:
1, If anyone can read it;
2, If anyone can join and become its user freely;
3, If anyone can add blocks on it.
For public blockchains like bitcoin, the answers are all yes. If for some blockchain, some answers are yes and some are no, it is not easy to say if it is public.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Bitcoin trading: security
I have seen different trading websites on Bitcoin and a question came to my mind:
Security
Why do they require so much identity verification? If I remember correctly MtGox (despite what later happened) when it started, it didn't require any id\bank verification. So my question here is: is identity verification required by law even when dealing with bitcoin trading or is it an anti-fraud system enacted by the trading operator?

Please ask unrelated questions in separate posts. I am editing out your second question; you can view it in the edit history if you want to paste it into a new question.


text:
Bitcoin cloud trading
Is there a trading bots that trades automatically and can also be hosted by the company that is providing the service?
I've found BTCRobot and Butter Bot. Any reviews on the validity behind these companies and maybe some personal experience would be more than appreciated.

I'm going to give a general answer here and say any off the shelf BTC trading software is not going to be profitable. Why? Because there's absolutely no reason a functional trading bot would be sold when it could be used to generate income.
Profitable bots would be custom made and not advertised.
Any claims made are dubious at best on these websites.

In practice you are probably right, but in principle it's a bit more complex.  If there were a bot that produced risk-free profit I would agree that nobody would sell it.  But you could imagine a bot that turns a profit on average, but at substantial risk.  A developer who was risk-averse might rationally prefer the safe profits from selling the bot over the risky proposition of running it themselves.

@NateEldredge good distinction. Websites make the claim the bots make $x per hour. That could be true (at the extreme end of truth!) but how does this bot handle more complicated tasks? Ie is the bot losing 3x $x once a day?


text:
Standard Transactions and relaxation rules
We all know that there 5 common types of Standard transaction scripts. My question is if we create a script under what rules is it decided if it standard or non-standard?
Under the hypothesis that it is non-standard if some miners accept then what happens? It will be included in a block only if these miners succeed in creating a block?
Furthermore signing transactions without SIGHASH_ALL but with any other hash type is considered non-standard?

I think some combination of the questions tagged [tag:non-standard] (some of which I have just retagged) address everything you are asking.  You might have a read through those, and then see if you still have something to ask.


text:
http post via java to bitcoind does not work
I am using Ubuntu Server 12.04. My *.conf file:
...
# Enable RPC
server=1

# Uncomment to allow localhost to use RPC
rpcallowip=127.0.0.1

# RPC information
# THIS MUST BE CHANGED FOR YOUR SECURITY
rpcuser=username
rpcpassword=passssssssss_new

# Mining is initially disabled
# gen=0
...

Java RPCClient that I use:
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.ParseException;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;

public class RPCClient {

    private static final String COMMAND_GET_BALANCE = "getbalance";
    private static final String COMMAND_GET_INFO = "getinfo";
    private static final String COMMAND_GET_NEW_ADDRESS = "getnewaddress";

    private JSONObject invokeRPC(String id, String method, List<String> params) {

//      CloseableHttpClient httpclient = HttpClientBuilder.create().build();
//
//      httpclient.getCredentialsProvider();
        DefaultHttpClient httpclient = new DefaultHttpClient();

        JSONObject json = new JSONObject();
        json.put("id", id);
        json.put("method", method);
        if (null != params) {
            JSONArray array = new JSONArray();
            array.addAll(params);
            json.put("params", params);
        }
        JSONObject responseJsonObj = null;
        try {
            httpclient.getCredentialsProvider().setCredentials(new AuthScope("198.154.*.*", 34907),
                    new UsernamePasswordCredentials("username", "passssssssss_new"));
            StringEntity myEntity = new StringEntity(json.toJSONString());
            System.out.println(json.toString());
            HttpPost httppost = new HttpPost("http://198.154.*.*:34907");
            httppost.setEntity(myEntity);

            System.out.println("executing request" + httppost.getRequestLine());
            HttpResponse response = httpclient.execute(httppost);
            HttpEntity entity = response.getEntity();

            System.out.println("----------------------------------------");
            System.out.println(response.getStatusLine());
            if (entity != null) {
                System.out.println("Response content length: " + entity.getContentLength());
                // System.out.println(EntityUtils.toString(entity));
            }
            JSONParser parser = new JSONParser();
            responseJsonObj = (JSONObject) parser.parse(EntityUtils.toString(entity));
        } catch (ClientProtocolException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (org.json.simple.parser.ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } finally {
            // When HttpClient instance is no longer needed,
            // shut down the connection manager to ensure
            // immediate deallocation of all system resources
            httpclient.getConnectionManager().shutdown();
        }
        return responseJsonObj;
    }

    public Double getBalance(String account) {
        String[] params = { account };
        JSONObject json = invokeRPC(UUID.randomUUID().toString(), COMMAND_GET_BALANCE, Arrays.asList(params));
        return (Double)json.get("result");
    }

    public String getNewAddress(String account) {
        String[] params = { account };
        JSONObject json = invokeRPC(UUID.randomUUID().toString(), COMMAND_GET_NEW_ADDRESS, Arrays.asList(params));
        return (String)json.get("result");
    }

    public JSONObject getInfo() {
        JSONObject json = invokeRPC(UUID.randomUUID().toString(), COMMAND_GET_INFO, null);
        return (JSONObject)json.get("result");
    }

    public JSONObject getInfo(String command) {
        JSONObject json = invokeRPC(UUID.randomUUID().toString(), command, null);
        return (JSONObject)json.get("result");
    }

    /*public static void main(String[] args) {
        System.out.println(new RPCClient().getInfo());
    }*/
}

Current result:
{"id":"60f910c6-a893-4753-a9d3-cbe6973ccb14","method":"getinfo"}
executing requestPOST http://198.154.*.*:34907 HTTP/1.1
----------------------------------------
HTTP/1.1 403 Forbidden
Response content length: 0
Unexpected token END OF FILE at position 0.
    at org.json.simple.parser.JSONParser.parse(JSONParser.java:257)
    at org.json.simple.parser.JSONParser.parse(JSONParser.java:81)
    at org.json.simple.parser.JSONParser.parse(JSONParser.java:75)
    at RPCClient.invokeRPC(RPCClient.java:61)
    at RPCClient.getInfo(RPCClient.java:96)
    at KeccakTest.main(KeccakTest.java:125)
Exception in thread "main" java.lang.RuntimeException: java.lang.NullPointerException
    at KeccakTest.main(KeccakTest.java:129)
Caused by: java.lang.NullPointerException
    at RPCClient.getInfo(RPCClient.java:97)
    at KeccakTest.main(KeccakTest.java:125)

@George Kimionis, "198.154.xxx.xxx" is ip of the server, 34907 - port for JSON-RPC connections.

@George Kimionis, thanks! "rpcallowip=*" was helpful.

In this line:
        HttpPost httppost = new HttpPost("http://198.154.*.*:34907");

the address 198.154.*.* is not valid IP address syntax. If that is really how your source code looks, then you need to use a full, valid IP address which is all numbers (for example, 198.154.1.1 or whatever is appropriate for your network).
Even if you're deliberately obscuring your IP address for us, you still have a problem because you have set rpcallowip=127.0.0.1 which only allows that address to talk to the RPC server. Add another rpcallowip line that contains the address of the machine where you are running this Java code.

HttpPost httppost = new HttpPost("http://198.154..:34907"); - I have hidden full ip address. There are numbers instead "*".


text:
How does MultiBit figure out balance of an imported address?
MultiBit is a Simplified Payment Verification (SPV) client that uses the merkle root of block headers to validate transactions. I'm wondering however, when an address (private key) is imported into MultiBit, how does it know its balance without going through all the transactions within the blockchain?

When MultiBit imports a private key also in the import file is the key birthdate I.e when it was first generated.
From that date it looks up the most recent checkpoint (about every 2000 blocks) in a list of checkpoints it stores.
Then it contacts a bitcoind and says 'give me all the blocks from block (say) 200,000. Here is the bloom filter I want you to use to filter the blocks'.
This is fairly time consuming  compared to if you have a blockstore. (Or something like a remote server like Electrum and Mycelium do). The advantage is that it only uses the Bitcoin Network.
It now has all the relevant transactions for that private key and hence can calculate the overall balance.

In short: it does go through all blocks in the chain. However, this happens on another machine, it skips parts from before wallet creation, and uses Bloom filters to speed up the communication.

But how do you verify the integrity of a block without all of its contents; only with a filtered portion? Couldn't a dishonest bitcoind report incorrect filtered content? Or does the bloom filter simply ask bitcoind "Give me only the blocks where my address appears"?

authors: อารีย์ บุญคง


text:
What can be the reason to change transaction ID?
I always thought that when my wallet create a transaction, it's transaction id is fixed (it is the SHA256 of the transaction message). Yes, the transaction might not be included in the next block (and can even be dropped completely) but if it will be included the transaction ID is fixed. Apparently this is not correct:

Transaction IDs are not authoritative until a transaction has been
  confirmed. Absence of a transaction hash in the blockchain does not
  mean the transaction was not processed. This is known as "transaction
  malleability," because transaction hashes can be modified prior to
  confirmation in a block. After confirmation, the txid is immutable and
  authoritative.

Can anyone explain

the reasons why transaction ID can be changed?
Who can change this ID (I assume a miner who mined a block)?
What field in the transaction message can be changed to warrant the change of txId?

Possible duplicate of What is Transaction Malleability?

@NateEldredge thank you for a link, but I do not think that this is a duplicate. I know that transaction malleability is the change of transaction id (which is what that question asks). I want to know some details what exactly can be changed and for what reason.

I think What is transaction malleability will answer most of it. But to summarize it in terms of your actual questions:

the reasons why transaction ID can be changed?

Because someone can create another transaction (= different transaction message) that accomplishes the same thing as yours, while reusing your signatures.
The reason the signatures can be reused in a different message is because the signatures don't sign themselves. They don't sign themselves because that would require a dependency loop (the transaction message depends on the signature, and the signature signs the transaction message), which would be impossible to sign for.
The question is then what can be changed in a signature that doesn't invalidate it. The known ways for doing so are listed in BIP62 (which aimed to prevent some of them, but was retracted - it still gives a good overview).

Who can change this ID (I assume a miner who mined a block)?

Anyone who relays your transaction (including miners), as they see your transaction but have the ability to produce a modified version and relay that one faster than someone else.

What field in the transaction message can be changed to warrant the change of txId?

The scriptSig field in the transactions' inputs. It contains the ECDSA signatures, but also redeemscripts, public keys, and various other information needed to prove a spend was authorized.
With BIP141 (Segregated Witness), these issues are avoided by making the signatures not affect the txid anymore. Instead, they are stored in a separate field (called the witness) which is only necessary to prove a transaction's validity, and does not contribute to its effect.

Thank you very much. It is still kind of hard for me to understand how you can reuse the signature. I thought that the main point of the signature is to be non-reusable (you create a signature using your private key so no one can reuse it). Will read the BIP you linked and hopefully will get it.

A signature signs a message. That message is not the full transaction itself, as that would include the signature itself. So, it signs a modified version of the transaction which does not include the scriptSig field. As a result, things you change in the scriptSig do not invalidate the signatures.


text:
Inevitable dust spam
Given I have an account with balance 1BTC + 1 satoshi.
I want to transfer 1BTC to another account and tribute 0.0001 BTC out of that 1BTC to the network as fee. Would my transaction being rejected for produce dust spam (1 satoshi in this case)?
So the number is:

Account 1: 1BTC + 1 satoshi
Transfer: 0.9999 BTC and tribute 0.0001 BTC to miner
Left over: 1 satoshi.

Note the correct spelling is "satoshi".  I've edited to correct it.

Your transaction (1.00000001 ===> 0.99990000 transfer + 0.00010000 fee + 0.00000001 change) will be valid. But it is not guaranteed that other nodes will pass your transaction. May be yes, may be no.
Modern referral clients do not relay such transactions, because developers hate dust and spam. But there are nodes which relay such transactions and there are miners who confirm them into blocks.
E.g. https://blockchain.info/address/1Fri3h6MtMkjZjYHub4r1N6r5nERWgZXHQ

Also, the network has no way of knowing if the 1 satoshi is being sent and the 0.9999 transfer is the transaction value, or vice versa (assuming no addresses are reused). So to the rest of the network, it could look like you are just trying to make a dust output.

If your proposed transaction is to have an input of BTC 1.00000001, one output of BTC 0.9999 and a change output of BTC 0.00000001 (leaving BTC 0.0001 as a fee), then yes, most clients will reject it under the dust rule.  Bitcoin Core's rule is to refuse transactions with any output that is too small - the precise details are a little complicated, but generally outputs of less than 546 satoshis (BTC 0.00000546) are forbidden.  (You can see the full details in the source - it is the function CTxOut::IsDust() in core.h.)  It is possible, however, that some nonstandard clients would relay your transaction, and it might find its way to a nonstandard miner who would include it in a block, but there is a risk that it would not.
If you are using Bitcoin Core and you actually try to make a transaction that takes an input of BTC 1.00000001 and sends BTC 0.9999 to another address, it will avoid this problem by not creating a change output, but adding the extra 1 satoshi to the fee instead.  So you will effectively pay a fee of BTC 0.00010001, and your transaction should be relayed and confirmed with no problems.

Rejecting a transaction is not as simple as one of the outputs. If you look at this wiki page https://en.bitcoin.it/wiki/Transaction_fees all parts of the transaction are included when calculating this. Minning pools do not look for single output size when rejecting / accepting that i know of but base it off the priority shown in the formula.

That is to say my transaction should be as acceptable as other transactions without a dust, given everything else is more or less equal?

Yes this would be an acceptable transaction.


text:
RPC addmultisigaddress call
I tried the following RPC call via the debug window:
addmultisigaddress 2 '["0304a7aadeb1ae96482a10fa634825d86d80dbad8d43cd9177664eaf6f0ff7d890", "022426f087fd017db9f29759efb9d7ff6101a075e46fb591466208a6a6beb321c7"]'

The output was:
3MGYcBNapbmYkvfj9CD4hBykzWxukEE61w

This is a P2SH address, right?
The RPC call just gave the public keys, though, so my wallet won't actually be able to spend any funds sent to that address, correct?
Why even have an RPC call here that let's the user make an address they won't be able to spend from? Is this method just a utility if the private keys aren't known, and the result won't be used in the actual wallet at all?
I guess just an explanation of 'addmultisigaddress' that is more descriptive than the help via the console would be helpful.

You are correct in your understanding: the arguments to the RPC call are just public keys (or addresses, which are hashes of public keys), and if you don't hold all the corresponding private keys, you won't be able to spend coins sent to the resulting address.
But it's far from useless.  The main application of multisig addresses is to require the approval of multiple people in order to spend them, rather like needing two signatures on a check.  In that case, it's desirable for no one person or computer to ever be in possession of all the corresponding private keys  (because then anyone with sufficient access to that computer could spend the coins unilaterally).  Rather, when it's time to spend the coins, the key holders affix their signatures one by one, without ever sharing their private keys with one another.  So in fact, if addmultisigaddress required all the private keys to be available, it would be nearly useless.
For further details on multisig addresses and how to use them, see the rather extensive answer by almel to How will multisig addresses work? And as with any open-source software, the ultimate documentation is the source code.


text:
debug window of wallets
For all noobs and cryptocurrencies, is there anywhere a tutorial on how to use the wallet?
I've noticed several wallets that are just the same thing with a different name, but so far the only thing i get to know is that they give an address.
They all have an overview with the balance on the account at 0 coins, that's fine.
Then a tag of sending and asking coins, I can also get to understand what that does, even when it's empty and the only way to find other addresses is person to person. Now the crazy stuff that makes me wonder do i have to be a programmer to use these things?
What is that thing (Out of Sync) next to the wallet in red letters? How do I fix that? How can I "Sync" what exactly? Since when I install primecoin wallet for example, it starts downloading a bunch of crazy stuffs updating a bunch of weeks and after is finally done, it just tells me that the wallet is out of sync, and there's nothing i can do about it and I googled.
And people just mention but never explain a scary debug window with a console that i have no idea what it does or what should I do with that, and they only post code stuffs that if I copy paste won't work, at least not in all wallets and in those that accepted that code, it does absolutely nothing that I can know of....
Is there a newbie guide on how to get to use a wallet? primecoin, dogecoin, rainbowcoin, aimcoin... they all look just the same, and people talk about mining some few coins just by keeping them open.
Can someone help me? Please explain in baby steps I know nothing about scripts or pools or codes, or encryption, and is really frustrating me because I want to learn.

This site works best when people ask specific questions.  "Please explain everything" is much too broad.  Can you focus down on a single specific question for now?

I've notices several wallets that are just the same thing with a
  different name, but so far the only thing i get to know is that they
  give an address

They do much more than just giving you an address. They also download and store the Blockchain which contains all transactions ever made. Those data are needed to check, if one of your addresses received a payment. Those data are also needed to send data to a different address.

they all have an overview with the balance on the account at 0 coins, that's fine then a tag of sending and asking coins, I can also get to understand what that does even when is empty and the only thing i guess i have to find other addresses is person to person, now the crazy stuff that makes me wonder do i have to be a programmer to use these things?

You're right, you will get addresses from other persons or from the internet. You do not need to be a programmer. With a wallet it's like sending an e-mail, but instead of sending text, you send bitcoin. For sending bitcoin, you need to receive some first. That can be done by buying them in online trades or at an ATMs.

what is that thing (Out of Sync) next to the wallet in red letters? how do I fix that? How can I "Sync" what exactly? since when i install primecoin wallet for example, it starts downloading a bunch of crazy stuffs updating a bunch of weeks and after is finally done, it just tells me that the wallet is out of sync, and there's nothing i can do about it and i google

As I said before, the crazy stuff which is downloaded is the blockchain. For Bitcoin it can take really long, because currently its size is about 20 GB. There are different types of wallet. The full node, for example Bitcoin-Core, which I guess is the one you downloaded, is mostly for the professional user. It contains the complete blockchain, and needs very long to sync.  An other type is the SPV (Simplified Payment Verification) for example Electrum. This one dont need to download the complete blockchain, it will only download the headers, which save a lot of traffic and storage. Those are also available for smartphones and are often used by the average users. A third type is the web-wallet, like blockchain.info for those you wont need to download any data, you can access them through you browser.

and people just mention but never explain a scary debug window with a
  console that i have no idea what it does or what should i do with
  that, and they only post code stuffs that if i copy paste won't work,
  at least not in all wallets and in those that accepted that code, does
  absolutely nothing that i can know of....

This is only for developers and those post a mostly related to the bitcoin-core wallet and its JSON-RPC interface. You don't need those for normal usage.

is there a newbie guide on how to get to use a wallet? primecoin, dogecoin, rainbowcoin, aimcoin... they all look just the same, and people talk about mining some few coins just by keeping them open :S

All those wallets have the same appearance and mostly the same functionality. There are some guides around. Coindesk offers a very good beginner guide which contains many of your questions and explaining all the important stuff.


text:
What is this extra address on blockchain.info?
I sent bitcoins for the first time to my friend. He has an address 1JkqP4qMvVpQApqyH4m9J4LBdqfFacMKSf
I chose to send them through my wallet on Bitcoin-QT, but I was interested to check blockchain.info about the transaction as well.
I see that blockchain.info shows that I sent bitcoins to another address as well! Can anyone explain why it shows that I sent bitcoins (about $30) to the address 1NTyaVoNrQYx2PA5ce7bVmqA6jfmSSkvxU on blockchain.info? I definitely did not send to that address...

This is my Bitcoin-QT client window. It shows the correct transaction amount.

This is because you did not have a coin that exactly matched the amount you wanted to send to your friend.  So bitcoin had to split a larger coin into 2 coins... 1 with the amount to send to your friend and the rest as "change" to send back to you.  The address you don't recognize is a new address that was created for the change, and it's in your wallet.

Awesome answer, but what do you mean "the new address is in my wallet"? Are you saying I have two addresses now? If someone sent to that new address, would it end up in my wallet?

Yes, you have 2 addresses. Bitcoin added 1 for you.  People can send to either one and it will end up in your wallet.

BTW the term "coin" in my answer is known technically as a "transaction output" or "txout"

Ok thanks, this makes sense. Wow I was freaking out for a moment wondering where my coins went!

Why did you freak out though, because your Balance (in the upper left) is correct, right?

I'm just new to bitcoin, and didn't know what was happening. I thought my client wasn't as updated as blockchain.info for some reason.

Addresses are only supposed to be used once, so you should have one for each transaction you send. Also note that blockchain.info has a lot of misinformation, so it's best to avoid it if you don't want to get confused.

What misinformation?  I think it's very accurate and helpful!

Same thing happened to me. What I don't understand is how come this "new address" it created for me doesn't show in my addresses area in Bitcoin-QT? Shouldn't it automatically be a part of my digital wallet file? Does the address only exist on the network? Is there anyway to make it show in the QT client since it is in fact a new address of mine?


text:
Private key recovery?
I've seen many peoples are actually recovering their private keys using signatures pub key r s z values etc , anyway , I've found a way to recover it but using transaction  hex i can't found the identical R value , is there any other way to recover it from r s z ? or is it possible to recover any private key using random R values ?
I have tried this method , In my case the values of R are different , this method is just for example having same/identical R value.  ;
def inverse_mod( a, m ):
    """Inverse of a mod m."""
    if a < 0 or m <= a: a = a % m
    # From Ferguson and Schneier, roughly:
    c, d = a, m
    uc, vc, ud, vd = 1, 0, 0, 1
    while c != 0:
        q, c, d = divmod( d, c ) + ( c, )
        uc, vc, ud, vd = ud - q*uc, vd - q*vc, uc, vc

    # At this point, d is the GCD, and ud*a+vd*m = d.
    # If d == 1, this means that ud is a inverse.
    assert d == 1
    if ud > 0: return ud
    else: return ud + m

def derivate_privkey(p, r, s1, s2, hash1, hash2):
    z = hash1 - hash2
    s = s1 - s2
    r_inv = inverse_mod(r, p)
    s_inv = inverse_mod(s, p)
    k = (z * s_inv) % p
    d = (r_inv * (s1 * k - hash1)) % p
    return d, k

p  = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141

# this case is right
public_key=0x04dbd0c61532279cf72981c3584fc32216e0127699635c2789f549e0730c059b81ae133016a69c21e23f1859a95f06d52b7bf149a8f2fe4e8535c8a829b449c5ff
r =0xd47ce4c025c35ec440bc81d99834a624875161a26bf56ef7fdc0f5d52f843ad1
s1=0x44e1ff2dfd8102cf7a47c21d5c9fd5701610d04953c6836596b4fe9dd2f53e3e
s2=0x9a5f1c75e461d7ceb1cf3cab9013eb2dc85b6d0da8c3c6e27e3a5a5b3faa5bab
z1=0xc0e2d0a89a348de88fda08211c70d1d7e52ccef2eb9459911bf977d587784c6e
z2=0x17b0f41c8c337ac1e18c98759e83a8cccbc368dd9d89e5f03cb633c265fd0ddc
print "private:%x\n random:%x" % derivate_privkey(p,r,s1,s2,z1,z2)
print

# this case can be wrong
public_key=0x02a50eb66887d03fe186b608f477d99bc7631c56e64bb3af7dc97e71b917c5b364
r =0x0861cce1da15fc2dd79f1164c4f7b3e6c1526e7e8d85716578689ca9a5dc349d
s1=0x6cf26e2776f7c94cafcee05cc810471ddca16fa864d13d57bee1c06ce39a3188
s2=0x4ba75bdda43b3aab84b895cfd9ef13a477182657faaf286a7b0d25f0cb9a7de2
z1=0x01b125d18422cdfa7b153f5bcf5b01927cf59791d1d9810009c70cd37b14f4e6
z2=0x339ff7b1ced3a45c988b3e4e239ea745db3b2b3fda6208134691bd2e4a37d6e1

print "private:%x\n random:%x" % derivate_privkey(p,r,s1,s2,z1,z2)

is there any other way to recover it from r s z ?

What is the purpose of private key, if anyone would be able to recover it from other data?

is it possible to recover any private key using random R values ?

the probability is the same as trying random values for guessing private key itself

as you can see on that example , the output of that example is actually a private key of  an existing bitcoin address . so I am asking if there's any other method/code which can calculate private key just like example but without having an identical R value .

@DionWinbush And the answer perfectly answered that. If there was such a way, the private key would no longer be private and so the entire design would be fundamentally broken. Of course there is no known reason to think the design if fundamentally broken or people wouldn't be using it!


text:
Which scripts are currently considered standard and therefore actually propagated?
All I've learned about script so far is that while theoretically quite versatile (e.g. allowing multisignature transactions) most scripts are simply not propagated by the default client nodes, i.e. while you can easily transfer funds to a script, you may end up having a difficult time of ever spending these transactions. So, what makes a script standard/non-standard, is there a list of scripts currently supported by the network?

Quite the opposite: Is there a listing of strange or unusual scripts found in transactions?

I know of four standard scripts.  As Luca said, the source code for the reference client is the protocol definition, so you need to read the code to get the definitive answer.  As Peter noted, a standard script is one that is relayed by the reference client.  A non-standard script will not be rejected if it is in a block as long as it is a valid script.
The ones that I know are:

Pay-to-PubKey-Hash: This is the standard payment to a bitcoin address.  The address is in the output and the signature and pubkey are in the input.
Pay-to-Pubkey: This is a payment to a pubkey.  The pubkey is in the output and the signature is in the input.
Pay-to-ScriptHash: This is being used for some of the fancier payment transactions.  A script hash is in the output and the signature and a serialized script are in the input.  On the first pass, the script hash is verified against the serialized script.  If it checks, then the serialized script is expanded and a second pass is done using that script.
Pay-to-MultiSig: Multiple signatures are required to sign the script.  The output contains the pubkeys and the input contains the signatures.  All signatures must be verified by one of the pubkeys but there can be more pubkeys than signatures.  The current limit for M of N scripts is N=3.

You may want to add that for multisig transactions, the limit is M-out-of-N, with N at most 3. Also, for P2SH there is a requirement that the embedded script is also standard. Apart from that, this list is correct for 0.8.x.

Also note that standardness only impacts which transactions are relayed. Non-standard scripts that are valid can be put in blocks without problems, if a miner chooses to.

So currently P2SH means a transaction spending it will only be relayed if that script is again one of these four?

@TobiasKienzler That is my understanding.

As for M of N - the only limit for N per se is 15, but above a certain M+N your transaction size would be too big to be mined. We managed to push 3 of 3, and 2 of 4 through default pools when testing Orisi.org. And you can push 8 of 15 through the Eligius pool - they have only 5% of hashing power, so you'll have to wait 4-10 hours for the tx to go through. (also, see https://bitcoin.stackexchange.com/questions/23893/what-are-the-limits-of-m-and-n-in-m-of-n-multisig-addresses/28104#28104 )

Also, there is a pull request that was made by one of the core devs to relax the rules on scripts. In a few months anything will be allowed (see https://bitcoin.stackexchange.com/questions/28181/what-new-transactions-are-possible-with-15-operations ). And even before that time - Eligius will accept almost anything :)

The standard list of operations for scripts are actually within the bitcoind source-code which you can find here: https://github.com/bitcoin/bitcoin/blob/master/src/script.cpp#L90
To understand which ones are actually implemented and used, you'd have to read the source-code.
So no, there's no standard for this. The standard is the actual bitcoind program.

So a script is always considered standard if it only uses these opcodes?

No, these are just the list of opcodes that exist. Not all of them are even enabled. But it has nothing to do with standardness, that is done elsewhere in the code.

That's why I said "To understand which ones are actually implemented and used, you'd have to read the source-code."

A script being "standard" is a technical term here. Standard scripts are the ones which the reference client relays. It's independent from whether they are valid or not.


text:
Query unspent outputs for arbitrary address
Is there a way to query all unspent outputs for an arbitrary address (which I don't have the private key for), without resorting to a third party service (like Blockchain.info).
bitcoind apparently only lets you do that with addresses that belong to your wallet, even though it internally maintains the list of all unspent transaction outputs.

duplicate of Calculating address balance?

They're planning to add 'watch-only addresses' to bitcoind; https://github.com/bitcoin/bitcoin/pull/4045

this is already the 4th pull request, they've been working on it for a long time, should be getting into the next version or something I'd guess

once that is in you can get this kind of data out of the basic wallet, until then you'll need to use a blockexplorer or a 'better' wallet (eg Armory) that supports watch-only addresses.

authors: Вячеслав Тарасов


text:
How Would One Premine an AltCoin?
Looking to create an Altcoin for fun and I heard about premining. Can this be done to premine all the coins without leaving my computer mining for days?
I followed a guide here: http://andarazoroflove.org/how-to-create-alt-coin-scrypt-clones-for-fun-and-profit-bitcoin-litecoin-secrets-exposed/
Thanks

your link does not work. 404 not found. I am curious and want to see.

can you share a working link, the link is broken

If you create the coin, you get to make the rules.  Nothing stops you from patching the software to make your premining as easy or as hard as you want.  For instance, you could set the difficulty schedule so that the first billion coins require very little or zero proof of work to mine; then you could mine them all at once and award them to yourself.
Of course, the hard part becomes convincing anyone else to use a currency that's so obviously slanted in your favor.

You could just inject a coinbase transaction in the genesis block if you wanted to.

@DavidSchwartz I thought the coinbase in the genesis block was unspendable: https://en.bitcoin.it/wiki/Genesis_block

@JBaczuk: That's true for Bitcoin because of a specific bug in the original code, which now has to be kept in order to avoid a hard fork.    But if you're making your own coin, you can fix that bug.

@NateEldredge could you share some link

@rahhh: https://bitcoin.stackexchange.com/questions/37559/how-to-make-genesis-block-transaction-spendable https://bitcoin.stackexchange.com/questions/10009/why-can-t-the-genesis-block-coinbase-be-spent https://bitcoin.stackexchange.com/questions/35760/is-it-true-the-genesis-block-reward-cant-be-spent-forever?noredirect=1&lq=1

The rules for setting the rewards in the blocks can be as simple or as complicated as you want. Most Bitcoin derivatives have followed suit with fixed mining block rewards that are halved after some amount of time, just changing such amount and the time after which it gets halved.
Others, (as Lucky, Doge, Cat coins) have a random block reward whose mean value is reduced after some amount of blocks. Plus, some coins (42 and formerly Doge) have a random "superblock" where reward is much higher than usual.
Primecoin and its derivatives have the reward dependent on the difficulty of the network, and there are some other, weirder models.
The "premined" model is usually achieved by defining the rules so the genesis block yields an incredibly high amount of coins and the next blocks give out a more "normal" distribution with a normal decay of reward. That way the creator of the coin, just by the act of creating the genesis block, automatically becomes the owner of a significant amount of coins.
"Insta-mining" is similarly, defining the yields so the first blocks give a very high reward which then decays extremely rapidly - so creator of the coin and the very first miners (usually the creator's associates) end up with most of the coins. Quarkcoin was highly criticised because of this, in the end was more or less accepted by the community after its novel approach of multiple proofs of work was deemed interesting.


text:
How vulnerable are offline users of bitaddress.org, who don’t use Ubuntu?
By not installing Ubuntu and not removing the hard drive, I suppose I am vulnerable when I open bitaddress.org offline and enter the 64 random hexadecimal characters I have generated without a computer to find corresponding public address.
Yes, I clear the browser before re-connecting to the net. I never use the mouse to copy the private address (or indeed keep any computer record of it) but, if malware can pick up the 64 random hexadecimal characters which I typed in or if it can take a screenshot of the private WIF address I am screwed.

I don't really know how one would quantify "how vulnerable".  It depends mainly on your general computer security practices.  In general, if there is any kind of malware on your computer, it could certainly pick up the private key and you would be screwed.  On the other hand, this is true whether you use bitaddress.org or some other software.  Clearing the browser cache and avoiding the clipboard don't really help.

It mostly depends on if you do this using a computer which has a chance to get infected by malware. If you are doing this using your everyday Windows laptop then maybe there is a chance.

Also you can boot to Ubuntu from USB stick - no need to unscrew harddrives or anything like that

I suggest you re-ask your question "what is a safe way to use bitaddress.org, when my purpose is X and I am using tools Y"

No, I am using either my computer at work or home which I use for everything. I suppose if I wish to transfer larger sums to cold storage I will have to start thinking about booting with Ubuntu. I’ve seen the tutorial videos, but I have never done it.
Why can’t there be a small cheap calculator-like device with no internet capabilities into which you put a random number and it gave you a public address on the screen? Any fool (like me) could store cold then.

Such devices exist; they are called hardware wallets. You can read about some of the ones on the market at https://en.bitcoin.it/wiki/Hardware_wallet. I'm not sure that any one of them has caught on at a large scale, so far.

Incidentally, there is not really anything magical about using Ubuntu for this purpose rather than some other operating system.  Ubuntu happens to be a free and reasonably secure  OS that is relatively easy to boot from a USB stick or other removable media (and by no means the only such OS).  But any other OS running with no Internet connection would work just as well for this purpose.

Depends on what you are going to do with your address. As for me there are three main cases to consider:

Will you store so huge amouts of bitcoin to fear attackers who are targeting yourself directly?
Are your computer as unsecure as most of non-technical people computers (and therefore: is it possible that it is already infected by some virus)?
Or last but not least: are you doing some controversial business and fear being spyed by government or someone else who may want to know either your private keys or just that certain address belongs to you?

In fact in everyday life situations there is no need for security better than just keeping your antivirus up to date and avoiding storing generated keys on disk (which could lead to a leak if your computer gets compromised in the future). Unless you've put all your savings in BTC.

Perhaps use a Raspberry Pi. Never connect it to the net and use either the standard Raspbian OS or there is a bitcoin-centric one (I forget the name).
PS: I'm not sure why you single out Ubuntu..  I assume you mean Linux rather than Ubuntu specifically..  I my personal opinion Ubuntu is too commercial  - if you're really paranoid and really trying to keep your keys secure then use a "proper" 100% open-source non-commercial Linux OS such as Debian.


text:
Searching for old bitcoin “accounts “
I recall accepting bitcoin payment several years ago when the concept was fairly new. My trouble is, I don’t know what happened to the bitcoin after the receipt. What methods are available to search for “lost or abandoned “ bitcoin?
Thanks in advance
Becky

If you do not control the private keys to the addresses where you received your bitcoins, there is no way to recover it. However, if you were using a third party service that were holding your bitcoins for you, you can enquire with their customer service department

How did you use to accept Bitcoins? Using what software?

What methods are available to search for “lost or abandoned “ bitcoin?

There are no methods available to other people (third parties). People could search for dormant amounts that were outputs of old transactions and not yet used as inputs to subsequent transactions - but those amounts may not actually be lost or abandoned. There is no way to recover control or gain control of these amounts without additional information known only to the person who received those amounts of bitcoin.
If you previously received some amount of bitcoin into a bitcoin wallet, you can search for evidence - perhaps a note of an online website who stored that amount on your behalf and who you could now contact for assistance. Perhaps some old "wallet.dat" files on a PC that indicate you had a desktop wallet with control of your own private keys. Maybe an app on an old phone in a drawer. Perhaps a written down recovery seed or private key in a locked box you use for important documents.

In order to get access to the bitcoins, you need to have the access to the bitcoin address or the bitcoin wallet (usually a wallet.dat file) containing that address.
If you have the address, you can check if it has any balance on it with various explorers. [1] [2] [3]
You can access the address if you have its private key (password).
If you have the wallet.dat file, you will need a password to unlock it if it has been encrypted. Else, you can access it without a password.


text:
Why do transactions take so long to confirm in testnet?
I have created a transaction with high miner's fee and it is now in mempool (in testnet):
https://live.blockcypher.com/btc-testnet/tx/abcc4ce473f490896e87102fe3ffb857ff735a0fc97525dadf9c5b0ed5410f9f/
However, it doesn't seem to be confirming. It's already missed two opportunities to confirm. Transactions with much lower miner's fees are going through instead.
Is Bitcoin this random or am I missing something?

Another possible cause is that your transaction has an output which is dust, as do several of its ancestors (which are also still unconfirmed).  But I am not sure whether the dust rule is enforced by testnet nodes by default.

It's confirmed now.

Decoding your transaction shows an output:
"vout": [
    {
      "value": 0.00000000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_RETURN 68656c6c6f5f776f726c64",
        "hex": "6a0b68656c6c6f5f776f726c64",
        "type": "nulldata"
      }
    }, ...

This might be the reason the miners won't touch it as it may be flagged as non-standard on older nodes. Notice the warning on blockcypher:

Maybe someone can comment on exactly why, as these null_data transactions were made standard on Bitcoin-core 0.9.0, see https://bitcoin.org/en/developer-guide#null-data

I wondered about this possibility, but I thought the "standard" checks were disabled on testnet.  Also, what with the segwit soft fork, I don't think there could possibly be any miners running 0.9.0 or earlier.

Yeah that's what I was thinking as well, it's curious. blockcypher states it is in 71 mempools at the moment, seems low to me.

I'm also having problems with testnet which I have not seen before.  I'm thinking I may have changed something in my scripts but cannot see what it could be.  I'm using multi-sigs for most of the destination addresses
https://tchain.btc.com/2N16FGLa4YpTnCuby9xZT2T2q3rkAxfcX6Y
https://tchain.btc.com/5cd81ee81ca48500edb78956aefa6f9f06074a7a7a234579313e5e40cb01b022


text:
How to get staking balance using RPC commands
I enabled staking on my wallet. I want to know the staking rewards I got. Is there any rpc command exist to get staking reward balance?
Thanks

Hello, welcome to bitcoin.SE! You'll need to provide more information in order for someone to reply, right now we don't even know which cryptocurrency or software you're talking about.

Removed the [tag:bitcoin-core] tag since official Bitcoin Core clearly doesn't have any such feature.

I am not sure, whether this is the right place to ask or not. My question is regarding the Proof-of-stake coin. I want to check the PoS reward with RPC commands. Please help me with this problem

A staking system does not exists in Bitcoin's Proof-of-Work consensus model, that being said you will not find any "staking" related functionality in the RPC API. There have been several proposals for a Proof-of-Stake model where this would exist, but of course these have not yet been adopted or have reached any general agreement among the Bitcoin community.

Let say, coin is built on bitcoin with PoS activation. How can we get stake balance in this case?


text:
How can I verify someone controls the private key behind a segwit address?
With a legacy P2PKH address, signmessage and verifymessage can be used to verify that the other party actually controls the bitcoin address in question. However, P2SH, P2WPKH and P2WSH addresses throw an error for signmessage, and we don't know when or if this will be made to work. So, another procedure is necessary if we want to accomplish the same thing with segwit.
As a work-around, I could have the owner of the segwit address send 1 satoshi to a verification address that I create in my wallet just for them. But that's a hassle and it's off-putting to them. And what if they want their satoshi back? =D; that would be a hassle.
Is there a way to accomplish the same proof of ownership without them having to send me coin?
I prefer an answer using the json rpc on my end (But failing that, I also have access to bitwasp, and failing that, I'm open to anything that runs in php), and the easiest (manual) procedure on their end. These are non-technical ordinary users. I might be able to nudge them into using a particular wallet if that wallet has a feature which will allow them to implement the idea in a better work-around.
I didn't tag this with json-rpc because I don't know what technology the answer will come from.

First of all, the operations signmessage and verifymessage allow to prove that whoever creates a signed message with this address specified can receive Bitcoins in that address. This does not prove the user owns the private key (corresponding to the public key the address is generated from) as this address' private key could be handled by a third-party wallet service (like an exchange), so the exchange would be able to create this signed message too (and the user may not have access to the private key).
With P2SH addresses you cannot create signed messages as they are Pay-to-script-hash (P2SH) addresses. This means using this addresses in outputs can only be unlocked by specifying a valid redeem script in a transaction that spends this outputs where the adress is specified. Therefore, not necessarily public keys must be present in the mentioned script (like a HTLC) and a signing scheme can't be developed as it would require to reveal the redeem script which may cause a serious security issue (like in HTLC after the timelock is over).
A fix you could try in order to get the same functionality is to create a transaction that spends this UTXO where the address is specified with a minimal amount of 1 satoshi and no outputs. This way who does this can prove they can receive Bitcoins in that address.
But notice the security issues revealing a redeem script means (for instance this would not be appropiate for a HTLC but could be for a multisig where every one agrees to create that transaction). This problem replies also to the problem with performing this operations with P2WSH addresses as they share the same main problem.
With native P2WPKH (and P2SH-P2WPKH), a new signing scheme had to be defined due to technical issues. This is already partially implemented (just implemented with P2SH-P2WPKH addresses) in Trezor's web wallet and under development in Bitcoin Core.

This is a lot to decompress, but it will be a good education. I'll mark as answer once I can understand it. Good answer!


text:
How many Bitcoins do i need to purchase an item of 100$
I have 0.07942 in my alpha bay account and i cannot purchase an item retailing @ 100$.
How many more bitcoins do i need for the transaction to go through.

Use public exchange rates to get the Dollar equivalent (e.g. Coindesk, Blockchain.info, Bitstamp, Bitfinex, etc.)


text:
71 confirmations?
I'm not too worried if this doesn't work for some reason as it's not much money but can someone tell me what this spent thing means? It's been about 10 hours https://blockchain.info/tx-index/e146c2c298d39172c189aefc274cd644890ba85f38826c9064cb86d50a6df415

Have you checked whether it is your address?

This means that the bitcoin network has settled 71 times that the transaction you have referred to did occur and is valid. With so many confirmations, the transaction is practically impossible to change or reverse.

yeah it's just that nothing is in my wallet :/

@jay: Are you using Bitcoin Core, and is it still synchronizing (i.e. catching up to the network's state)?

@Murch multibit

idk what to do lmaoo it's whatever tho


text:
Question regarding mining difficulty
I understand that the Bitcoin mining problem is to find a string s (hash of previous block + transaction hashes + nonce) such that sha256(s) has n leading zeros, where n determines the mining difficulty.
The result of sha256(s) is a 64-length hexadecimal string. Each position of 64 has 36 possibilities (a-z, 0-9). So, the expected number of guesses would be 36^n.
The hash of block #485891 is
0000000000000000007ea3c67381ecfcf8e44e9941dcef554e8b029068857b55

which has 18 leading zeros. Thus, the expected number of guesses is
36^18 = 10314424798490535546171949056.

This hash was found by Antpool which has a hash power of 1284.32 PH/s. Therefore, the expected time for Antpool to find the hash would be
36^18 / (1284.32 * 10^15) = 8.03104*10^9 s = 255 years.

This time is obviously incorrect. Is there anything I missed out?

As you say, the result of sha256 is a hexadecimal string.  Hexadecimal only uses the digits 0-9 and a-f, which is 16 possibilities, not 36.
If you redo your calculation with 16^18 instead of 36^18, you get an average time of around 3600 seconds, or 1 hour.


text:
Is 165aBmgtQJFDLkSYPU5C8jq5gpnAtHdKBh a scam Bitcoin address?
Is this bitcoin address authentic: 165aBmgtQJFDLkSYPU5C8jq5gpnAtHdKBh
I sent BTC to the address for Paypal funding but no response from them since yesterday.

Please don't use all caps in titles or anywhere else.

There is no way to know.  Bitcoin addresses are designed to be used only once.  As you can see here, nobody except you has ever sent coins to that address, and in all likelihood nobody else ever will.  And Bitcoin addresses are anonymous, so it is likely to be difficult to trace the address to its owner.

Hard to tell if the https://blockchain.info/address/165aBmgtQJFDLkSYPU5C8jq5gpnAtHdKBh is bound an authentic PayPal address unless there is an xpub extended key correlation service that is rendered through a trusted channel.  Whatever the case, the 0.12 BTC deposited is gone.


text:
why a website for buying bitcoins is asking for my CVC code
I am trying to create an account on coinbase to buy bitcoins (in france). But coinbase is asking for my cvc number while creating the account, not for a purchase.
I am afraid for security issues, as I have been told to not give the cvc to anyone.
Can any one explain please?
Is there a way to avoid that?
Thank you in advance...

CoinBase is a trusted website, if you give them your CVC and your credit card number and its expiry date, they should be able to withdraw money from your credit card worth 10000 Dollars if they want. But I've never sesn someone whose money is stolen by CoinBase. If you have question, ask it to CoinBase support, https://support.coinbase.com/customer/portal/emails/new , it may take up to two weeks to get a response. Good luck.


text:
electrum, jaxx, and exodus
I am interested in storing some bitcoin, etheruim, altcoins a year or some years.
I know hardware or paper wallets are the best choice, but as an absolute newbie, I decided to use a software offline wallet for simplicity( advice is welcomed).
Searching, I found Jaxx, Electrum, and Exodus as best choices.
As I read, I preferred electrum, but it supports only Bitcoins.
I need : (opensource offline-online user-controlled private keys, software wallet)
I am asking support for deciding on one of the following choices:
1. use an equivalent for electrum for multiple cryptocurrencies. And what to use multiBitHd, Jaxx, ...
2. start with bitcoin, when get some knowledge, create a paper wallet for multicurrencies?

Please use a title that provides insight on the content of your question.

Why do not consider more than one wallet? More safer I think.

Here is how to create a paper wallet for almost any Cryptocurrency :
https://steemit.com/cryptocurrency/@bad.r2017/how-to-create-a-paper-wallet-for-any-cryptocurrency-in-7-steps

I am in the same questions for myself during last few days, up to date have found quite a lot info online :

Recently there have been some troubles with security of Jaxx, more or less real, more or less rumours, anyway that has brought doubts about it. And it's not open-source (if to consider this as less trustworthy in blockchain community).
Multibit project at all, including Multibit HD, is not more supported which was officially published on July 26th, 2017. That had been preсeded by massive users troubles all year 2017 before.
On the other hand, Exodus is a newcomer and info about it looks mostly kind of sponsored, not yet many feedbacks from real users of Exodus. Although it intensively develops and gains recognition in blockchain community. It's not fully open-source but founder can make it that way in future, he mentioned about six months ago.
So, till nowadays Electrum looks the most trustworthy desktop wallet in blockchain community, compared to the above mentioned. It's open-source, it has even portable version for Windows, and version for Linux, and version for Android. Yet it is only for bitcoin till today. We may just hope, who knows, maybe they will add some more cryptocoins into it sooner or later…
Also they say there is another analogue of Electrum in all meanings, indeed more user-friendly for a newbie and more flexible and feature-rich. That is also well and long known software wallet Copay. And it is оnly for bitcoin too, and also there are no any talks if it can support some altcoins in future...

Among multi-currency wallets, I’ve found that actually Coinomi to be probably the best at present time. But it’s only on Android till today. Indeed they posted on GitHub in June 2017: Coinomi Desktops will be released soon for Windows, Linux and MacOS. Well, hope that will happen really soon…


text:
Where to split BTC
I have my BTC in a paper wallet. What exchange or wallet can I deposit into that will split it into BTC and BCH? And then allow me to withdraw both?
The exchange I have used and withdrew my BTC from pre-split is now trading BCH but not splitting any BTC that wasn't on their exchange at time of split.

Just in case you haven't figured it out yet, these are the steps I've used yesterday to successfully split the two from my paper wallet.

Install Electrum bitcoin wallet, create a standard wallet and import your private key in it.
Send the full BTC balance to another paper wallet (or an exchange or elsewhere) - this is done to make sure that on the later steps you don't lose your BTC balance
Install Electron Cash - Bitcion cash wallet. It will look pretty much like Electrum as it's Electrum's fork modified to work with BCH
Import the same private key as the above into Electron Cash - you should see the bitcoin cash balance.
Send the balance to a new paper wallet (different from the wallet you have sent your bitcoin on step 2). Paper wallets for BTC and BCH are compatible so to get one for BCH you use the same online generation tools as for BTC

And that's it really.


text:
Is there a rpc/cli method for payment protocol in bitcoin-core?
I have a full node running bitcoin-core 0.16 bitcoind (not bitcoin-qt). Today I tried and failed to pay a bitpay "secure" payment protocol uri invoice via the cli. The uri was in the form bitcoin:?r=https://bitpay.com/i/... with no visible bitcoin address or amount. (Guess people can't be trusted to copy-paste the address correctly?). Not surprisingly, the usual sendtoaddress method called the uri invalid.
I curled the address hoping to get the real payment details so I could enter them manually, but I just got a 301 redirect to a page on bitpay.com saying the invoice has not been paid. Guess they filter on uagent or some other header.
I also googled it but only found explanations of what the payment protocol is, why bitpay is using it, and how to do it with popular UI wallets. Nothing about cli.
Does anyone know if/how this is possible with cli/rpc only? Or perhaps the magic header bitpay looks for to distinguish a wallet app from a browser so I can get the real address? If not, I plan to open a ticket with bitcoin core devs on adding it.
Update:
bitpay link as requested: bitcoin:?r=https://bitpay.com/i/97ghKmFG8HVJNEbxkVefV though it has now been payed (via bitcoin-qt ui) so its usefulness may now be limited.

You may find that there is some code magic in the redirect you experienced that would open/inform your wallet automatically if it has an installed URI handler. bitcoin: links often work on smartphones too but it depends on the wallet to install such handling. If it is not too much to ask concerning privacy, can you share the full bitcoin:URI?

@Willtech question updated with link

My tool, PaymentBridge? It aims to solve your question. It's completely client-side, safe to use, but don't broadcast the transaction after creating it. Paste it when it asks you for the transaction. Good luck!
And, there you go: https://github.com/bitpay/jsonPaymentProtocol/blob/master/specification.md
Have you set the Content-Type to application/payment?

Good find on the bitpay spec on github. It seems "Accept: application/payment-request" is exactly the "magic header" I was looking for. I cannot test it now bc the link is now invalid, but I have tentatively accepted your answer. While I do not intend to use your service bc I hate relying on an online service more then necessary, your source code link gave me the info I needed to develop my own local version with bash+curl. For anyone else who may also have this question but who is not willing/able to do the conversion themselves, I tentatively recommend the service linked in this answer.

The payment protocol is only usable from the GUI (i.e. bitcoin-qt). It is supposed to be an interactive protocol so you cannot use it from the command line which is non-interactive (in the sense that you issue commands and get a response back instead of issue command and interact within the context of that command).

This is pretty much what I expected: no built-in cli compatibility. Thx.

Reading between the lines it seems Bitpay may have done this to allow payment with cash when you receive a payment request for Bitcoin.
You may find that there is some code magic in the redirect you experienced that would open/inform your wallet automatically if it has an installed URI handler. bitcoin: links often work on smartphones too but it depends on the wallet to install such handling.
According to Bitpay:

https://support.bitpay.com/hc/en-us/articles/115005559826-How-do-I-pay-without-a-payment-bitcoin-address-
C. Open the Payment In Your Wallet
If your wallet is on the device you're using to view the invoice, you can open the payment in your wallet by tapping "Open in wallet". Confirm everything is correct, and you can send the payment from your wallet.

This "Open in wallet" link should reveal the actual details even if it does not open in your wallet.
I cannot test this without an actual Bitpay link.

I found that article in my brief search. Unfortunately all I was able to get was another link to the same bitcoin: uri. Question updated with link, though it has now expired.


text:
Upgrading/converting bitcoin core wallet between platforms
After 2 years of being shut down, I am trying to revive my bitcoin full node, while both switching platforms and upgrading to the current version in the process. Everything works but the wallet. The presence of the wallet causes the new node to crash (segfault). The node works when either wallet.dat is missing or when -disablewallet is provided. I do not really need that wallet to be fully imported, just to get the bitcoin associated with it into the an address controlled by the new node.
I read this issue report that blames the version of the berkley db lib files. I compiled bitcoin core locally with the older BDB libs provided via bitcoin/contrib/install_db4.sh per that issue report, and got the same result. The thing is, since (afaik) the windows platform does not provide an implementation of BDB, I have no idea what headers are correct for the wallet file generated by windows bitcoin core.
I want to avoid deleting and re-downloading the entire blockchain. I did run once with -disablewallet -assumevalid=0 to verify the entire blockchain. I retain backups of all pre-upgrade files, if it helps.
gdb backtrace pastebin. Note that this run was only a subset of the cli options I normally run with, specifically missing rpc info.
Old setup:

Windows 7 pro x64 sp1
bitcoin core gui (qt) 0.16.0
last synced early December 2018
BDB version unknown
datadir sat on slow external hdd (ntfs)

New node:

Debian Buster stable
bitcoin core daemon 0.21, compiled locally
syncing now, currently late March 2019
BDB 4.8.30.NC compiled via included script and detected by configure
datadir on slow internal sata hdd (ext4)

Is there any way to import an old/differently formatted wallet.dat file into a newer node? Is there perhaps a way to extract the private key info from said old file, so it can be manually imported? Could the old node software possibly create and send a transaction with the entire contents of the old wallet to a new address without fully syncing first? Is it possible the old version of bitcoinn core could fully sync with the modern blockchain?
e: forgot to mention: the db err logfile /mnt/data/blockchains/btc/blockchain/db.log is empty and retains the last modified date from the first startup of the original node in mid 2017.
e2: after translating the wallet to db version 4.8 as @PieterWuille suggested, the node reindexed and printed a number of lines like
2021-02-18T23:58:08Z [default wallet] Submitting wtx f7b5 to mempool for relay

but after running for a few days, it indexed up to block height just under 500000 and then segfaulted again.

What often works (but make sure you have a wallet.dat backup) in these cases is running "db_dump old_wallet.dat | db_load new_wallet.dat", where you replace the  with the respective version number (e.g. db5.3_dump, db4.8_load). This'll create a new_wallet.dat file that's compatible with whatever version you select.

Was the old Bitcoin-Qt binary self compiled or a release binary? Release binaries always use BDB 4.8.

It doesn't look like this is related to BDB at all, actually, looking at the stacktrace. Can you try starting with -upgradewallet cmdline argument? (make a backup of wallet.dat first, of course).

@PieterWuille the old setup was the release build (80% sure). I will try upgradewallet next once my current attempt to importwallet via bitcoin-cli finishes, if it does not work. Does it matter that the old wallet.dat file is passphrase protected? At what point should I enter the passphrase (and how)?

You only need the passphrase to sign transactions (i.e, sending coins). You'll have to provide it using the walletpassphrase RPC (or if you use the GUI, it'll just ask you when needed).

@PieterWuille that's is what I thought, though I was hoping that that was what was going wrong with my import attempt. bitcoind says the -upgradewallet option is not valid and I see nothing similar in the man file that shipped with the source. I am having a heck of a time finding binaries of db4.8-utils for debian. Though I'm not quite sure if the wallet version is the problem, since the old and new are theoretically both 4.8.

Supplemental: I just did the dump | load thing and restarted the node. Looks like the node is reindexing starting from block 1. So that might be a good sign.

I finally got this. Here is a brief summary for the future searcher:

use the old software to launch the node with the old wallet.db file
run the dump wallet command. This creates a file that is in a text format that is more portable than bdb.
run load wallet command on the new node.
rescan the new node (the default scan does not look very far back)

Note that the file created in step 2 is unencrypted and contains your private keys, so handle with care. Though I did wait for the new node to finish syncing, I doubt that is actually a requirement. I did not allow the old node to sync more than a few blocks.


text:
How to accept bitcoin and giving each user a unique address amd automatic withdrawal
I want to create a website when users on singing up will get a unique address and after getting my websites service,they can withdrawal the money also automatically.
Is that bitcoin integration free ? Plz help i am noobie to this.

It's hard for me to understand your question. Please try and be more precise! What is it exactly that you want to do? Accept bitcoin for services? Or send people bitcoin? Both? What does this have to do with ripple-gateways or exchanges?

Means i want a website where people on signing up will get a unique address. And on certain game or competition they will either loose or win bitcoin. And they can withdraw their amount automatically. Is bitcoin integration free and what is meant by running full node etc. Blah blah blah

There are many things hidden in that question of yours. It's not really a question at all, but more of a plea that says something like 'I want to create some website business that uses bitcoin. Can someone please do my work for me, explain bitcoin to me and figure out how it fits into my (secret or unknown) business idea?'. The 'blah blah blah' is a good indicator here.

I would advise you to first find out more concrete questions, like for example "what is meant by running a full node?". That's a good question. You will find great answers already present, like this one: https://bitcoin.stackexchange.com/questions/48436/what-is-the-meaning-of-the-term-full-node

Once you have worked through the answers and links provided there, new questions will arise, and you can repeat the process. This in turn will lead to more clarity about how bitcoin works and what it can or cannot do for your business idea. Notice that is work that needs to be done by yourself. Asking others to do it for you is lazy and probably won't work.

Sounds that right way for you would be to run Bitcoin Core (full node) and develop your own deposit / withdrawal system from scratch. Relying on third party APIs has potential problems with reliablity, security and user's privacy.
Some notes:

If you plan that single user can deposit BTC multiple times, best practice is to change deposit address with each new deposit for the user. Address generation is free. This helps both user's and overall Bitcoin privacy, without downsides from your side (apart from some little more effort in coding solution).
When user withdraw their BTC, it is best practice to batch their transactions together, it will take less space in blockchain and you will save on transaction fees. Basically, there is no point in sending out another transaction, before previous one is confirmed, in that time you should just add withdrawals into queue and then combine them together in a single withdrawal transaction. Final transaction confirmation time 99% cases will be the same, but it will be cheaper.

This is a good book if you want to understand how Bitcoin works from technical side - https://github.com/bitcoinbook/bitcoinbook.

You could use online providers such as:

https://www.blockchain.com/api
https://www.blockcypher.com/dev/

Or install Bitcoin Core to run a full node and use RPC APIs


text:
Open source, how can I view "Transaction Create a new transaction" and "Sign Transaction"?
Not long ago I saw on the site github.com the very first Nakamoto code:
https://github.com/livegnik/BitCoin-v0.01-ALPHA
Running bitcoin.exe, I did not find the console. If the program is open source, how can I view "Transaction Create a new transaction" and "Sign Transaction"?
I know that the program is written in C++
I would love to see the "Transaction" processes as on https://coinb.in
Coinbin source code is written in javascript. Can I view in C++?

The original Bitcoin client did not have a debug console or many things that we see in modern Bitcoin software. Furthermore, it is a compiled software (C++ needs to be compiled) so you can't inspect the thing being run for its source code. However, Satoshi did publish the source code along with the pre-compiled binary. For transaction creation, you can find this in the repo you linked in src/main.cpp. It is the function named CreateTransaction. Another copy of the original distribution can be found on nakamotoinstitute.org.
Lastly, Bitcoin Core is based on the original client's codebase. It's commit history goes all the way back to 0.1.5 so you can see code that is very similar to the original release and view the code for any version between 0.1.5 and modern Bitcoin Core.


text:
Is OP_RETURN dangerous for Bitcoin?
Please explain something about OP_RETURN to me?
https://bitcointalk.org/index.php?topic=1166928.0
I saw a discussion that the contents of OP_RETURN can open the value of access to the private key. I am not good at client scripting language. But I assume this is something related to the values of RawTX (R, S) where, when summing the additional value, you can calculate the value of X (that is, the private key). Am I right or wrong?

The method described in the post has nothing to to with OP_RETURN, but is concerned with the SIGOP limits in a block.
Each block has a limit on the number of SIGOPs that can be present in transactions in that block. Signature validation is a CPU intensive operation, and the limit exists to ensure that no block gets too big to validate on regular hardware.
The post describes how a single transaction can be made to consume up to 225 SIGOPS fairly trivially, limiting the number of such transactions in a block to 88. These utxos can be redeemed to any regular output, or an OP_RETURN.
Note that the post is from 2015, and the activation of segwit has increased the total SIGOPs allowed by a factor of 4, so this attack could cost more now.

Please explain why there are still dusty attacks on the blockchain? Is this related to "sigops"?

Dust attacks are also unrelated to all this, they are mostly used for tracking which addresses belong to a single wallet, and as spam attacks to bloat the utxo size.

What happens if an attacker increases SIGOPS? How can he get the private keys from Bitcoin Addresses in this block?

There is no relation between SIGOPS and private key retrieval. Recovering a key from duplicate R values can be done with any regular transaction, provided someone is using bad software that duplicates R values, which no sane wallet does.


text:
How to subtract two points on an elliptic curve?
Please tell me if there is a formula for A-B, (That is, subtraction of two points / minus). I know how two points are added, A + B this addition is described in detail
(Please tell me how you can change the formula to subtract two points / minus) A-B

There are many different types of elliptic curves. Please note that the given answers apply to secp256k1, the curve used in Bitcoin.

@nickler incorrect.  The geometric addition rule holds for all elliptic curves and that is the basis for the negation rule described in the several answers existing before your comment was written.

The negation of a point (x, y) on a twisted Edwards curve is (-x, y) and not (x, -y) as the answers given here would indicate.

@nickler there's confusion here between elliptic curve representation and the elliptic curve itself.  When not specified, it's standard to assume the form is Weisterstrass; you are referring to a particular non-standard form.  The answers given apply to any elliptic curve in Weierstrass form.  To state that they only apply to secp256k1 is wrong.

I didn't state it would only apply to secp256k1. My comment was intended to address confusion about the different forms of elliptic curves because we can't expect readers to be aware of what some people consider standard and how the curves relate to each other.

You can negate a point (x, y) by simply changing it to (x, −y).
The document that defines ECDSA reminds us of this fact:
https://www.secg.org/sec1-v2.pdf
Here's a screenshot:

So once you have negated one of your points, just add it to the other one, and you have achieved subtraction.

As other's have said, the essential point is the algebraic definition for additive inverses in elliptic arithemetic.
 -(x,y)=(x,-y)

But if it helps, there are also some nice geometric illustrations like this one from Vitalik Buterin's Exploring Elliptic Curve Pairings:

Suppose R = (x,y). Since the elliptic curve is symmetric with respect to the x-axis, we can guarantee that the inverse -R = -(x,y) = (x,-y) will also be a point on the curve. And since R and -R have the same x-coordinate, the line that connects them is vertical representing their sum as the identity O or "the point at infinity". So we have R + (-R) = O as required.

Here is the sample of code for subtraction of two points.
# -*- coding: utf-8 -*-

def OnCurve(x,y): # Check if the point is on the curve
    A = (y*y)%P
    B = (x*x*x)%P
    C = False
    if A == (B + 7):
        C = True
    return C

def ECadd(xp,yp,xq,yq): # EC point addition
    m = ((yq-yp) * modinv(xq-xp,P))%P
    xr = (m*m-xp-xq)%P
    yr = (m*(xp-xr)-yp)%P
    return (xr,yr)

def legendre_symbol(a,p):
    ls = pow(a, (p - 1) / 2, p)
    return -1 if ls == p - 1 else ls

def modsqrt(a,p):
    if legendre_symbol(a, p) != 1:
        return 0
    elif a == 0:
        return 0
    elif p == 2:
        return p
    elif p % 4 == 3:
        return pow(a, (p + 1) / 4, p)
    s = p - 1
    e = 0
    while s % 2 == 0:
        s /= 2
        e += 1
    n = 2
    while legendre_symbol(n, p) != -1:
        n += 1
    x = pow(a, (s + 1) / 2, p)
    b = pow(a, s, p)
    g = pow(n, s, p)
    r = e
    while True:
        t = b
        m = 0
        for m in xrange(r):
            if t == 1:
                break
            t = pow(t, 2, p)
        if m == 0:
            return x
        gs = pow(g, 2 ** (r - m - 1), p)
        g = (gs * gs) % p
        x = (x * gs) % p
        b = (b * g) % p
        r = m

def modinv(a,n): # Extended Euclidean Algorithm in elliptic curves
    lm, hm = 1,0
    low, high = a%n,n
    while low > 1:
        ratio = high/low
        nm = hm - lm * ratio
        new = high - low * ratio
        hm = lm
        high = low
        lm = nm
        low = new
    return lm % n

def ECadd(xp,yp,xq,yq): # EC point addition
    m = ((yq-yp) * modinv(xq-xp,P))%P
    xr = (m*m-xp-xq)%P
    yr = (m*(xp-xr)-yp)%P
    return (xr,yr)

def ECsub(xp,yp,xq,yq): # EC point subtraction
    X = (((yp+yq)*modinv(xq-xp,P))**2-xp-xq)%P
    A = (xp + X + xq)%P
    B = modsqrt(A,P)
    B1 = P - B
    Y = yq - (xq - X) * B
    X = X % P
    Y = Y % P
    if not OnCurve(X,Y):
        Y = yq - (xq - X) * B1
    Y = Y % P
    return X,Y

P = 2**256 - 2**32 - 2**9 - 2**8 - 2**7 - 2**6 - 2**4 - 1

Gx = 55066263022277343669578718895168534326250603453777594175500187360389116729240
Gy = 32670510020758816978083085130507043184471273380659243275938904335757337482424

print Gx,Gy

Ax,Ay = ECadd(Gx,Gy,Gx,Gy)
print Ax,Ay

Bx,By = ECsub(Ax,Ay,Gx,Gy)
print Bx,By

This code is from here.
It works perfect in Python 2.7.13.
In the earlier version of Python there is OverflowError: (34, 'Result too large').

Please explain in this code what point values do the subtraction?

@IziTors i'am sorry but I can not understand your question