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 blockchain.info 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 Breadwallet.com 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 (https://github.com/bitcoin/bitcoin/blob/v0.9.3/src/script.cpp#L843-L847, 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) {
    vchSig.clear();
    ECDSA_SIG *sig = ECDSA_do_sign((unsigned char*)&hash, sizeof(hash), pkey);
    if (sig == NULL)
        return false;
    BN_CTX *ctx = BN_CTX_new();
    BN_CTX_start(ctx);
    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);
    }
    BN_CTX_end(ctx);
    BN_CTX_free(ctx);
    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);
    ECDSA_SIG_free(sig);
    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: http://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm.

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 https://www.biteasy.com/testnet/transactions/db66d5058e5773f353447ffa2174a417867e9aa134113f01359576f5e6f2b4c6

And this is my wallet https://www.biteasy.com/testnet/addresses/mnj3589DHMoCyhxDSvWKubjkUoTenmrGkE.

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?

Input validation in transactions

I’m just writing a small essay about the basics of BTC and I ran into a small problem.

I know, that there are digital signatures in our bitcoins’ earlier transactions (our transaction inputs) and in the next owner’s public key. How can the system verify, if the input is really from our earlier output? We can just use a random (unspent) output from an earlier block, can’t we? I know that we are the next owner and our public key is in the transaction, but we can (and should) generate a a new public-private key for our next transaction, so the new private key won’t match our “old” public key… What is that thing I don’t know or understand?

Multiple coins on one server running MPOS/stratum

I’ve got an instance of MPOS and a stratum server running a single PeerCoin pool perfectly fine.

How do I go about adding a second pool to the same server?

I’ve tried to duplicate both the stratum server folders and the MPOS folders, then configure for a different coin. However, when when I browse to the other MPOS instance, for example www.mysite.com/MPOSSECONDSITE/public, it loads a blank page. What am I doing wrong?