Bitcoin Forum
November 12, 2024, 12:20:49 PM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Tracking new payments to address: please help  (Read 1078 times)
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
May 15, 2013, 10:26:49 AM
 #1

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

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
grau
Hero Member
*****
Offline Offline

Activity: 836
Merit: 1030


bits of proof


View Profile WWW
May 15, 2013, 11:42:31 AM
 #2

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.
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
May 15, 2013, 12:02:27 PM
 #3

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.


Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
May 15, 2013, 12:03:24 PM
 #4

How to poll the client
Could you please provide steps/commands?

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
May 15, 2013, 12:07:22 PM
 #5

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.

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
May 15, 2013, 12:08:23 PM
 #6

Or, to put it differently, the
http://blockexplorer.com/q/getreceivedbyaddress/14mWwyodAdJrtdCNiAsMJZbUWdgfyNe1TN/6
how does it work?

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
May 16, 2013, 03:19:27 AM
 #7

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

Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
May 16, 2013, 07:12:00 AM
 #8

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
}

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
May 16, 2013, 08:50:27 AM
 #9

> 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.

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
May 16, 2013, 11:45:17 AM
 #10

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
}

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4832



View Profile
May 16, 2013, 12:00:58 PM
 #11

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.
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
May 16, 2013, 12:07:40 PM
 #12

So, a single transaction covers 2 payments? Like transaction fee, or is it something different?

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
May 16, 2013, 12:09:40 PM
 #13

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

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
Fizpok (OP)
Sr. Member
****
Offline Offline

Activity: 344
Merit: 250


View Profile WWW
May 16, 2013, 12:36:48 PM
 #14

Thank you very much for help.

Ethereum Programming Guide
Create Solidity contracts: Step-by Step Hands-on Guides.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4832



View Profile
May 16, 2013, 01:37:50 PM
 #15

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.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!