Skip to content

User signing the transaction and the gas station signer cannot be the same. #97

@adriansanchezsequeira-iota

Description

Gas Station Transfer Issue Case

Problem Description

User signing the transaction and the gas station signer cannot be the same.

Invalid user signature: Expect 1 signer signatures but got 2

Root Cause Analysis

From the gas station logs, we can see that when the transfer back operation is executed:

  1. The transaction sender is the same address as the gas station sponsor
  2. Both the user and gas owner correspond to the same wallet address

This creates a special edge case where:

  • The user signing the transaction is the same as the gas sponsor
  • The gas station code adds both sponsor_sig and user_sig to the transaction
  • Both signatures are identical because they come from the same keypair
  • The IOTA validator rejects the transaction because it expects 1 signature but receives 2 identical signatures

Technical Details

In the gas station Rust code (gas_station_core.rs):

let tx = Transaction::from_generic_sig_data(tx_data, vec![sponsor_sig, user_sig]);

When sponsor_sig and user_sig are identical (same keypair), this creates a duplicate signature issue.

Test Scenario

The failing test sequence:

  1. Mint NFT with User A (works)
  2. Transfer NFT from User A to User B (works)
  3. Transfer NFT back from User B to User A (fails)

The issue occurs because:

  • User B corresponds to the same address as the gas station sponsor wallet
  • When User B tries to sign a transaction, it creates a duplicate signature situation

Current Status

  • All basic operations (mint, resolve, forward transfer) work correctly
  • The issue only affects scenarios where the user and gas sponsor are the same address

Recommended Solutions

  1. Gas Station Code Fix: The gas station should detect when the user and sponsor are the same and only add one signature

Impact

This is a specific edge case that occurs when the user wallet is the same as the gas station sponsor wallet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Product Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions