SeedPay
Reference

Message Types

Complete reference of all SeedPay extension message formats.

All SeedPay messages are sent over the BEP 10 extension channel using the "seedpay" extension ID negotiated during the handshake. Messages are JSON-encoded.

ECDH Key Exchange

ecdh_init

Sent by both peers during the ECDH key exchange.

{
  "type": "ecdh_init",
  "ephemeral_pk": "<32-byte-public-key-hex>"
}
FieldTypeDescription
typestringAlways "ecdh_init"
ephemeral_pkhex string32-byte Curve25519 public key

Payment Channel Lifecycle

channel_opened

Sent by the Leecher after the channel opening transaction is confirmed on-chain.

{
  "type": "channel_opened",
  "tx_signature": "<transaction_signature>",
  "channel_id": "<channel_identifier>",
  "amount": 0.01,
  "timestamp": 1702700000000
}
FieldTypeDescription
tx_signaturestringBlockchain transaction signature
channel_idstringChannel identifier (reference only)
amountnumberDeposited amount (UI/logging only, not trusted)
timestampnumberUnix milliseconds when notification was created

channel_confirmed

Sent by the Seeder after successful on-chain verification.

{
  "type": "channel_confirmed",
  "confirmed": true,
  "channel_id": "<channel_identifier>",
  "deposit": 0.01,
  "price_per_mb": 0.0001,
  "timeout": 1702703600000
}
FieldTypeDescription
confirmedbooleanAlways true
channel_idstringVerified channel identifier
depositnumberVerified deposit amount
price_per_mbnumberAgreed price per MB
timeoutnumberChannel timeout (Unix milliseconds)

channel_rejected

Sent by the Seeder when channel verification fails.

{
  "type": "channel_rejected",
  "confirmed": false,
  "reason": "session_mismatch"
}
FieldTypeDescription
confirmedbooleanAlways false
reasonstringOne of the rejection reasons below

Rejection reasons:

ReasonDescription
tx_not_foundTransaction not found on-chain
tx_failedTransaction failed or reverted
wrong_seederSeeder wallet doesn't match
insufficient_depositBelow min_prepayment
session_mismatchSession hash doesn't match ECDH-derived UUID
replayed_channelChannel ID already used
expiredChannel opening too old
invalid_channel_stateChannel not in Open state

channel_closed

Sent by the closing party after a channel is closed.

{
  "type": "channel_closed",
  "channel_id": "<channel_identifier>",
  "tx_signature": "<closing_transaction_signature>",
  "final_amount": 0.005,
  "reason": "cooperative"
}
FieldTypeDescription
channel_idstringChannel identifier
tx_signaturestringClosing transaction signature
final_amountnumberFinal settled amount
reasonstring"cooperative" or "timeout"

Payment Checks

payment_check

Sent by the Leecher during data transfer to authorize cumulative payment.

{
  "type": "payment_check",
  "channel_id": "<channel_identifier>",
  "amount": 0.005,
  "nonce": 1,
  "signature": "<base64_encoded_signature>"
}
FieldTypeDescription
channel_idstringChannel identifier
amountnumberCumulative amount authorized
nonceintegerMonotonically increasing sequence number
signaturestringBase64-encoded Ed25519 signature

payment_check_required

Sent by the Seeder when the Leecher's payment checks fall behind cumulative cost.

{
  "type": "payment_check_required",
  "required_amount": 0.005,
  "current_check_amount": 0.003,
  "estimated_remaining_mb": 20.0
}
FieldTypeDescription
required_amountnumberAmount needed to continue
current_check_amountnumberHighest check amount received
estimated_remaining_mbnumberEstimated remaining data in MB

payment_check_rejected

Sent by the Seeder when a payment check fails validation.

{
  "type": "payment_check_rejected",
  "channel_id": "<channel_identifier>",
  "reason": "stale_nonce",
  "expected_nonce": 5,
  "received_nonce": 3
}
FieldTypeDescription
channel_idstringChannel identifier
reasonstring"invalid_signature", "stale_nonce", "amount_exceeds_deposit", or "amount_not_increasing"
expected_nonceintegerExpected nonce value (if applicable)
received_nonceintegerReceived nonce value (if applicable)

Timeout Warning

channel_timeout_warning

Sent by the Seeder when the channel timeout approaches.

{
  "type": "channel_timeout_warning",
  "channel_id": "<channel_identifier>",
  "timeout_in_seconds": 3600,
  "recommended_action": "open_new_channel"
}
FieldTypeDescription
channel_idstringChannel identifier
timeout_in_secondsintegerSeconds remaining until timeout
recommended_actionstring"open_new_channel" or "extend_timeout"

On this page