Skip to content

Feature Request: Support RGB Asset Push in Channel Opening #67

@bitwalt

Description

@bitwalt

Summary

This issue to add support for pushing RGB assets when opening a channel, similar to how push_msat works for Bitcoin. This would allow the channel opener to immediately transfer some RGB asset amount to the counterparty upon channel establishment.

Problem Statement

Currently, when opening an RGB channel, all RGB assets remain with the channel opener initially. Users who want to acquire RGB assets must:

  1. Wait for channel confirmation
  2. Use the swap API to exchange assets

This creates unnecessary delays and complexity for users who want to buy assets directly during channel opening.

Requested Feature

Add a new field push_asset_amount to the OpenChannelRequest to enable immediate asset transfer to the counterparty during channel opening.

API Enhancement

#[derive(Deserialize, Serialize)]
pub(crate) struct OpenChannelRequest {
    // ... existing fields ...
    pub(crate) asset_amount: Option<u64>,
    pub(crate) asset_id: Option<String>,
    pub(crate) push_asset_amount: Option<u64>, // NEW FIELD
    // ... existing fields ...
}

Use Case

Direct Asset Purchase: Users can buy RGB assets directly when a channel is opened, eliminating the need to:

  • Wait for channel confirmations
  • Make separate swap API calls
  • Handle additional transaction complexity

Example Scenario

A user wants to acquire 250 units of an RGB asset. Instead of:

  1. Opening a channel with 1000 asset units
  2. Waiting for confirmation
  3. Using swap API to get 250 units

They can directly open a channel with asset_amount: 1000 and push_asset_amount: 250, immediately receiving 250 units while the opener retains 750 units.

Expected Behavior

  • push_asset_amount can only be used with RGB channels (when asset_id is specified)
  • push_asset_amount must not exceed asset_amount
  • Asset distribution: opener keeps asset_amount - push_asset_amount, counterparty receives push_asset_amount

Benefits

  • Simplified UX: Single operation instead of channel opening + swap
  • Faster asset acquisition: No waiting for confirmations before asset transfer
  • Reduced complexity: Eliminates need for separate swap transactions
  • Better onboarding: Service providers can instantly provide assets to new users

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions