From dce07aa93b3c2f47aca0c24cea6adde9ec37f1a7 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 8 Jan 2023 21:05:34 -0800 Subject: tech debt jubilee --- doc/PAYMENTS.md | 52 ---------------------------------- doc/fund-server-bitcoin-cli.md | 44 ---------------------------- doc/img/50-bitcoin-server-balance.gif | Bin 7791 -> 0 bytes 3 files changed, 96 deletions(-) delete mode 100644 doc/PAYMENTS.md delete mode 100644 doc/fund-server-bitcoin-cli.md delete mode 100644 doc/img/50-bitcoin-server-balance.gif (limited to 'doc') diff --git a/doc/PAYMENTS.md b/doc/PAYMENTS.md deleted file mode 100644 index 2934aae8..00000000 --- a/doc/PAYMENTS.md +++ /dev/null @@ -1,52 +0,0 @@ -# This document describes the types of transactions and accounts that can occur in CoinOS - -## Receive bitcoin - -There are four ways a user can receive bitcoin - -- Bitcoin -- Liquid -- Lightning -- Internal - -In every case, a payment record is added to the `payments` table -The payment `type` will be one of BTC, LBTC, LNBTC, or COINOS -The `amount` will be a positive integer representing the number of satoshis received - -In the case of Bitcoin and Liquid payments, the `confirmed` column will be set to `false` initially until the transaction -is mined into a block on the blockchain. - -Also, the payment amount will be reflected in users' active account record in the `accounts` table under the `pending` column. The `balance` column will be updated when confirmations are received and the `pending` amount will be debited. - -## Send bitcoin - -Users can also send bitcoin over any of the four networks by pasting in or scanning a QR code of a bitcoin or liquid address, lightning invoice, or username. - -In the case of lightning, it's also possible to paste an [LNURL](https://github.com/fiatjaf/lnurl-rfc) which is a way of getting a lightning invoice from a remote server or other wallet over HTTP. - -If scanning or pasting an address or invoice that happens to belong to another coinos user, coinos will detect that and automatically change the payment type to an internal COINOS transfer as if you had typed in the recipient's username. - -## Creating Liquid Assets - -Users can issue new assets on the Liquid network at https://coinos.io/asset - -This will create an on-chain transaction that will issue a specified amount of new tokens. A new account record will be created in the `accounts` table for the user to track their balance of the new asset. As with receiving bitcoin over the Liquid network, the balance will be `pending` until one block confirmation has been received and then it will be updated. - -A separate payment record will be created to cover the fee for the issuance transaction, which is paid in L-BTC. - - -## Receiving Liquid Assets - -If the user has not received a particular asset before, a new account will be generated for them at the time the payment is detected. - -## Sending Liquid Assets - -Users can choose from a drop down menu to pick which account they want to be the active one. In the case of Liquid assets, they will only be able to an internal transfer to another coinos user, or send to a Liquid address. Users will receive an error if they paste in an LN invoice or on-chain BTC address while they have a Liquid asset accounted selected as their active account. - -## Depositing Fiat - -After having their account verified, users can fill out the deposit form at https://coinos.io/funding to indicate that they intend to send an interac or wire transfer. If the user is added to the list of accounts enabled for auto-deposit (under the `imap` config in config/index.js) then coinos will parse the Interac email it receives and automatically generate a new payment record and update the users Bitcoin account balance to credit them with an amount of bitcoin calculated equivalent to the fiat amount received, based on the current exchange rate less 2%. - -## Withdrawing Fiat - -Fiat withdrawals are currently processed manually. When a user requests to withdraw, we manually calculate how much bitcoin to remove from their account and do that with a database query before sending them an interac or wire transfer. diff --git a/doc/fund-server-bitcoin-cli.md b/doc/fund-server-bitcoin-cli.md deleted file mode 100644 index e0a2c5e3..00000000 --- a/doc/fund-server-bitcoin-cli.md +++ /dev/null @@ -1,44 +0,0 @@ -## Fund Coinos server (via bitcoin-cli) - -Bitcoin Regtest Mode allows us to create our own Bitcoin sandbox blockchain for use in testing & development. - - -From the coinos-server dir on your localfilesystem (ie- after following the 'Getting Started' section of our [root README]) - -```bash - -docker exec -it bitcoin bash - -# get an address -bitcoin-cli -regtest -rpcuser=admin1 -rpcpassword=123 getnewaddress -> bcrt1qzneawwyxe0fts5p8a6tsp4gu2mfnqzs92235hm # (example) - -# mine a block to the new address -bitcoin-cli -regtest -datadir=/home/bitcoin/.bitcoin generatetoaddress 101 theaddressgeneratedabove - -# verify you got the reward by doing: -bitcoin-cli -regtest -rpcuser=admin1 -rpcpassword=123 getbalance -> 50.00000000 - -# send 10 bitcoin to a coinos wallet account you created -# (get the address to send to from ./receive, select 'Bitcoin') -bitcoin-cli -regtest -rpcuser=admin1 -rpcpassword=123 sendtoaddress [account-address] 10 - -# confirm the transaction -# (do the mining command again) -bitcoin-cli -regtest -rpcuser=admin1 -rpcpassword=123 generatetoaddress 101 theoriginaladdressgeneratedabove -``` - -![](./img/50-bitcoin-server-balance.gif) - - - -#### further reading - -On why to generate 101 blocks and some general info on Regtest Mode: - -https://developer.bitcoin.org/examples/testing.html - - -[root README]:https://github.com/coinos/coinos-server - diff --git a/doc/img/50-bitcoin-server-balance.gif b/doc/img/50-bitcoin-server-balance.gif deleted file mode 100644 index 2fba5088..00000000 Binary files a/doc/img/50-bitcoin-server-balance.gif and /dev/null differ -- cgit v1.2.3