CPG-MP FSD Account

FSD — Merchant Portal

A. Document controlA. Kiểm soát tài liệu

Doc IDCPG-FSD-CPG-MP_FSD_Account
VersionPhiên bản2.3
StatusTrạng tháiDraft
OwnerCPG BA / Architecture
AudienceĐối tượngFrontend, Backend, QA, Product
ClassificationPhân loạiInternal
Effective dateNgày hiệu lực01/12/2026
Related docs Merchant Portal Index · BR/NFR Catalog

B. Version historyB. Lịch sử phiên bản

Version Date Author ChangesThay đổi
1.0 12/01/2026 Khoa Trinh Version 1.0
2.0 22/06/2026 Khoa Trinh Release v2.0 (New fund flow, add Virtual Account)
2.1 20/08/2026 Khoa Trinh Version 2.1: add BR-MP-ACC IDs; freeze RBAC defaults; uniqueness, VA-HW bind, TRON, immutability, pagination, Web3Auth no-key, and audit scope. See Changes in v2.1.
2.2 16/11/2026 Khoa Trinh Version 2.2: post-create Inactive; BW maker-checker; HW activate via FlyPay ticket only; step-up 2FA on sensitive mutations. See Changes in v2.2.
2.3 30/11/2026 Khoa Trinh Version 2.3: Payout Account and Refund Account (create/configure caps, maker-checker activate); five tabs; FLOW-OUT1 fund-flow. See Changes in v2.3.
2.4 02/12/2026 Khoa Trinh Version 2.4: Payout / Refund Account tabs have no list filter section (table + pagination only); UC-ACC-17 / 21 retired.

C. Table of contentsC. Mục lục

D. ContentD. Nội dung

1. Module Scope

The Accounts Module enables merchants to manage crypto wallet infrastructure used for payment collection, fund custody, settlement routing, trader payout, and customer refund.
The updated module contains five account types:

Account Type Purpose
Hot Wallets Merchant-controlled or system-provisioned custody wallets used to hold funds before settlement; refill source for Payout and Refund Accounts
Virtual Account Customer/payment collection addresses mapped to customers and linked to hot wallets
Beneficiary Wallets Destination wallets used to receive settlement payouts
Payout Account CPG MPC wallet funded from HW; outbound trader payout only (after KYT). One per Active HW.
Refund Account CPG MPC wallet funded from HW; outbound customer refund only (KYC whitelist + dual-approve). One per Active HW.

The module supports:

  • Hot wallet listing, filtering, creation, and status management
  • Virtual account listing, filtering, creation, and status management
  • Beneficiary wallet listing, filtering, creation, and status management
  • Beneficiary wallet creation by:
  • Pro Mode (BYOW) — Bring Your Own Wallet
  • Easy Mode (Web3Auth) — wallet generated after social/email authentication
  • Payout Account listing, creation, cap configuration (dual-approve), and status management
  • Refund Account listing, creation, cap configuration (dual-approve), and status management
  • Wallet address copy and blockchain explorer opening
  • Step-up 2FA challenge before sensitive Account mutations (create BW/HW/VA/PA/RA, approve/reject BW/PA/RA, request HW activation, VA/BW/PA/RA status change, cap approve)
  • Beneficiary dual-approval (maker-checker), PA/RA maker-checker activate, and Hot Wallet FlyPay ticket activation
  • Balance display by available amount, total amount, and settled amount
  • Network compatibility validation between Hot Wallet, Virtual Account, Beneficiary Wallet, Payout Account, and Refund Account
  • Pagination, search, and filter controls
  • Audit logging for create, status change, and Web3Auth-related actions. Copy / open explorer audit is Optional and out of scope for this phase.

Out of scope for this phase:

  • Fiat bank accounts
  • Fiat settlement accounts
  • On/off ramp bank transfer configuration
  • Merchant-side private key export
  • Manual blockchain transaction signing from the portal
  • Mandatory audit of copy-address and open-explorer actions
  • Refill job console / ledger Numscript UI (ops reference only via FLOW-OUT1)
  • BYOW / Web3Auth for Payout or Refund Accounts (system-issued MPC only)

2. User Roles

Role Permissions
Merchant Admin Full access: view, search, create Hot Wallet / Virtual Account / Beneficiary Wallet / Payout Account / Refund Account, activate/deactivate, copy address, open explorer
Merchant Finance View, search, create Virtual Account, create Beneficiary Wallet, view balances, copy/open explorer. May approve PA/RA caps and PA/RA activation when grant present (≠ maker). Cannot create Hot Wallet, Payout, or Refund. Cannot deactivate.
Merchant Operator View, search, copy/open explorer, create Virtual Account. Cannot create Hot Wallet, Beneficiary, Payout, or Refund. Cannot activate/deactivate.
Merchant Support Read-only access except copy address and open explorer. Cannot create or change status.
Merchant Developer Read-only access to wallet addresses and network data for integration. Cannot copy/open explorer, create, or change status.
Merchant Viewer Read-only access only. Cannot copy/open explorer, create, or change status.

2.1 RBAC matrix (default for this phase)

Action Admin Finance Operator Support Developer Viewer
View / search / filter all tabs Y Y Y Y Y Y
Create Hot Wallet Y N N N N N
Create Virtual Account Y Y Y N N N
Create Beneficiary Wallet (BYOW / Web3Auth) Y Y N N N N
Create Payout Account / Refund Account Y N N N N N
Activate / deactivate (VA; BW deactivate; HW deactivate only; PA/RA deactivate) Y N N N N N
Approve Beneficiary (≠ creator) Y* Y* N N N N
Approve PA/RA activate or cap change (≠ maker) Y* Y* N N N N
Request HW activation ticket Y N N N N N
Copy address / open explorer Y Y Y Y N N
Update display metadata (name / customer name / email) Y Y N N N N

* Approve requires explicit approve grant on the resource. Denied actions return HTTP 403 with portal message “Access denied”.

2.2 Business Requirements

ID Need (summary) Solution location
BR-MP-ACC-01 Account landing with five tabs; merchant tenant isolation; shortened addresses F1; UC-ACC-01 / 05 / 09 / 16 / 20
BR-MP-ACC-02 Hot Wallet list, filters, balances, stale indicator F2; UC-ACC-01 / 02
BR-MP-ACC-03 Create Hot Wallet linked to active same-network Beneficiary Wallet; post-create Inactive F3; UC-ACC-03 / 15
BR-MP-ACC-04 Virtual Account list and filters F4; UC-ACC-05 / 06
BR-MP-ACC-05 Create Virtual Account bound to an active Hot Wallet F5; UC-ACC-07
BR-MP-ACC-06 Beneficiary Wallet list and filters F6; UC-ACC-09 / 10
BR-MP-ACC-07 Create Beneficiary Wallet by Pro Mode (BYOW); post-create Inactive F7 / F8; UC-ACC-11
BR-MP-ACC-08 Create Beneficiary Wallet by Easy Mode (Web3Auth); no private keys; post-create Inactive F7 / F9; UC-ACC-12
BR-MP-ACC-09 Copy full wallet address; open blockchain explorer F10 / F11; UC-ACC-13 / 14
BR-MP-ACC-10 BW maker-checker activate; HW Active only via FlyPay ticket; PA/RA maker-checker; VA status + linkage warnings; no historical delete; step-up 2FA F12; UC-ACC-04 / 08 / 19 / 23
BR-MP-ACC-11 RBAC by merchant role §2; §2.1
BR-MP-ACC-12 Audit logging for create, status change, and Web3Auth §8
BR-MP-ACC-13 Payout Account list, balances (no list filters; catalog BR-MP-WLT-008 New) F13; UC-ACC-16
BR-MP-ACC-14 Create Payout Account on Active HW; system address; one per HW; Inactive default (BR-MP-WLT-009 New) F14; UC-ACC-18
BR-MP-ACC-15 Configure payout_cap dual-approve + 2FA (BR-MP-WLT-010 New) F15; UC-ACC-19
BR-MP-ACC-16 Refund Account list, balances (no list filters; BR-MP-WLT-012) F16; UC-ACC-20
BR-MP-ACC-17 Create Refund Account on Active HW; system address; one per HW; Inactive default (BR-MP-WLT-013) F17; UC-ACC-22
BR-MP-ACC-18 Configure refund_cap dual-approve + 2FA (BR-MP-WLT-014) F18; UC-ACC-23

3. Functional Requirements

3.1 Account Landing Page

F1. Accounts Page with Tabs

Description:
Displays the account management workspace with five account categories.
Tabs

Tab Description
Hot Wallets Manage custody wallets and supported assets
Virtual Account Manage customer/payment collection virtual addresses
Beneficiary Wallets Manage settlement destination wallets
Payout Accounts Manage trader-payout MPC wallets bound to Hot Wallets
Refund Accounts Manage customer-refund MPC wallets bound to Hot Wallets

Default Behavior

  • Default selected tab: Hot Wallets
  • Hot Wallets / Virtual Account / Beneficiary Wallets tabs each have filters, table, CTA, and pagination
  • Payout Accounts / Refund Accounts tabs: table, CTA, and pagination only (no list filter section)
  • Pagination default page size is 20; maximum page size is 100
  • Switching tabs preserves current page state only during current browser session
  • Merchant can only see accounts belonging to the current merchant
  • All wallet addresses displayed in list views must be shortened
  • Full wallet address must be available via copy action
  • Explorer icon opens the blockchain explorer

3.2 Hot Wallets

F2. Hot Wallet List

Description:
Displays merchant hot wallets used for custody and routing funds to beneficiary wallets.
Primary CTA

Button Behavior
Create Hot Wallet Opens Create Hot Wallet modal

Filters

Filter Type Description
Account Address Text input Search by full or partial wallet address
Network Dropdown All Networks / TRON Mainnet / TRON Testnet / BSC Mainnet / Ethereum Mainnet / Polygon Mainnet / BSC Testnet / others
Assets Dropdown All Assets / USDT / USDC / others
Created By Dropdown All Creators / specific user
Status Dropdown All Status / Active / Inactive
Total Amount From Number input Minimum total wallet amount
Total Amount To Number input Maximum total wallet amount
Settled Amount From Number input Minimum settled amount
Settled Amount To Number input Maximum settled amount
Created Date From Date picker Start created date
Created Date To Date picker End created date
Search Button Applies selected filters

Table Columns

Column Description
# Row number
Account Name Hot wallet display name
Account Address Shortened address with copy and explorer icons
Network Combined blockchain and network type, for example BSC Testnet
Available / Total Amount Available amount and total amount
Settled Amount Settled amount by asset, for example USDT: 10,000.00, USDC: 5,000.00
Created By User who created the hot wallet
Created Date Wallet creation timestamp
Action Active/Inactive toggle

Rules

  • Hot Wallet address is immutable after creation.
  • Network is immutable after creation.
  • Supported assets must match the selected network.
  • Available amount must not exceed total amount.
  • Settled amount must be grouped by asset.
  • If balance data is stale, show last cached amount and stale indicator.
  • Active Hot Wallets can be used when creating Virtual Accounts.
  • Inactive Hot Wallets cannot be selected for new Virtual Accounts.
  • Deactivating a Hot Wallet with active Virtual Accounts requires confirmation.
  • Historical transactions remain visible even when the Hot Wallet is inactive.
  • After creation, only wallet_name is editable. Network, address, beneficiary link, and supported assets are immutable.

F3. Create Hot Wallet

Description:
Allows merchant to create a new Hot Wallet and associate it with a Beneficiary Wallet.
Modal Title: Create Hot Wallet
Fields

Field Required Type Description
Wallet Name Yes Text input Display name of the hot wallet (3–50 characters: letters, numbers, spaces, -, _)
Network Yes Dropdown Blockchain network where the wallet will operate. Labels follow §F2 (e.g. TRON Mainnet / Testnet). Testnet options appear only on non-production environments.
Service Yes Dropdown Merchant-registered payment service (e.g. API Payment). Determines fee schedule applied to the wallet.
Beneficiary Wallet Yes Dropdown Settlement destination wallet. Non-selectable options are shown disabled with reason (pending approval, switched off, different network).
Create New No Link Opens Create Beneficiary Wallet flow
Supported Assets Yes Multi-select / checkbox Assets valid for the selected network: TRON = USDT; BSC / Ethereum / Polygon = USDT and USDC (Polygon: native Circle USDC)

Buttons

Button Behavior
Cancel Closes modal without saving (if the form has changes, confirm Keep editing / Discard)
Create Hot Wallet Validates form fields first, then opens step-up 2FA; on success creates Hot Wallet

Creation Rules

  • Wallet Name is required.
  • Wallet Name must be 3–50 characters: letters, numbers, spaces, -, _.
  • Wallet Name must be unique per merchant and network.
  • Network is required.
  • Service is required and must already be configured for the merchant.
  • Beneficiary Wallet is required.
  • Beneficiary Wallet must be active.
  • Beneficiary Wallet must match the selected network.
  • Beneficiary wallets that are not selectable remain visible but disabled with an explicit reason.
  • Supported Assets must be valid for selected network.
  • At least one asset must be selected.
  • Form validation runs before step-up 2FA so users are not asked for a code when the form is incomplete.
  • Hot Wallet address is generated by the system after successful creation.
  • On EVM networks, the list may show status Creating… until the address is ready; if creation exceeds 10 minutes, show failure and allow retry.
  • Newly created Hot Wallet status defaults to Inactive. Merchant must request FlyPay activation (ticket); merchant must not set Active via PATCH.
  • Created wallet appears in Hot Wallet list after success.
  • Creation action must be audit logged.

Validation Errors

Scenario Error Message
Missing wallet name Wallet name is required
Invalid wallet name Wallet name must be 3–50 characters: letters, numbers, spaces, '-' or '_'.
Missing network Network is required
Missing service Service is required
Service not configured Service "…" is not configured for your merchant account. Please contact FlyPay Support.
Missing beneficiary wallet Beneficiary wallet is required
Network mismatch Beneficiary wallet network must match selected network
No supported asset selected Select at least one supported asset
Duplicate wallet name Wallet name already exists
Wallet creation failed Unable to create hot wallet. Please try again

3.3 Virtual Account

F4. Virtual Account List

Description:
Displays customer/payment collection virtual accounts linked to Hot Wallets.
Primary CTA

Button Behavior
Create Virtual Account Opens Create Virtual Account modal

Filters

Filter Type Description
Hot Wallet Dropdown All Hot Wallets / specific hot wallet
Customer ID Text input Search by Customer ID
Address Text input Search by virtual account address
Network Dropdown All Networks / specific network
Assets Dropdown All Assets / USDT / USDC / others
Available From Amount Number input Minimum available amount
Available To Amount Number input Maximum available amount
Status Dropdown All Status / Active / Inactive
Last Transaction From Date picker Start date for last transaction
Last Transaction To Date picker End date for last transaction
Search Button Applies selected filters

Table Columns

Column Description
# Row number
Customer ID Merchant customer identifier
Hot Wallet Linked hot wallet name
Address Shortened virtual account address with copy and explorer icons
Network Blockchain and network type
Available / Total Amount Available amount and total amount with asset
Last Transaction At Last inbound or outbound transaction timestamp
Action Active/Inactive toggle

Rules

  • Virtual Account belongs to exactly one merchant.
  • Virtual Account must be linked to one active Hot Wallet.
  • Virtual Account address is generated by system.
  • Virtual Account address is immutable after creation.
  • Virtual Account network must match linked Hot Wallet network.
  • Supported assets are inherited from the selected Hot Wallet.
  • Virtual Account can be assigned to a specific Customer ID.
  • Customer ID must be unique among active Virtual Accounts per merchant. An inactive VA does not block creating a new VA for the same Customer ID. The new VA always receives a new address; the deactivated address is never reused.
  • Inactive Virtual Account cannot be used for new payment collection.
  • Existing historical transactions remain visible.
  • Last Transaction At is calculated from latest transaction associated with the virtual account.
  • List must support pagination and page-size selector. Default page size 20, maximum 100.

F5. Create Virtual Account

Description:
Allows merchant to create a customer-specific virtual account for payment collection.
Modal Title: Create Virtual Account
Description Text: Create a new virtual account for payment collection.
Fields

Field Required Type Description
Customer ID Yes Text input Merchant-side customer identifier, for example CUST013
Customer Name No Text input Customer display name
Customer Email No Email input Customer email address
Hot Wallet Yes Dropdown Linked Hot Wallet. Required. Must be an active Hot Wallet belonging to the current merchant.
Network System-derived (read-only) Network of the selected Hot Wallet
Assets System-derived; subset allowed Assets supported by selected Hot Wallet. Merchant may subset when HW has more than one asset. Cannot add assets not on the Hot Wallet.

Buttons

Button Behavior
Cancel Closes modal without saving
Create Virtual Account Validates and creates Virtual Account

Creation Rules

  • Customer ID is required.
  • Customer Name is optional.
  • Customer Email is optional but must be valid email format if provided.
  • Hot Wallet is required.
  • Selected Hot Wallet must be active.
  • hot_wallet_id is required on the create API. Network and assets are derived from the selected Hot Wallet; they are not independently selectable.
  • Network must match selected Hot Wallet.
  • Assets must be selected from Hot Wallet supported assets.
  • Virtual Account address is generated by system after successful creation.
  • Newly created Virtual Account status defaults to Active.
  • Newly created Virtual Account balance defaults to 0 unless indexed balance already exists.
  • Creation action must be audit logged.
  • After creation, only customer_name and customer_email are editable. Customer ID, hot wallet, network, address, and assets are immutable.

Network and Assets Behavior

