Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gateway-Core Fund Transfer Protocol Updates #213

Open
buckyroberts opened this issue Jul 27, 2024 · 0 comments
Open

Gateway-Core Fund Transfer Protocol Updates #213

buckyroberts opened this issue Jul 27, 2024 · 0 comments

Comments

@buckyroberts
Copy link
Member

Gateway-Core Fund Transfer Protocol

To transfer funds from a Core to the Gateway (thenewboston.com), users first need to create a Wallet for that Core.

Screen Shot 2024-07-27 at 12 19 39 PM
class Wallet:
    owner
    core
    balance
    deposit_account_number
    deposit_balance
    deposit_signing_key

Each wallet contains a deposit account. This is the account where the user will first send their funds to (to their deposit_account_number). Once a user's deposit account has been credited, they can transfer those funds to their Gateway wallet. This creates a Wire object, which is a Block representing a transfer of funds from the users deposit account to the Gateway account (settings.ACCOUNT_NUMBER), which credits their Wallet.balance.

class WireType:
    DEPOSIT
    WITHDRAW

class Wire(Block):
    core
    owner
    created_date
    wire_type = WireType

When withdrawing funds from the Gateway back to the Core, the process is essentially reversed:

  1. The user initiates a withdrawal request on the Gateway, specifying the amount and the recipient account number on the Core.
  2. The Gateway creates a Wire object with wire_type = WireType.WITHDRAW.
  3. The Gateway then sends a transaction on the Core network, transferring funds from the Gateway's account (settings.ACCOUNT_NUMBER) to the user's specified account on the Core.
  4. The Wire object records this transaction, linking it to the user's Wallet and the specific Core.
  5. The user's Wallet.balance on the Gateway is decreased by the withdrawn amount (plus any applicable fees).
  6. The funds are then available in the user's specified account on the Core network.

Updates Needed

We need to update the system to put the distribution of TNB under Ia's control, enabling her to directly reward contributors based on their assessed value to the project. To do this we will:

  1. Reset TNB Wallet Balances

    1. Reset all user TNB wallet balances on the Gateway to 0.
    2. This action prepares the system for a fresh start with the new distribution model.
  2. Create a TNB Wallet for Ia

    1. Set up a new TNB wallet on the Gateway (thenewboston.com) for Ia.
    2. This wallet will be used to manage and distribute TNB coins.
  3. Mint TNB Coins

    1. On the TNB Core (tnb-core.com), mint 1 Billion TNB coins.
    2. Deposit these newly minted coins into Ia's deposit account on the Core.
  4. Transfer Funds to Gateway

    1. Move the 1 Billion TNB coins from Ia's deposit account on the Core to Ia's Gateway wallet.
    2. This transfer will create a Wire object of type DEPOSIT, recording the transaction.
  5. Enable Reward Distribution

    1. With the TNB coins now in Ia's Gateway wallet, Ia can use these funds to reward contributors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants