If address B have confirmed transaction already, not the input from address A, that means address B can use cpfp so far address B has balance that can be used for that? Or will address B have to be able to spend unconfirmed transaction before using cpfp and will need to spend from the input from address A for the cpfp to be successful?
So to do a CPFP, the second transaction - the child - must spend at least one of the unconfirmed outputs from the first transaction - the parent. Making a transaction from the same address but which spends unrelated coins would not accelerate the parent transaction.
So when you make a transaction from address B, it must include unconfirmed funds which came from address A. You can also include other funds from other transactions if you want to help pay for the higher fee, but the coins from address A must be used.
Also the other question is that, if address B can use cpfp without need to spend unconfirmed transaction, and you send to wallet address B from another wallet (may be wallet Z) after you have already send from address A that need cpfp, if the wallet Z transaction to address B was later confirmed, can it be used to do cpfp? Or cpfp in wallet B can only be done using unconfirmed transaction from wallet A as I asked before?
So as above, you could use the funds from address Z to help contribute to the higher fee, but you must also include the unconfirmed transaction from address A.
So let's say I have an unconfirmed transaction from address A to address B, and I also have an already confirmed transaction from address Z to address B. I want to CPFP my unconfirmed transaction. I have to send my unconfirmed funds in address B to address C, and pay a higher fee. If I want, I could also include my confirmed funds in the same transaction, either to help pay for the fee, to consolidate them, etc., but I don't have to.