Scenario Behavior
Hot Wallet selected first Network and Assets are auto-populated from Hot Wallet
Network selected first Not supported. Network is read-only and derived from the selected Hot Wallet.
Hot Wallet has multiple assets Display all supported assets. Merchant may subset; at least one asset required.
Hot Wallet has one asset Auto-select asset
No compatible Hot Wallet Disable Create Virtual Account and show warning

Validation Errors

Scenario Error Message
Missing Customer ID Customer ID is required
Invalid email Customer email is invalid
Missing Hot Wallet Hot Wallet is required
Inactive Hot Wallet Selected Hot Wallet is inactive
Network mismatch Virtual Account network must match Hot Wallet network
Unsupported asset Selected asset is not supported by Hot Wallet
Duplicate Customer ID Customer ID already has an active virtual account
Creation failed Unable to create virtual account. Please try again

3.4 Beneficiary Wallets

F6. Beneficiary Wallet List

Description:
Displays settlement destination wallets used by Hot Wallets and settlement payout flows.
Primary CTA

Button Behavior
Create Beneficiary Wallet Opens Create Beneficiary Wallet modal

Filters

Filter Type Description
Wallet Address Text input Search by full or partial wallet address
Blockchain Dropdown All Blockchains / TRON / BSC / Ethereum / Polygon / others
Creation Type Dropdown All Types / Pro Mode (BYOW) / Easy Mode (Web3Auth)
Status Dropdown All Status / Active / Inactive
Created From Date picker Start created date
Created To Date picker End created date
Search Button Applies selected filters

Table Columns

Column Description
# Row number
Wallet Name Beneficiary wallet name
Wallet Address Shortened wallet address with copy and explorer icons
Blockchain Blockchain name
Network Type Mainnet / Testnet
Creation Type Pro Mode (BYOW) / Easy Mode (Web3Auth)
Created At Creation timestamp
Action Active/Inactive toggle

Rules

  • Beneficiary Wallet belongs to current merchant.
  • Wallet address is immutable after creation.
  • Blockchain and Network Type are immutable after creation.
  • Beneficiary Wallet can be reused by multiple Hot Wallets if compatible.
  • Inactive Beneficiary Wallet cannot be selected when creating Hot Wallet.
  • Deactivating a Beneficiary Wallet referenced by active Hot Wallets requires warning.
  • Delete is not recommended; use deactivate for auditability.
  • Copy and explorer actions are available for all wallet rows.
  • Duplicate wallet address under the same merchant is not allowed.

F7. Create Beneficiary Wallet — Mode Selection

Description:
Allows merchant to choose how to create a beneficiary wallet.
Modal Title: Create Beneficiary Wallet
Description Text: Create a new beneficiary wallet for receiving settlements.
Modes

Mode Description Recommended For
Pro Mode (BYOW) Merchant provides their own wallet address Experienced users who already have secure wallet infrastructure
Easy Mode (Web3Auth) Merchant creates wallet using social login or email via Web3Auth Users who do not have an existing wallet

Mode Card Behavior

  • Selected mode card is highlighted.
  • Mode switch changes the visible form fields.
  • User-entered Wallet Name and Network may be preserved when switching mode.
  • Changing mode does not create wallet until user confirms final action.

F8. Create Beneficiary Wallet — Pro Mode (BYOW)

Description:
Merchant creates a Beneficiary Wallet by entering an existing wallet address.
Mode Description:
Pro Mode: Merchant provides their own wallet address. Recommended for experienced users who already have a secure wallet.
Fields

Field Required Type Description
Wallet Name Yes Text input Beneficiary wallet display name
Network Yes Dropdown Blockchain network
Wallet Address Yes Text input Merchant-provided wallet address

Buttons

Button Behavior
Cancel Closes modal without saving
Create Wallet Creates Beneficiary Wallet

Validation Rules

  • Wallet Name is required.
  • Network is required.
  • Wallet Address is required.
  • Wallet Address must match selected blockchain format.
  • Duplicate wallet address under the same merchant is not allowed.
  • Wallet Address cannot be changed after creation.
  • Newly created wallet status defaults to Inactive (pending merchant approval).
  • Creation Type is stored as PRO_MODE_BYOW.
  • Creation action must be audit logged.

Address Validation Examples

Blockchain Type Validation
EVM chains Address must start with 0x and contain 40 hexadecimal characters
TRON Address must follow TRON base58 or hex address format based on network configuration

F9. Create Beneficiary Wallet — Easy Mode (Web3Auth)

Description:
Merchant creates a Beneficiary Wallet using Web3Auth social login or email authentication.
Mode Description:
Easy Mode: Merchant creates a new wallet using Web3Auth with social login or email. Recommended for users who do not have an existing wallet.
Fields

Field Required Type Description
Wallet Name Yes Text input Beneficiary wallet display name
Network Yes Dropdown Blockchain network
Web3Auth Integration Yes Integration block Launches Web3Auth authentication

Web3Auth Block

UI Element Description
Title Web3Auth Integration
Description Sign in with Google, Facebook, Email, Twitter
Launch Web3Auth Starts Web3Auth flow
Note A wallet will be generated after authentication

Buttons

Button Behavior
Cancel Closes modal without saving
Continue with Web3Auth Validates fields and continues Web3Auth flow

Flow

Step Description
1 Merchant selects Easy Mode
2 Merchant enters Wallet Name
3 Merchant selects Network
4 Merchant clicks Launch Web3Auth or Continue with Web3Auth
5 System starts Web3Auth session
6 Merchant completes authentication by social login or email
7 Web3Auth returns generated wallet address
8 System validates wallet address and network
9 System creates Beneficiary Wallet
10 Wallet appears in Beneficiary Wallet list

Rules

  • Wallet Name is required before continuing.
  • Network is required before launching Web3Auth.
  • Web3Auth session must be linked to current merchant and current user.
  • Web3Auth callback must be verified server-side.
  • Duplicate generated wallet address under the same merchant is not allowed.
  • Creation Type is stored as EASY_MODE_WEB3AUTH.
  • Newly created wallet status defaults to Inactive (pending merchant approval).
  • Provider metadata must be stored where available.
  • Private key must never be exposed to, received by, or stored in the Merchant Portal backend.
  • Creation action and Web3Auth callback must be audit logged.

