Author

Topic: Tracking new payments to address: please help (Read 1080 times)

legendary
Activity: 3472
Merit: 4801
So, a single transaction covers 2 payments? Like transaction fee, or is it something different?

Most transactions will have at least 2 outputs.  One output sends to the intended recipient and the other sends the change back into the wallet.

However, a user can create a single transaction that pays multiple recipients at once, so it is possible to have MANY outputs in a transaction.
sr. member
Activity: 344
Merit: 250
Thank you very much for help.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
So, a single transaction covers 2 payments? Like transaction fee, or is it something different?
Different
Tx fee = sum outputs - sum inputs
Tx fee is always implied
sr. member
Activity: 344
Merit: 250
So, a single transaction covers 2 payments? Like transaction fee, or is it something different?
legendary
Activity: 3472
Merit: 4801
Last question. In the following listing for a particular transaction, which one is output? And, from the point of view of programming, how to figure which one is it?

That transaction has 2 outputs:

The indicator that outputs follow:
Code:
   "vout" : [

Each output will be surrounded by a pair of braces.

Here is the first output.

Code:
       {
            "value" : 0.01000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 06f1b6703d3f56427bfcfd372f952d50d04b6
4bd OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a91406f1b6703d3f56427bfcfd372f952d50d04b64bd88ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1dice97ECuByXAvqXpaYzSaQuPVvrtmz6"
                ]
            }
        },

In this first output you can see from the:
Code:
"value" : 0.01000000
that the output is a payment of 0.01 BTC.

You can see from the:
Code:
"addresses" : [
                    "1dice97ECuByXAvqXpaYzSaQuPVvrtmz6"
                ]
that the 0.01 BTC payment was made to an address of 1dice97ECuByXAvqXpaYzSaQuPVvrtmz6.


Here is the second output.

Code:
       {
            "value" : 0.08948230,
            "n" : 1,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 c62c472c654e0305c872fc818220c7a6db835
369 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914c62c472c654e0305c872fc818220c7a6db83536988ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1K4qqUT5RqKQnaA22ZyjF2dsENLjFKiZsE"
                ]
            }
        }

In this second output you can see from the:
Code:
"value" : 0.08948230
that the output is a payment of 0.0894823 BTC.

You can see from the:
Code:
"addresses" : [
                    "1K4qqUT5RqKQnaA22ZyjF2dsENLjFKiZsE"
                ]
that the 0.0894823 BTC payment was made to an address of 1K4qqUT5RqKQnaA22ZyjF2dsENLjFKiZsE.
sr. member
Activity: 344
Merit: 250
Last question. In the following listing for a particular transaction, which one is output? And, from the point of view of programming, how to figure which one is it?

