First contacts and buckets

Status: on Arctic.

A first contact opens a channel. It's the ML-KEM-768 ciphertext of the sender's first payment to an address, carried in the bundle with the index of the action it belongs to: 1,090 bytes. The recipient doesn't know the channel yet, so it can't derive the payment's tag. Buckets let it find the payment anyway.

Tags and buckets

Every encapsulation key ek has a whole first-contact tag: the first 16 bytes of BLAKE2b-256("Styx_FirstTag___", ek). An address names a bucket width k, from 0 to 128 bits, and its bucket is the first k bits of that tag. A first contact's tag is the bucket's k bits, followed by the rest of the channel's tag for payment 0, which only the channel's two ends know.

The recipient looks up its bucket: every first contact whose tag starts with its k bits. It tests each one it finds:

  1. decapsulate, and derive the channel's K;
  2. check that the tag agrees with the key's whole first-contact tag up to some bit, and with the channel's tag for payment 0 after it;
  3. open the memo as payment 0.

ML-KEM rejects implicitly: a ciphertext made for another key decapsulates to an unrelated secret, so its memo doesn't open.

Choosing the width

  • k = 128 files every first contact to the address under one tag. The recipient finds them with one lookup, but so can anyone who holds the address, who learns how many first contacts it got, and when.
  • k = 0 files every first contact on the chain in one bucket. Nobody can tell which are for the address, and the recipient tests all of them.
  • Widths in between trade one for the other.

The width decides only where the recipient looks. A wallet accepts a first contact filed at any width, so a wallet restored from its seed doesn't need to know the widths its addresses carried. Arctic's wallet uses k = 0 unless told otherwise (--bucket-bits).

Cost

A first contact adds 1,090 kept bytes to a payment. So opening a channel costs 20,000 zatoshis, where a payment on an open channel costs 10,000 (Fees and weight). A node's record of a first contact is 1,281 bytes: the ciphertext, and its action's memo record.