3.5 Payout Accounts

F13. Payout Account List

Description:
Displays CPG MPC Payout Accounts used for trader payouts. Funded from the linked Hot Wallet via refill (ops/ledger; not configured in this portal module).

CTA: Create Payout Account

Filters: None — list is table + pagination only (one PA per Active HW; no dedicated filter bar).

Columns: Account name, address (short + copy/explorer), linked Hot Wallet, network, on-chain / available balance, payout_cap, status, created by, created date, actions.

Rules

  • Tenant isolation: merchant sees only own Payout Accounts.
  • Pagination default 20, maximum 100.
  • Payout Account must not be used for customer refunds.

F14. Create Payout Account

Description:
Creates a system-issued MPC Payout Account bound to exactly one Active Hot Wallet.

Modal fields

Field Required Control Notes
Account Name Yes Text Unique per merchant and network
Hot Wallet Yes Dropdown Active HW only; network/assets derived
Initial payout_cap Yes Decimal Must be > 0; integer minor units in API
Create — Primary Step-up 2FA then create

Rules

  • Address is generated by custody; no BYOW / Web3Auth / private keys.
  • At most one Payout Account per Active Hot Wallet (conflict if exists).
  • Post-create status = Inactive pending maker-checker activate.
  • Network, address, hot_wallet_id immutable after create; name editable.

F15. Configure Payout Cap

Description:
Merchant requests a payout_cap change; Approver ≠ maker confirms with step-up 2FA.

Rules

  • Pending cap request blocks concurrent second request on same account.
  • Reject keeps prior cap. Approve applies new cap and audits both actors.
  • Large outbound trader payouts (≥ policy threshold, e.g. 50k) do not raise cap ad-hoc; follow FLOW-OUT1 refill/dual-approve ops.

3.6 Refund Accounts

F16. Refund Account List

Description:
Displays CPG MPC Refund Accounts used for customer refunds only. Funded from the linked Hot Wallet via refill.

CTA: Create Refund Account

Filters / columns: Analogous to F13 (no list filters) with refund_cap instead of payout_cap.

Rules

  • Refund Account must not be used for trader payouts.
  • Tenant isolation and pagination same as other tabs.

F17. Create Refund Account

Description:
Creates a system-issued MPC Refund Account bound to exactly one Active Hot Wallet.

Rules

  • Same as F14 for address issuance, one-per-HW, Inactive default, immutability.
  • Initial refund_cap required; typically ≤ payout_cap for same HW (policy warning if larger).

F18. Configure Refund Cap

Description:
Merchant requests a refund_cap change; Approver ≠ maker confirms with step-up 2FA.

Rules

  • Same maker-checker pattern as F15.
  • Outbound refunds also require KYC whitelist + dual-approve at Transaction module (out of Account UI scope).

3.7 Common Wallet Behaviors

F10. Copy Wallet Address

Description:
Allows user to copy full wallet address from list rows.
Rules

  • Copy icon copies the full address, not shortened display text.
  • Show success toast: “Wallet address copied”.
  • User must have view permission for the wallet.

F11. Open Blockchain Explorer

Description:
Allows user to open wallet address in the correct blockchain explorer.
Rules

  • Explorer URL is generated from blockchain and network type.
  • If explorer URL is unavailable, disable explorer icon and show tooltip.
  • Open explorer in new browser tab.
  • User must have view permission for the wallet.

F12. Activate / Deactivate Wallet

Description:
Status changes are role- and type-specific. Step-up 2FA is mandatory for every status mutation listed below.
Supported Statuses

Status Description
Active Wallet can be used for new operations
Inactive Wallet is disabled for new operations but historical records remain visible

Rules (v2.3)

  • Beneficiary Wallet: create → Inactive. Transition to Active only when a merchant Approver ≠ creator confirms Approve + step-up 2FA. Creator cannot self-approve. Reject keeps Inactive (or Rejected).
  • Hot Wallet: create → Inactive. Merchant Admin may Request activation (Support ticket wallet_activation + 2FA). Merchant must not PATCH Hot Wallet to Active. FlyPay Support approve on CRM → internal activate → Active. Reject ticket → remains Inactive. Active HW allowlist destinations: Payout Account + Refund Account + Beneficiary + fee.
  • Virtual Account: Merchant Admin may activate/deactivate with confirmation + step-up 2FA.
  • Payout Account / Refund Account: create → Inactive. Activate only when Approver ≠ creator + step-up 2FA (not FlyPay ticket). Merchant Admin may deactivate Active→Inactive with 2FA; warn if refill or outbound queue outstanding. Inactive PA/RA cannot receive refill or send outbound.
  • Active Hot Wallet can be selected for Virtual Account / Payout / Refund creation.
  • Inactive Hot Wallet cannot be selected for new Virtual Accounts or new PA/RA.
  • Active Beneficiary Wallet can be selected for Hot Wallet creation.
  • Inactive Beneficiary Wallet cannot be selected for new Hot Wallets.
  • Inactive Virtual Account cannot be used for new payment collection.
  • Deactivation must not delete historical transactions.
  • Status change must be audit logged.
  • If deactivation affects linked accounts, confirmation is required.
  • Re-activating a Virtual Account is allowed only for the same virtual_account_id. The original address and derivation index are never reassigned to another customer.
  • Failed or cancelled step-up 2FA → no state change.

Warning Scenarios

Scenario Warning
Deactivate Beneficiary Wallet linked to active Hot Wallet This wallet is used by active Hot Wallets. Deactivating may affect settlement.
Deactivate Hot Wallet linked to active Virtual Accounts This Hot Wallet is used by active Virtual Accounts. Deactivating may affect payment collection.
Deactivate Virtual Account with pending transactions This Virtual Account has pending transactions. Deactivating may affect payment processing.
Deactivate Payout / Refund Account with outstanding refill or outbound queue Outstanding refill or payout/refund queue may fail. Confirm before deactivate.

