My question in quite conceptual:
For creating a raw transaction, I just need the txid from the older transaction and the address to send it. Put the funds, the change, what's left is the fee. Sign it and broadcast it.
Let's say Alice sends to Bob's disposable address some funds. Bob has a "master address". Whatever funds he gets on the disposables addressess he sends to his master one. Bob runs a full node and get the transaction before it gets confirmed on the blockchain.
When Bob receives the broadcasted Alice transaction, Bob gets the raw transaction sent to his disposable address, get the txid, put the funds, put the address of his "master" address, change, fee, sign it and broadcast a new transaction, getting the funds sent from Alice to his master address.
So, now, Alice sends to BobDisp (Bob's disposable address) that sends to Bob. All those transactions have 0 confirmations and are both valid.
For the point of the argument. Alice sent the transaction with 0 (ZERO) fee. Bob signed his transaction with a 'standard' fee (let's say 0.0003 BTC), which has a high priority.
When miners get the transactions to mine, do they know that both have to be on the same block? Or what happens if the block is mined with only 'BobD -> Bob' transaction (without the Alice -> BobD)? Is the block invalid?
The miners won't rescan the whole blockchain to know that the 'BobD -> Bob' uses the funds of a new transaction, right? The Alice transaction could be 50000 blocks old or, in this case, a new one.
PS: not sure if it is clear. thanks