CoinClustering
Address clustering for bitcoin based cryptocurrencies
Under construction!
Prerequisites
Node and NPM
Bitcoin core or API compatible client such as Litecoin core or Dash core
bitcoin.conf / dash.conf / litecoin.conf...
server=1
txindex=1
rest=1
rpcuser=[your username]
rpcpassword=[your password]
Installation
npm install -g coin-clustering
- Create a new directory, for example 'BitcoinClustering'
- Navigate to the directory and create a new file "config.js"
- Edit config.js according to the below example. Altcoin excamples can be found here.
let config = {
protocol: 'http',
user: '[rpcuser from bitcoin.conf]',
pass: '[rpcpassword from bitcoin.conf]',
host: '127.0.0.1',
port: 8332,
listen_port: 3006,
pubkeyhash: 0x00,
scripthash: 0x05,
segwitprefix: "bc",
dbcache: 3000
};
module.exports = config;
- run
coin-clustering
in the same directory with config.js
Indexing the bitcoin blockchain can take more or less than a week depending on your hardware. Most altcoins should take much shorter.
HTTP API
Clusters
GET /clusters
Query parameters
- gt, gte, lt, lte (optional) = balanceSats / balanceSats-clusterId
- reverse (optional) = true/false, defalt: false
- limit (optional) = integer (0...1000), defalt: 100
Example
Request
/clusters?limit=3&reverse=true<e=10000000000000
Response
GET /clusters/:id/summary
Example
Request
/clusters/17034506/summary
Response
GET /clusters/:id/transactions
Query parameters
- gt, gte, lt, lte (optional)
- reverse (optional) = true/false, defalt: false
- limit (optional) = integer (0...1000), defalt: 100
- include-delta (optional) = true/false, defalt: false
Example
Request
/clusters/17034506/transactions?limit=3&reverse=true&include-delta=true
Response
GET /clusters/:id/addresses
Query parameters
- gt, gte, lt, lte (optional)
- reverse (optional) = true/false, defalt: false
- limit (optional) = integer (0...1000), defalt: 100
Example
Request
/clusters/17034506/addresses?limit=3&reverse=true
Response
GET /clusters/:id/balance-candlesticks
Addresses
GET /addresses/:address/cluster_id
/addresses/1AnwDVbwsLBVwRfqN2x9Eo4YEJSPXo2cwG/cluster_id
17034506
GET /addresses/:address/transactions
### Query parameters
- gt, gte, lt, lte (optional)
- reverse (optional) = true/false, defalt: false
- limit (optional) = integer (0...1000), defalt: 100
GET /addresses/:address/balance-candlesticks
Transactions
GET /transactions/:txid/cluster-balance-changes
GET /transactions/:txid/details
Miscellaneous
GET /status
Limitations
Stays 10 blocks behind the latest block to avoid having to deal with blockchain reorganizations.