cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Neo4J: How can I repeat my query on all resulting nodes?

Hi erveryone,

so I've started working on a project for my Bachelor Thesis and therefore I'm looking for some help.

I've got the BTC Blockchain as my DB and now I want to use the Multi Input Clustering Heuristic to identify all addresses that belong to a person. This means that I want to identify all Transactions from a BTC Wallet that have more than one input address. Once I have the transactions identified, I am looking for the wallets. This is what the following query does:


```
MATCH(a:Address{address:"3QQdfAaPhP1YqLYMBS59BqWjcpXjXVP1wi"})-[:SENDS]-(tx)-[:SENDS]-(a2)

RETURN a2
`

Now that I have these wallets I want to repeat the exact process on these wallets as well and their resulting wallets and so on! So I need a recursive Query which returns me all wallets that where used as Input Wallets at some point.

Note:

RaiiZen_0-1665328126994.png

This how a the graph of an BTC wallet looks like that received and sent BTC. There are 3 types of nodes (Transactions, Addresses, Blocks).

1 REPLY 1

Hello @RaiiZen 🙂

I'm pretty sure we don't need a recursive query to do that and I'm not sure it's possible anyway. But you should have a look at Weakly Connected Components in GDS plugin. It should help you to get all wallets. Each community will have a set of wallets where each wallet have a path to each other wallet in the community.

Regards,
Cobra