4. Use Cases

Detailed use-case catalog for this module is maintained under 08_UC:Catalog use case chi tiết của module này được quản lý tại 08_UC:

5. User Interface Specification

5.1 Accounts Page — Common Layout

UI Element Description
Breadcrumb Home / Accounts
Page Title Accounts
Tab Bar Hot Wallets / Virtual Account / Beneficiary Wallets / Payout Accounts / Refund Accounts
Tab CTA Create button based on selected tab
Filter Panel Filters for HW / VA / BW tabs; hidden on Payout Accounts / Refund Accounts
Search Button Applies filters
Table Displays selected account type
Pagination Page size and page navigation. Default page size 20, maximum 100.

5.2 Hot Wallets Tab UI

CTA: Create Hot Wallet
Filters

Field Placeholder / Value
Account Address Enter wallet address
Network All Networks
Assets All Assets
Created By All Creators
Status All Status
Total Amount From Min amount
Total Amount To Max amount
Settled Amount From Min amount
Settled Amount To Max amount
Created Date From dd/mm/yyyy
Created Date To dd/mm/yyyy

Table

Column Example
Account Name Main Wallet
Account Address 0xbB18b9...5F9d62
Network Ethereum Mainnet
Available / Total Amount 128,450.00 / 150,000.00
Settled Amount USDT: 15,000.00 / USDC: 10,000.00
Created By Bob Nguyen
Created Date Aug 3, 2025 11:20 AM
Action Active toggle

5.3 Create Hot Wallet Modal UI

UI Element Description
Modal Title Create Hot Wallet
Close Icon Close modal
Wallet Name Required input
Network Required dropdown
Beneficiary Wallet Required dropdown
Create New Link to Create Beneficiary Wallet modal
Supported Assets USDT / USDC / others
Cancel Secondary button
Create Hot Wallet Primary button

5.4 Virtual Account Tab UI


CTA: Create Virtual Account
Filters

Field Placeholder / Value
Hot Wallet All Hot Wallets
Customer ID Search by Customer ID
Address Search by address
Network All Networks
Assets All Assets
Available From Amount Min amount
Available To Amount Max amount
Status All Status
Last Transaction From dd/mm/yyyy
Last Transaction To dd/mm/yyyy

Table

Column Example
Customer ID CUST001
Hot Wallet Test Wallet
Address 0x742d35Cc...595f0bEb
Network BSC Mainnet
Available / Total Amount 15,250.00 USDT / 18,500.00 USDT
Last Transaction At Jun 1, 2026 09:15 AM
Action Active toggle

5.5 Create Virtual Account Modal UI

UI Element Description
Modal Title Create Virtual Account
Description Create a new virtual account for payment collection
Customer ID Required input
Customer Name Optional input
Customer Email Optional email input
Hot Wallet Required dropdown
Network Supported network display or selector
Assets Supported assets display or selector
Cancel Secondary button
Create Virtual Account Primary button

5.6 Beneficiary Wallets Tab UI


CTA: Create Beneficiary Wallet
Filters

Field Placeholder / Value
Wallet Address Enter wallet address
Blockchain All Blockchains
Creation Type All Types
Status All Status
Created From dd/mm/yyyy
Created To dd/mm/yyyy

Table

Column Example
Wallet Name Main Settlement Wallet
Wallet Address 0xC8Fd68...12B3e5
Blockchain BSC
Network Type Mainnet
Creation Type Pro Mode (BYOW)
Created At Jan 10, 2026 09:15 AM
Action Active toggle

5.7 Create Beneficiary Wallet Modal UI

Mode Selection

UI Element Description
Pro Mode Card Bring Your Own Wallet
Easy Mode Card Web3Auth Social Login & Email
Informational Banner Explains selected mode

Pro Mode Fields

Field Required Description
Wallet Name Yes Wallet name
Network Yes Selected blockchain network
Wallet Address Yes Merchant wallet address

Easy Mode Fields

Field Required Description
Wallet Name Yes Wallet name
Network Yes Selected blockchain network
Web3Auth Integration Yes Launch Web3Auth authentication

5.8 Payout Accounts Tab UI

CTA: Create Payout Account

Filters: None (table + pagination only).

Table columns: Name, address, Hot Wallet, network, balance, payout_cap, status, created by, created date, actions (activate/deactivate, configure cap, copy, explorer).

Create modal: Account name, Active Hot Wallet dropdown, initial payout_cap, Cancel, Create (2FA).

Configure cap modal: Current cap, requested cap, Submit request / Approve / Reject (Approver ≠ maker + 2FA).

5.9 Refund Accounts Tab UI

CTA: Create Refund Account

Filters / table / modals: Same pattern as §5.8 (no list filters) with refund_cap and Refund Account labels.

6. Data Requirements

beneficiary_wallets

Field Type Required Description
wallet_id String No Beneficiary wallet identifier
merchant_id String Yes Owning merchant identifier
wallet_name String Yes Display name for the wallet
chain String Yes Blockchain slug (e.g. bsc, ethereum, polygon, tron)
network_type String Yes Network class (mainnet / testnet)
creation_type String Yes How the wallet was created (byow / web3auth / system)
wallet_address String Yes On-chain wallet address
status String Yes Beneficiary wallet status (inactive / active / rejected)
active Boolean Yes Whether the record is active for operations
created_at DateTime Yes Created timestamp (UTC)
updated_at DateTime Yes Last updated timestamp (UTC)
created_by_name String No Creator display name
created_by String No Creator user id

custody_addresses

