I need to see bitcoin transactions before they were included in the block. Interested in transactions to specific addresses.
Can you tell a bit more about what you want to achieve?
Anyway you could do it like this by using the bitcoin-cli route when running a full node:
bitcoin-cli getrawmempool
Returns a bunch of transaction id's currently in the mempool:
[
"6cf5d95f37a1cca36fa43fa719119fe9f77028ba723829e85651ace4ad5d8f19",
"11a1bd02f9e742604f30b6e2365ca1e8ae96f6a5aafb44c175e96d685ddccd99",
"13fd3c38da7df2f0905747222fd8b1b5bd109a015c3c122a9f53dcf5ffdfcce3",
........................
]
Next get some info about the first transaction:
bitcoin-cli getrawtransaction 6cf5d95f37a1cca36fa43fa719119fe9f77028ba723829e85651ace4ad5d8f19
Returns the raw transaction:
0100000001e740376b175694ee9a7a1423439b3db7f742fdfe0d25be703a22224b19dd25f8010000006b483045022100a24327625d18863b2abfd2ab439ea5dc5fd8103ed81a0da44baacdb8b1cb94ab02202231a9da46fb6b6bf1847c1fe8bb5d78e3658d2c32a670b961b6a849102c2bed01210223eea9ed5a727a10a0c880e9c903ba0d9aff973ece8501ecb75e1f776ee64459ffffffff0286f0ad16000000001976a914d5315454514b6c81d52341b7ed8ebcaa8424d37888ac1ad2e000000000001976a91402dd14395dbd7311c02179746d59882131fbe25588ac00000000
And finally decode that transaction:
bitcoin-cli decoderawtransaction 0100000001e740376b175694ee9a7a1423439b3db7f742fdfe0d25be703a22224b19dd25f8010000006b483045022100a24327625d18863b2abfd2ab439ea5dc5fd8103ed81a0da44baacdb8b1cb94ab02202231a9da46fb6b6bf1847c1fe8bb5d78e3658d2c32a670b961b6a849102c2bed01210223eea9ed5a727a10a0c880e9c903ba0d9aff973ece8501ecb75e1f776ee64459ffffffff0286f0ad16000000001976a914d5315454514b6c81d52341b7ed8ebcaa8424d37888ac1ad2e000000000001976a91402dd14395dbd7311c02179746d59882131fbe25588ac00000000
Returns:
{
"txid": "6cf5d95f37a1cca36fa43fa719119fe9f77028ba723829e85651ace4ad5d8f19",
"hash": "6cf5d95f37a1cca36fa43fa719119fe9f77028ba723829e85651ace4ad5d8f19",
"version": 1,
"size": 226,
"vsize": 226,
"locktime": 0,
"vin": [
{
"txid": "f825dd194b22223a70be250dfefd42f7b73d9b4323147a9aee9456176b3740e7",
"vout": 1,
"scriptSig": {
"asm": "3045022100a24327625d18863b2abfd2ab439ea5dc5fd8103ed81a0da44baacdb8b1cb94ab02202231a9da46fb6b6bf1847c1fe8bb5d78e3658d2c32a670b961b6a849102c2bed[ALL] 0223eea9ed5a727a10a0c880e9c903ba0d9aff973ece8501ecb75e1f776ee64459",
"hex": "483045022100a24327625d18863b2abfd2ab439ea5dc5fd8103ed81a0da44baacdb8b1cb94ab02202231a9da46fb6b6bf1847c1fe8bb5d78e3658d2c32a670b961b6a849102c2bed01210223eea9ed5a727a10a0c880e9c903ba0d9aff973ece8501ecb75e1f776ee64459"
},
"sequence": 4294967295
}
],
"vout": [
{
"value": 3.80498054,
"n": 0,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 d5315454514b6c81d52341b7ed8ebcaa8424d378 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a914d5315454514b6c81d52341b7ed8ebcaa8424d37888ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"1LSG2Kzf1mYSboFzKW2bsRzRP5TbcHvDPG"
]
}
},
{
"value": 0.14733850,
"n": 1,
"scriptPubKey": {
"asm": "OP_DUP OP_HASH160 02dd14395dbd7311c02179746d59882131fbe255 OP_EQUALVERIFY OP_CHECKSIG",
"hex": "76a91402dd14395dbd7311c02179746d59882131fbe25588ac",
"reqSigs": 1,
"type": "pubkeyhash",
"addresses": [
"1G9CDsTx2mUcB4NcPKW5uqp5tPF8Gc6Q9"
]
}
}
]
}
So you can see a value of 3.80498054 was transferred to 1LSG2Kzf1mYSboFzKW2bsRzRP5TbcHvDPG in that transaction as well as a value of 0.14733850 to 0.14733850.
Put it all in a script and it shouldn be too hard to monitor the transactions in the mempool for specific addresses.