Create addresses in bulk; and check balance

I am new to Bitcoin; our company wants to use bitcoin for payments.

We need to create a address for each transaction. so we need to create many public address.

First, I need to generate many public and private key-pairs. This is going to be very hard to do in a secure way!

I read another question that said with hierarchical deterministic wallets we can do something like creating one key-pair and generate many public address from it (means one private key can have many public key).

So if it really do!: Do we need to keep all of public keys or just can use private key for transaction bitcoins or checking balanced? or the other public keys are child key and i should keep the first mother public key?

  • Can someone else see how much bitcoin we have earned?
    • just with child-address?
    • if she/he get the master public key, can they check our balance?

We want to use Lazy_API and show user an address to use it for transaction and after that check it with json api or blockexplorer, if transaction done after number of confirmation we proceed invoice and they can access to what they want.

Something else: some mobile wallet(like for iOS) said that they change public address after current get received bitcoins! Does they create new key-pairs or just do something like above?

Is it necessary for blocks to record the nBits difficulty parameter?

The next difficulty to solve a block is determined from how fast blocks were solved before it. In addition, the difficulty only changes once every two weeks or so.

So, couldn’t every node keep track of the expected difficulty and not need to have it in each block header? Or is there a reason nodes need to be communicating the current difficulty in each block? Not that it would be a major savings, or anything, it just seems strange that this is included when it’s just a function of all the other pieces of a chain.

Maybe it’s because calculating nBits would take a long time eventually if you had to go through all the block headers every time you wanted to calculate the next difficulty?

Forgot password multibit

this is two weeks

I am trying to crack my MultiBit portfolio, I do not remember my password recorded in July; I have no old file save my wallet, the word must be no more than 15 characters and must be single and I need only 2-3 characters to remind me.

I looked all over the web and bitcoin forums looking for a solution, but being French, the English pages are poorly translated and difficult to understand. My English is not very strong. I asked walletrecoveryservives, but he couldn’t figure out my password using the ideas that I gave him.

I have no more ideas; is the island cracker possible without ideas? Could you help me do it if it’s possible?

What is OP_CODESEPARATOR used for?

Looking at the Bitcoin source (, specifically), I ran into the use of the OP_CODESEPARATOR. Am I right in interpreting this code that it is not always the case that the whole scriptPubKey is signed, but really just the part that is later than the most recent OP_CODESEPARATOR? What happens if an OP_IF causes an OP_CODESEPARATOR to be skipped?

It seems strange to me that the entire scriptPubKey isn’t used for signing in all cases, so I’m guessing there is some use case for this that I haven’t thought of. Does anyone know what this use case is?

I’ve read through this bitcointalk thread, but didn’t really find any conclusion there.

How to specify ECDSA nonce used in bitcoin signing code?

Below is the CECKey::Sign() code (v0.9.3).

bool Sign(const uint256 &hash, std::vector<unsigned char>& vchSig) {
    ECDSA_SIG *sig = ECDSA_do_sign((unsigned char*)&hash, sizeof(hash), pkey);
    if (sig == NULL)
        return false;
    BN_CTX *ctx = BN_CTX_new();
    const EC_GROUP *group = EC_KEY_get0_group(pkey);
    BIGNUM *order = BN_CTX_get(ctx);
    BIGNUM *halforder = BN_CTX_get(ctx);
    EC_GROUP_get_order(group, order, ctx);
    BN_rshift1(halforder, order);
    if (BN_cmp(sig->s, halforder) > 0) {
        // enforce low S values, by negating the value (modulo the order) if above order/2.
        BN_sub(sig->s, order, sig->s);
    unsigned int nSize = ECDSA_size(pkey);
    vchSig.resize(nSize); // Make sure it is big enough
    unsigned char *pos = &vchSig[0];
    nSize = i2d_ECDSA_SIG(sig, &pos);
    vchSig.resize(nSize); // Shrink to fit actual size
    return true;

How could I specify which nonce is used in the ECDSA_do_sign()? By nonce, I am referring to the k value described here:

Sending bitcoins to same address

I am using the BitcoinJ API to create my wallet.
When I create a transaction, I provide the change address to which change should be sent.
For example: let there be 1 bitcoin at address A;
then I create a transaction to send 0.1 bitcoins to address B and the change (0.9 bitcoins) back to address A.

In the BitcoinJ wallet, I see that the change (0.9 bitcoins) is not received back. To try to fix that, I created a custom coin selector to explicitly select unconfirmed transactions which are generated by myself—but still I do not see the change (0.9 bitcoins) in my wallet.

This is the transaction view

And this is my wallet

According to my address on Biteasy, there is a balance of 4BTC,
but my BitcoinJ wallet shows only 0.069BTC

Now my question is: Why can’t I send return change to same address it is being sent from?