Field Type Required Description
id UUID No Primary key
chain String Yes Blockchain slug (e.g. bsc, ethereum, polygon, tron)
merchant_id String Yes Owning merchant identifier
purpose String Yes Address purpose code (hot / va / custody purpose)
derivation_index Integer Yes HD derivation index used to issue the address
merchant_seed_alias String Yes Merchant custody seed alias
path_alias String Yes Derivation path alias
address String Yes On-chain address
owner_id String Yes Owning resource id (hot wallet / VA)
ledger_account String Yes Ledger account path for this address
network String Yes Network label / chain network
tier String Yes Custody / merchant tier label
watch_hot Boolean Yes Whether Sync should watch this hot address
active Boolean Yes Whether the record is active for operations
created_at DateTime Yes Created timestamp (UTC)

deploy_jobs

Field Type Required Description
id UUID No Primary key
kind String Yes Deploy job kind (va_deploy / related)
owner_id String Yes Owning resource id (hot wallet / VA)
merchant_id String Yes Owning merchant identifier
chain String Yes Blockchain slug (e.g. bsc, ethereum, polygon, tron)
network_type String Yes Network class (mainnet / testnet)
salt_hex String Yes CREATE2 salt (hex)
predicted String Yes Predicted contract / address before confirm
payload JSON Yes Job payload JSON
status String Yes Deploy job status (pending / running / succeeded / failed / cancelled)
attempts Integer Yes Retry attempt count
last_error String Yes Last failure message
tx_hash String Yes Related blockchain transaction hash
next_run_at DateTime Yes Next scheduled run time
locked_until DateTime No Worker lock expiry
created_at DateTime Yes Created timestamp (UTC)
updated_at DateTime Yes Last updated timestamp (UTC)
broadcast_tx_hash String Yes Broadcasted deploy transaction hash

derivation_counters

Field Type Required Description
chain String Yes Blockchain slug (e.g. bsc, ethereum, polygon, tron)
merchant_id String Yes Owning merchant identifier
purpose String Yes Address purpose code (hot / va / custody purpose)
next_index Integer Yes Next derivation index to allocate
updated_at DateTime Yes Last updated timestamp (UTC)

hot_wallets

Field Type Required Description
hot_id String No Hot wallet identifier
merchant_id String Yes Owning merchant identifier
wallet_name String Yes Display name for the wallet
service_id String Yes Payment / product service identifier
chain String Yes Blockchain slug (e.g. bsc, ethereum, polygon, tron)
network_type String Yes Network class (mainnet / testnet)
custody_address_id UUID No FK to custody address registry row
beneficiary_address String Yes Settlement destination address linked to the hot wallet
beneficiary_status String Yes Beneficiary link state (pending / active / rejected)
supported_assets String Yes Supported token symbols (e.g. USDT, USDC)
ledger_id String Yes Ledger instance / chart identifier
status String Yes Hot wallet status (active / inactive)
active Boolean Yes Whether the record is active for operations
created_at DateTime Yes Created timestamp (UTC)
updated_at DateTime Yes Last updated timestamp (UTC)
beneficiary_wallet_id String No Linked beneficiary wallet id
created_by_name String No Creator display name
cobo_wallet_id String No Cobo MPC wallet identifier
deployment_tx_hash String Yes On-chain deployment transaction hash

issuance_pauses

Field Type Required Description
scope String No Pause scope (global or chain)
paused Boolean Yes Issuance pause flag
updated_at DateTime Yes Last updated timestamp (UTC)

merchant_custody_aliases

Field Type Required Description
merchant_id String Yes Owning merchant identifier
chain String Yes Blockchain slug (e.g. bsc, ethereum, polygon, tron)
merchant_seed_alias String Yes Merchant custody seed alias
status String Yes Lifecycle status (active / inactive / domain-specific values)
created_at DateTime Yes Created timestamp (UTC)
updated_at DateTime Yes Last updated timestamp (UTC)

virtual_accounts

Field Type Required Description
va_id String No Virtual account identifier
merchant_id String Yes Owning merchant identifier
customer_id String Yes Merchant’s customer identifier
chain String Yes Blockchain slug (e.g. bsc, ethereum, polygon, tron)
network_type String Yes Network class (mainnet / testnet)
hot_wallet_id String Yes Linked hot wallet id
custody_address_id UUID Yes FK to custody address registry row
supported_assets String Yes Supported token symbols (e.g. USDT, USDC)
idempotency_key String No Client idempotency key for create
status String Yes Virtual account status (active / inactive)
active Boolean Yes Whether the record is active for operations
created_at DateTime Yes Created timestamp (UTC)
created_by_name String No Creator display name
deployment_tx_hash String Yes On-chain deployment transaction hash

Planned product entities (not in migrations through 012)

Entity Status
Payout Account (payout_accounts) Specified in MP/CRM Account FSD v2.3 / v1.2; no table in account-service migrations yet
Refund Account (refund_accounts) Same as Payout Account

7. API Routes

Method Route Description Request Response
GET /health Liveness {} {status, service, timestamp}
POST /api/v1/accounts/crypto/hot-wallets Create Hot Wallet {merchant_id, wallet_name, service_id, blockchain, network_type, beneficiary_address?, beneficiary_wallet_id?, supported_assets[]} {id, merchant_id, wallet_name, account_address, blockchain, network_type, beneficiary_address, beneficiary_wallet_id, beneficiary_status, service_id, supported_assets[], status, created_at, created_by_name, available_amount{}, total_amount{}, settled_amount{}, tx_hash}
GET /api/v1/accounts/crypto/hot-wallets List Hot Wallets {merchant_id?, blockchain?, network_type?, status?, page?, page_size?} (query) {items[], page, page_size, total}
GET /api/v1/accounts/crypto/hot-wallets/{hot_id} Get Hot Wallet {hot_id, merchant_id?} (path/query) {id, merchant_id, wallet_name, account_address, blockchain, network_type, beneficiary_*, service_id, supported_assets[], status, balances{}, tx_hash}
POST /api/v1/accounts/crypto/hot-wallets/{hot_id}/activate Activate Hot Wallet {hot_id, merchant_id?} {hot_id, status, account_address}
POST /api/v1/accounts/crypto/hot-wallets/{hot_id}/deactivate Deactivate Hot Wallet {hot_id, merchant_id?} {hot_id, status, account_address}
PUT /api/v1/accounts/crypto/hot-wallets/{hot_id}/beneficiary Set beneficiary link {beneficiary_address} {hot_id, blockchain, beneficiary_address, status, updated_at}
POST /api/v1/accounts/crypto/beneficiary-wallets Create Beneficiary Wallet {merchant_id, wallet_name, blockchain, network_type, creation_type, wallet_address} {id, wallet_id, merchant_id, wallet_name, wallet_address, blockchain, network_type, creation_type, status, created_by, created_by_name, created_at}
GET /api/v1/accounts/crypto/beneficiary-wallets List Beneficiary Wallets {merchant_id?, blockchain?, network_type?, status?, page?, page_size?} (query) {items[], page, page_size, total}
GET /api/v1/accounts/crypto/beneficiary-wallets/{wallet_id} Get Beneficiary Wallet {wallet_id, merchant_id?} {id, wallet_id, merchant_id, wallet_name, wallet_address, blockchain, network_type, creation_type, status, created_at}
POST /api/v1/accounts/crypto/beneficiary-wallets/{wallet_id}/activate Activate BW {wallet_id, merchant_id?} {wallet_id, status, wallet_address}
POST /api/v1/accounts/crypto/beneficiary-wallets/{wallet_id}/deactivate Deactivate BW {wallet_id, merchant_id?} {wallet_id, status, wallet_address}
POST /api/v1/accounts/crypto/virtual-accounts Create Virtual Account {merchant_id, customer_id, blockchain, network_type, hot_wallet_id, supported_assets[]} + header Idempotency-Key? {va_id, merchant_id, customer_id, account_address, blockchain, network_type, hot_wallet_id, ledger_account, supported_assets[], status, available_amount{}, total_amount{}, created_at, tx_hash}
GET /api/v1/accounts/crypto/virtual-accounts List Virtual Accounts {merchant_id?, customer_id?, blockchain?, network_type?, hot_wallet_id?, status?, page?, page_size?} (query) {items[], page, page_size, total}
GET /api/v1/accounts/crypto/virtual-accounts/{va_id} Get Virtual Account {va_id, merchant_id?} {va_id, merchant_id, customer_id, account_address, blockchain, network_type, hot_wallet_id, supported_assets[], status, balances{}, tx_hash}
POST /api/v1/accounts/crypto/virtual-accounts/{va_id}/activate Activate VA {va_id, merchant_id?} {va_id, status, active, account_address}
POST /api/v1/accounts/crypto/virtual-accounts/{va_id}/deactivate Deactivate VA {va_id, merchant_id?} {va_id, status, active, account_address}
GET /internal/v1/watched-addresses List watched addresses {chain?, cursor?, limit?} (query) {items[{chain, address, va_id, merchant_id, active}], next_cursor, has_more}
PUT /internal/v1/issuance-pause Set issuance pause {paused, chain?} {paused, chain?}
PUT /internal/v1/merchant-custody-aliases Upsert custody alias {merchant_id, chain, merchant_seed_alias} {merchant_id, chain, merchant_seed_alias, status}
POST /internal/v1/merchants/{merchant_id}/cobo-vault Create Cobo vault {merchant_id} {merchant_id, cobo_vault_id, …}
POST /internal/v1/virtual-accounts/{va_id}/deploy Deploy VA {va_id} {va_id, deploy_job_id, status, tx_hash?}

Payout / Refund Account routes are product-planned and not registered in account-service yet.

8. Audit Log Requirements

Action Audit Required Captured Fields
Create Hot Wallet Yes user, merchant, wallet name, network, supported assets, timestamp
Create Virtual Account Yes user, merchant, customer ID, hot wallet, network, timestamp
Create Beneficiary Wallet Yes user, merchant, creation type, network, timestamp
Create Payout / Refund Account Yes user, merchant, hot_wallet_id, cap, address hash/masked, timestamp
Cap request / approve / reject Yes maker, approver, old/new cap, wallet ID, timestamp
Start Web3Auth Yes user, merchant, session ID, network, timestamp
Complete Web3Auth Yes user, merchant, provider, wallet address hash/masked, timestamp
Activate / Deactivate Wallet Yes user, wallet ID, old status, new status, timestamp
Copy Wallet Address Optional — out of scope this phase user, wallet ID, wallet type, timestamp
Open Explorer Optional — out of scope this phase user, wallet ID, network, timestamp
Search / Filter Optional user, filters, timestamp
View Wallet Detail Optional user, wallet ID, timestamp

9. Error Handling

Scenario Expected Behavior
API fails to load list Show error message and retry option
No records found Show empty state: “No accounts found”
Invalid wallet address Show inline validation error
Duplicate wallet address Block submission
Network mismatch Block submission with clear message
Unsupported asset Block submission
Inactive linked wallet Block submission
Balance sync failed Show last cached balance and warning
Web3Auth start failed Show error and allow retry
Web3Auth callback failed Show error and do not create wallet
Status update failed Revert toggle state and show error
User lacks permission Show access denied message
Step-up 2FA failed / cancelled No create or status change; keep prior state
Creator attempts to approve own Beneficiary Block with clear message (maker-checker)
Merchant attempts Hot Wallet self-activate Forbidden; guide user to Request activation ticket
Approve Beneficiary without approve grant Access denied
Payout/Refund already exists for Hot Wallet Conflict; show existing account
Create PA/RA on Inactive Hot Wallet Block submission
Maker attempts to approve own PA/RA or cap Block with maker-checker message

10. Related documents

Artifact Path
Fund-flow OUT1 docs/RnD/CPG-FLOW-OUT1.docx
CRM FSD Account CPG-CRM_FSD_Account v1.2
Core FSD Account CPG-Core_FSD_Account
01_BR catalog docs/html/01_BR/data/CPG-BR-NFR-REQ_v1.xlsx (BR-MP-WLT-008…015)
Account RTM CPG-Account_RTM

E. ReferencesE. Tham chiếu