D:\Bitcoin\daemon>bitcoind -port=8333 -rpcuser=bitcoinrpc -rpcpassword=bitcoinpassword getrawtransaction 97f80b374420afd2312
fbe068af0871ec00310182d2c48c470f7d7d405ffba65 1
{
    "hex" : "0100000001270234554aa75ffa11b00866aa58b25058e45bbb767c10ad0be40e2b7
3b088a3010000008b483045022100b62bdffbd73783344d0c40c551824231a84d55284bc9219b57 7
fa032d0e85004022045bc2f343c95ec49b919bcf3da277b1f38c8d892120a6a1978a9db2bf71312 e
e01410489f5de6e82d1475e68375234a212505471394ae75c4ff340f9adcc5b3cc2767c5927a0a0 1
3e44d746a83b265c8900166ab0827c0098864c3aa17952f169398a1ffffffff0240420f00000000 0
01976a91406f1b6703d3f56427bfcfd372f952d50d04b64bd88ac068a8800000000001976a914c6 2
c472c654e0305c872fc818220c7a6db83536988ac00000000",
    "txid" : "97f80b374420afd2312fbe068af0871ec00310182d2c48c470f7d7d405ffba65",

    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "txid" : "a388b0732b0ee40bad107c76bb5be45850b258aa6608b011fa5fa74a55
340227",
            "vout" : 1,
            "scriptSig" : {
                "asm" : "3045022100b62bdffbd73783344d0c40c551824231a84d55284bc92
19b577fa032d0e85004022045bc2f343c95ec49b919bcf3da277b1f38c8d892120a6a1978a9db2b f
71312ee01 0489f5de6e82d1475e68375234a212505471394ae75c4ff340f9adcc5b3cc2767c5927
a0a013e44d746a83b265c8900166ab0827c0098864c3aa17952f169398a1",
                "hex" : "483045022100b62bdffbd73783344d0c40c551824231a84d55284bc
9219b577fa032d0e85004022045bc2f343c95ec49b919bcf3da277b1f38c8d892120a6a1978a9db 2
bf71312ee01410489f5de6e82d1475e68375234a212505471394ae75c4ff340f9adcc5b3cc2767c 5
927a0a013e44d746a83b265c8900166ab0827c0098864c3aa17952f169398a1"
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 0.01000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 06f1b6703d3f56427bfcfd372f952d50d04b6
4bd OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a91406f1b6703d3f56427bfcfd372f952d50d04b64bd88ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1dice97ECuByXAvqXpaYzSaQuPVvrtmz6"
                ]
            }
        },
        {
            "value" : 0.08948230,
            "n" : 1,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 c62c472c654e0305c872fc818220c7a6db835
369 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914c62c472c654e0305c872fc818220c7a6db83536988ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1K4qqUT5RqKQnaA22ZyjF2dsENLjFKiZsE"
                ]
            }
        }
    ],
    "blockhash" : "000000000000014aae467ca143cd7a7667829fbc2839fb0eabaface44de35
a4e",
    "confirmations" : 10,
    "time" : 1368617107,
    "blocktime" : 1368617107
}
sr. member
Activity: 344
Merit: 250
> The listsinceblock API command will return txids of all transactions since the block specified.  So if the block specified (by its block hash) is the last block received then the txids returned will be those in the node's memory pool.

It seems, that it does not work for other's wallets. I got

... listsinceblock 00000000000000abdb82197f6ee75230464c7b3dcafe9a14444e24028d63c3
06 6
{
    "lastblock" : "0000000000000018429b3553df4d2597cc15e28e962fc2321aa39e652b3a6
4b4",
    "transactions" : [
    ]
}

"Block" should do the trick.
sr. member
Activity: 344
Merit: 250
Thank you very much. I was hoping, there is a shortcut... As number of transactions is growing, it will create a lot of pressure on server side scripting Smiley

Last question. In the following listing for a particular transaction, which one is output? And, from the point of view of programming, how to figure which one is it?

