<p>I am using bitcoin block chain API, it is possible to get amount sent in a transaction id and the addresses it was sent to. My problem is getting the RELATED ADDRESSES to the address that sent the payment.. The only fact is that I want to be able to validate who sent the money and who it was sent to.. eg. my site involve users sending bitcoin to other users and submitting transaction ID. Each user register and input their wallet address. if User A sends to USer B and submits transaction ID, I want to be able to find out if the transaction is coming from the Sender User and is going to the Receiver Address. Validating for the receiver address is simple with my lines of code: </p>

<pre><code>$requesturl='https://blockchain.info/tx-index/'.$comment.'? format=json';
$ch=curl_init($requesturl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$cexecute=curl_exec($ch);
curl_close($ch);
$result = json_decode($cexecute,true);
for($i=0; $i&lt;count($result['out']); $i++) {
$result['out'][$i]["addr"];
}
</code></pre>

<p>I can get the receiver addresses from the loop above and validate, and if want to get the sending addresses it is also possible with:</p>

<pre><code>for($i=0; $i&lt;count($result['inputs']); $i++) {
// the addr is in the input
}   
</code></pre>

<p>Now my problem is if the wallet Address the User A submitted on our website is not in the sending address list, how do I know his address is there in the list.?</p>

CC BY-SA 3.0
2017-02-18T19:20:21.990Z
Do you really care who pays for a bill, or do you care what bill was paid for? To do the latter, the usual suggestion is to create a new receive address for each bill you want to see paid. To do the former, use something other than Bitcoin, as sender at best are pseudonymous anyway.
Pieter Wuille
CC BY-SA 3.0
2017-02-19T11:23:04.233Z
I care who pay for a bill, its Ponzi scheme app
Emelda Chisom Agbo
<blockchain.info><api><php>
How do i loop through all the related address in a given wallet address
Emelda Chisom Agbo
# How do i loop through all the related address in a given wallet address

(Asked by: username_0 on 2017-02-18)

I am using bitcoin block chain API, it is possible to get amount sent in a transaction id and the addresses it was sent to. My problem is getting the RELATED ADDRESSES to the address that sent the payment.. The only fact is that I want to be able to validate who sent the money and who it was sent to.. eg. my site involve users sending bitcoin to other users and submitting transaction ID. Each user register and input their wallet address. if User A sends to USer B and submits transaction ID, I want to be able to find out if the transaction is coming from the Sender User and is going to the Receiver Address. Validating for the receiver address is simple with my lines of code:

```
$requesturl='https://blockchain.info/tx-index/'.$comment.'? format=json';
$ch=curl_init($requesturl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$cexecute=curl_exec($ch);
curl_close($ch);
$result = json_decode($cexecute,true);
for($i=0; $i<count($result['out']); $i++) {
$result['out'][$i]["addr"];
}

```

I can get the receiver addresses from the loop above and validate, and if want to get the sending addresses it is also possible with:

```
for($i=0; $i<count($result['inputs']); $i++) {
// the addr is in the input
}   

```

Now my problem is if the wallet Address the User A submitted on our website is not in the sending address list, how do I know his address is there in the list.?

**Tags:** blockchain.info, api, php

> **Comments:**
> **username_1**: Do you really care who pays for a bill, or do you care what bill was paid for? To do the latter, the usual suggestion is to create a new receive address for each bill you want to see paid. To do the former, use something other than Bitcoin, as sender at best are pseudonymous anyway.  
> **username_0**: I care who pay for a bill, its Ponzi scheme app  

---

## 0 answers

