[doc] end user documentation for Bitcoin transactions via SONs #197

Closed
opened 2021-10-21 07:26:59 +00:00 by bobinson · 4 comments
bobinson commented 2021-10-21 07:26:59 +00:00 (Migrated from gitlab.com)
  • We need the basic steps for an end user
  • The end user is expected have acceess to Bitcoin CLI and Peerplays CLI
  • Bitcoin deposit address creation, Bitcoin Deposit via bitcoin-cli
  • verifying the transactions, listing funds in peerplays account
  • withdrawing BTC to a withdraw address
  • adding a new withdraw address
  • fund movement to Bitcoin Deposit address and Bitcoin Primary wallet address also must be demonstrated, fee is to be explained

Create_sidechain_address.docx

- We need the basic steps for an end user - The end user is expected have acceess to Bitcoin CLI and Peerplays CLI - Bitcoin deposit address creation, Bitcoin Deposit via bitcoin-cli - verifying the transactions, listing funds in peerplays account - withdrawing BTC to a withdraw address - adding a new withdraw address - fund movement to Bitcoin Deposit address and Bitcoin Primary wallet address also must be demonstrated, fee is to be explained [Create_sidechain_address.docx](/uploads/978b9a400caba02cab25acad63cd7d78/Create_sidechain_address.docx)
bobinson commented 2021-10-21 07:28:46 +00:00 (Migrated from gitlab.com)

changed title from [doc] end user documentation for Bitcoin via SONs to [doc] end user documentation for Bitcoin {+ transactions +}via SONs

changed title from **[doc] end user documentation for Bitcoin via SONs** to **[doc] end user documentation for Bitcoin {+ transactions +}via SONs**
bobinson commented 2021-10-21 07:29:40 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
bobinson commented 2021-10-22 13:16:54 +00:00 (Migrated from gitlab.com)

Deposit Flow :

One needs to find public keys for the Bitcoin address to create Bitoin Deposit address and for the lcoal node the following can be used to get public keys:

./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default getnewaddress

./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default getaddressinfo 'newly_generated_address'

* Assuming that the Bitcoin sidechain address(Multi-sig deposit_address) has been created and the QA environment is running as expected.

Flow :

1. Send BTC to the deposit address(multi-sig deposit address).

Ex : ./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default sendtoaddress "bcrt1q0wmnx35zp8q5wzk3rjykjrqkvn7mtcrep5enuucgl84ujge8pcesns2prw" 0.9

API link : https://chainquery.com/bitcoin-cli/sendtoaddress

2. Execute generatetoaddress.

Ex : ./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default generatetoaddress 1 "bcrt1q0wmnx35zp8q5wzk3rjykjrqkvn7mtcrep5enuucgl84ujge8pcesns2prw"

API link : https://chainquery.com/bitcoin-cli/generatetoaddress

  • We can track the transaction here ...( Transaction should be detected by SONs, and processed, which is visible in witness logs )

    • We should be able to see deposit object.
      Ex : get_object 1.36.X

    • In some time, usually in seconds, deposit object fields confirmed and processed are both true.

      image

    • You will be able see sidechain transaction object, for moving funds from deposit address to primary wallet.
      Ex : get_object 1.39.X

    • Sidechain transaction object field status should be "sent', which means BTC transaction is sent to BTC network.

      image

3. Execute generatetoaddress, to process funds moving transaction. (Yes, we have to execute this command twice.)

Ex : ./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default generatetoaddress 1 "bcrt1q0wmnx35zp8q5wzk3rjykjrqkvn7mtcrep5enuucgl84ujge8pcesns2prw"

  • Track this step.

    • Sidechain transaction object field status should be "settled', which means btc transaction is executed.Ex : get_object 1.39.X

      image

4. Check account balance : (Account should be funded with BTC tokens).

   Command : `list_account_balances account_id`

image