D:\Bitcoin\daemon>bitcoind -port=8333 -rpcuser=bitcoinrpc -rpcpassword=bitcoinpassword getrawtransaction 97f80b374420afd2312
fbe068af0871ec00310182d2c48c470f7d7d405ffba65 1
{
    "hex" : "0100000001270234554aa75ffa11b00866aa58b25058e45bbb767c10ad0be40e2b7
3b088a3010000008b483045022100b62bdffbd73783344d0c40c551824231a84d55284bc9219b57 7
fa032d0e85004022045bc2f343c95ec49b919bcf3da277b1f38c8d892120a6a1978a9db2bf71312 e
e01410489f5de6e82d1475e68375234a212505471394ae75c4ff340f9adcc5b3cc2767c5927a0a0 1
3e44d746a83b265c8900166ab0827c0098864c3aa17952f169398a1ffffffff0240420f00000000 0
01976a91406f1b6703d3f56427bfcfd372f952d50d04b64bd88ac068a8800000000001976a914c6 2
c472c654e0305c872fc818220c7a6db83536988ac00000000",
    "txid" : "97f80b374420afd2312fbe068af0871ec00310182d2c48c470f7d7d405ffba65",

    "version" : 1,
    "locktime" : 0,
    "vin" : [
        {
            "txid" : "a388b0732b0ee40bad107c76bb5be45850b258aa6608b011fa5fa74a55
340227",
            "vout" : 1,
            "scriptSig" : {
                "asm" : "3045022100b62bdffbd73783344d0c40c551824231a84d55284bc92
19b577fa032d0e85004022045bc2f343c95ec49b919bcf3da277b1f38c8d892120a6a1978a9db2b f
71312ee01 0489f5de6e82d1475e68375234a212505471394ae75c4ff340f9adcc5b3cc2767c5927
a0a013e44d746a83b265c8900166ab0827c0098864c3aa17952f169398a1",
                "hex" : "483045022100b62bdffbd73783344d0c40c551824231a84d55284bc
9219b577fa032d0e85004022045bc2f343c95ec49b919bcf3da277b1f38c8d892120a6a1978a9db 2
bf71312ee01410489f5de6e82d1475e68375234a212505471394ae75c4ff340f9adcc5b3cc2767c 5
927a0a013e44d746a83b265c8900166ab0827c0098864c3aa17952f169398a1"
            },
            "sequence" : 4294967295
        }
    ],
    "vout" : [
        {
            "value" : 0.01000000,
            "n" : 0,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 06f1b6703d3f56427bfcfd372f952d50d04b6
4bd OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a91406f1b6703d3f56427bfcfd372f952d50d04b64bd88ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1dice97ECuByXAvqXpaYzSaQuPVvrtmz6"
                ]
            }
        },
        {
            "value" : 0.08948230,
            "n" : 1,
            "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 c62c472c654e0305c872fc818220c7a6db835
369 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a914c62c472c654e0305c872fc818220c7a6db83536988ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                    "1K4qqUT5RqKQnaA22ZyjF2dsENLjFKiZsE"
                ]
            }
        }
    ],
    "blockhash" : "000000000000014aae467ca143cd7a7667829fbc2839fb0eabaface44de35
a4e",
    "confirmations" : 10,
    "time" : 1368617107,
    "blocktime" : 1368617107
}
legendary
Activity: 2506
Merit: 1010
How to poll the client
Could you please provide steps/commands?

The listsinceblock API command will return txids of all transactions since the block specified.  So if the block specified (by its block hash) is the last block received then the txids returned will be those in the node's memory pool.

Then from the results of that, getrawtransaction [txid] on each will return the info necessary to determine if the transaction has an OUTPUT to the address you are monitoring.

Here's the API calls list:
 - http://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

Here's a link to an example of accessing the API using Python:  (examples of other languages are on the same article)
 - http://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#Python
sr. member
Activity: 344
Merit: 250
sr. member
Activity: 344
Merit: 250
Think of the wallet (empty) running on a server, and trying to track transfers to addresses provided to clients of an online store, but these addresses belong to a different (offline) wallet.
sr. member
Activity: 344
Merit: 250
How to poll the client
Could you please provide steps/commands?
legendary
Activity: 2506
Merit: 1010
What is a command line for bitcoind, to find, if payment arrived to a given address?

If it is not an address in the wallet, then you will need to poll the client to learn of new transactions and then for each do a getrawtransaction to determine if the address is one that you are monitoring.

hero member
Activity: 836
Merit: 1030
bits of proof
The BOP Enterprise Server supports multi wallet configuration at your side and asynchronous notification of payments to your addresses.

It will be launched in two days in San Jose.
sr. member
Activity: 344
Merit: 250
Hi,
Could you please help, as I am a bit lost in tutorials Smiley

I have an address, that I use to receive payments for whatever, the point is, payments to this address are regular, it is not a unique event.
I want to use bitcoind to figure if a new payment arrived.
I would like to do it using ANOTHER wallet. An empty one, created for this purpose.

What is a command line for bitcoind, to find, if payment arrived to a given address?
And if possible, what is a command line for bitcoind, to find, if payment arrived to a given address since given date-time (for example, I know that the last payment happened 3days ago, I want to know, if there was another one after it)?

Thank you Smiley
Jump to: