{"id":14980166,"url":"https://github.com/dsx-tech/blockchain-payment-system","last_synced_at":"2025-10-12T02:46:58.375Z","repository":{"id":96506026,"uuid":"167199361","full_name":"dsx-tech/Blockchain-Payment-System","owner":"dsx-tech","description":"Blockchain Payment System","archived":false,"fork":false,"pushed_at":"2020-08-16T10:55:49.000Z","size":5475,"stargazers_count":8,"open_issues_count":0,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-01T18:11:49.254Z","etag":null,"topics":["bitcoin-payment","blockchain","payment"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsx-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-23T14:46:32.000Z","updated_at":"2024-07-09T12:43:21.000Z","dependencies_parsed_at":"2023-04-30T19:01:11.762Z","dependency_job_id":null,"html_url":"https://github.com/dsx-tech/Blockchain-Payment-System","commit_stats":{"total_commits":148,"total_committers":8,"mean_commits":18.5,"dds":0.7027027027027026,"last_synced_commit":"97c22beec449216af3a02e027a0d68c079a44fbf"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsx-tech%2FBlockchain-Payment-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsx-tech%2FBlockchain-Payment-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsx-tech%2FBlockchain-Payment-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsx-tech%2FBlockchain-Payment-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsx-tech","download_url":"https://codeload.github.com/dsx-tech/Blockchain-Payment-System/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238720208,"owners_count":19519310,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitcoin-payment","blockchain","payment"],"created_at":"2024-09-24T14:01:23.715Z","updated_at":"2025-10-12T02:46:58.318Z","avatar_url":"https://github.com/dsx-tech.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/dsx-tech/Blockchain-Payment-System.svg?branch=master)](https://travis-ci.com/dsx-tech/Blockchain-Payment-System)\n\n# Blockchain-Payment-System (BPS)\nBlockchain Payment System is an open source payment system\n for working with various cryptocurrencies.\n\n## Supported Cryptocurrencies\n- Bitcoin (BTC)\n- TON Gram (GRM)\n- Ripple (XRP)\n- TRON (TRX)\n- Ethereum (ETH)\n- ERC-20\n\n\n## Requirements\n\n- Kotlin 1.3.70\n- Gradle 4.10\n\n#### TON GRAM\nTo work with the TON Gram cryptocurrency,\n you must run a payment system on Linux 18.04\n  or build a ton-nativelib for a specific OS.\n  \nA docker image for build the ton-nativelib on Linux 18.04 is located at\n```./src/main/resources/DockerImages.ton-nativelib-image```\n## How to run\n#### Сonfiguring\nBefore starting a BPS, it is necessary\n to set cryptocurrencies and its settings in the \n configuration file. \n \n BPS configuration file is located at \n ``./src/main/resources/BpsConfig.yaml``\n \n A detailed description of the parameters is in the comments of the configuration file.\n\n#### Starting\nThe system is started using the Gradle command.\n1. First you need to build a BPS \n```gradle build```\n2. After that run it\n```gradle run```\n\n#### Testing\nDocker is required to run unit tests.\nTo run BPS unit tests, you must run command ``gradle test``\n\n###### Expand the network manually\n\n- BTC:\nYou can use a container https://hub.docker.com/repository/docker/siandreev/bitcoind-regtest\n\nTo do this, run ``docker run -p 18443:18443 -p 18444:18444 siandreev/bitcoind-regtest:alice-bob-regtest``\n\nYou can interact with the network through the JSON-RPC using curl\n\nFind out the balance of Alice: ``curl --user alice:password --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"get\n               balance\", \"params\": [] }'  -H 'content-type: text/plain;' http://127.0.0.1:18443/``\n               \nSend 10 BTC to Bob: ``curl --user alice:password --data-binary '{\"jsonrpc\": \"1.0\", \"id\":\"curltest\", \"method\": \"sendtoaddress\", \"params\": [\"2NETNm86ug9drkCJ7N4U5crA9B9681HidzX\", 10] }'  -H 'content-type: text/plain;' http://127.0.0.1:18443/``\n\n- ETH: You can use a container https://hub.docker.com/repository/docker/siandreev/ethereum-rpc-test with \"PoA-mining\" tag\n\nTo do this, run ``docker run -p 8541:8541 -p 8542:8542 siandreev/ethereum-rpc-test:PoA-mining``\n\nYou can interact with the network using geth: run ``geth attach http://localhost:8541`` to connect to the node\n\nFind out the balance of Alice: ``eth.getBalance(\"0x073cfa4b6635b1a1b96f6363a9e499a8076b6107\")``\n\nSend 10 ETH to Bob: ``eth.sendTransaction({from: \"0x073cfa4b6635b1a1b96f6363a9e499a8076b6107\",to: \"0x0ce59225bcd447feaed698ed754d309feba5fc63\",value: web3.toWei(10, \"ether\")});``\n\n## Payments and Invoices\nBPS operates with three\n entities - Payment, Invoice and DepositAccounts.\n\nPayment - an entity is responsible for the withdrawal of cryptocurrency funds from the BPS account. \n\nInvoice - an entity is responsible for depositing cryptocurrency funds to the BPS account.\n### BPS REST API\n- ```GET http://localhost:8080/balance/{currency}``` - get account balance for a given cryptocurrency\n- ```GET http://localhost:8080/invoice/{id}``` - get invoice for a given invoice id\n- ```GET http://localhost:8080/payment/{id}``` - get payment for a given payment id\n- ```POST http://localhost:8080/invoice``` - create new invoice with a given parametrs\n    - Example: \n    ```\n    POST http://localhost:8080/invoice\n    Content-Type: application/json\n   \n    {\n      \"currency\": \"GRM\",\n      \"amount\": \"1\"\n    }\n    ```\n- ```POST http://localhost:8080/payment``` - create new payment with a given parametrs\n    - Example:\n    ```\n    POST http://localhost:8080/payment\n    Content-Type: application/json\n    \n    {\n      \"currency\": \"GRM\",\n      \"amount\": \"1\",\n      \"address\": \"kQCBFvmeIOjrZlSoxIVys2nE7nQUxUPM370tbmyC_lzlaIlk\",\n      \"tag\": \"TEST\"\n    }\n    ```\n\n## Deposit accounts\nDeposit account - an entity, that has multiple addresses, to which funds are constantly received.\n### BPS API\n- ```createNewAccount``` - receives account id, list of currencies you want to use and creates account\n- ```createNewAddress``` - receives account id, address currency and return created address\n- ```getDepositAccount``` - receives account id and return deposit account\n- ```getAllTx``` - receives account id, currency and return all transactions to account addresses\n- ```getLastTxToAddress``` - receives account id, currency, address, amount of transactions and return last transactions to address\n\n### Detailed description of the system\nCoursework with a detailed description of the system\n- [Coursework by Dmitry Pogrebnoy (ru)](http://se.math.spbu.ru/SE/YearlyProjects/vesna-2020/pi/Pogrebnoy-report.pdf)\n- Coursework by Artyom Chemezov - awaiting publication\n- [Coursework by Sergey Andreev (ru)](https://oops.math.spbu.ru/SE/YearlyProjects/vesna-2020/YearlyProjects/vesna-2020/mo-3rd-course/S.Andreev-report.pdf)\n- [Coursework by Sergey Skaredov (ru)](http://se.math.spbu.ru/SE/YearlyProjects/spring-2019/371/Skaredov-report.pdf)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsx-tech%2Fblockchain-payment-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsx-tech%2Fblockchain-payment-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsx-tech%2Fblockchain-payment-system/lists"}