# Deposit Flow : One needs to find public keys for the Bitcoin address to create Bitoin Deposit address and for the lcoal node the following can be used to get public keys: ``` ./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default getnewaddress ./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default getaddressinfo 'newly_generated_address' ``` #### * Assuming that the Bitcoin sidechain address(Multi-sig deposit_address) has been created and the QA environment is running as expected. ### Flow : #### 1. Send BTC to the deposit address(multi-sig deposit address). Ex : ```./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default sendtoaddress "bcrt1q0wmnx35zp8q5wzk3rjykjrqkvn7mtcrep5enuucgl84ujge8pcesns2prw" 0.9``` API link : https://chainquery.com/bitcoin-cli/sendtoaddress #### 2. Execute generatetoaddress. Ex : ` ./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default generatetoaddress 1 "bcrt1q0wmnx35zp8q5wzk3rjykjrqkvn7mtcrep5enuucgl84ujge8pcesns2prw"` API link : https://chainquery.com/bitcoin-cli/generatetoaddress * We can track the transaction here ...( Transaction should be detected by SONs, and processed, which is visible in witness logs ) - We should be able to see deposit object. Ex : `get_object 1.36.X` - In some time, usually in seconds, deposit object fields confirmed and processed are both true. ![image](/uploads/1b5747adbc736c59b3a0cc893068a92a/image.png) - You will be able see sidechain transaction object, for moving funds from deposit address to primary wallet. Ex : `get_object 1.39.X` - Sidechain transaction object field status should be "sent', which means BTC transaction is sent to BTC network. ![image](/uploads/79b243be7f359f37431ae12d1f77ef86/image.png) #### 3. Execute generatetoaddress, to process funds moving transaction. (Yes, we have to execute this command twice.) Ex : `./bitcoin-cli -rpcuser=1 -rpcpassword=1 -rpcwallet=default generatetoaddress 1 "bcrt1q0wmnx35zp8q5wzk3rjykjrqkvn7mtcrep5enuucgl84ujge8pcesns2prw"` * Track this step. - Sidechain transaction object field status should be "settled', which means btc transaction is executed.Ex : `get_object 1.39.X` ![image](/uploads/bb7adba1c86cf93b8e457ef31a092077/image.png) #### 4. Check account balance : (Account should be funded with BTC tokens). Command : `list_account_balances account_id` ![image](/uploads/e9de5d0360cd86703a0b628a77a3410d/image.png)
bobinson commented 2021-11-02 10:22:11 +00:00 (Migrated from gitlab.com)

Withdraw

bobinson
3:47 PM
For the withdrawals, ie from Peerplays to Bitcoin, note that you can withdraw only to a withdraw address mapped with the Peerplays account.
ie the first step is to make sure that the address has a withdraw address, if not change it. (This also means, you can't just withdraw to an arbitrary bitcoin address without first making it the withdrwa address)
transfer son-account 1000 BTC "" true ----> This CLI command will take care of the withdraw once withdraw address is added
The above command takes 1000 BTC from the peerplays username and withdraws/sends to a withdraw address mapped with peerplays username. The account son-account is a special account that handles the multi-sig of SONs

# Withdraw bobinson 3:47 PM For the withdrawals, ie from Peerplays to Bitcoin, note that you can withdraw only to a withdraw address mapped with the Peerplays account. ie the first step is to make sure that the address has a withdraw address, if not change it. (This also means, you can't just withdraw to an arbitrary bitcoin address without first making it the withdrwa address) transfer <peerplays username> son-account 1000 BTC "" true ----> This CLI command will take care of the withdraw once withdraw address is added The above command takes 1000 BTC from the peerplays username and withdraws/sends to a withdraw address mapped with peerplays username. The account son-account is a special account that handles the multi-sig of SONs
bobinson (Migrated from gitlab.com) closed this issue 2022-05-05 11:25:09 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Peerplays_Blockchain/peerplays_migrated#197
No description provided.