feat(connect): dl/2 deeplink payload without the copies its description already carries - #13
Closed
elasticLove1 wants to merge 2 commits into
Closed
feat(connect): dl/2 deeplink payload without the copies its description already carries#13elasticLove1 wants to merge 2 commits into
elasticLove1 wants to merge 2 commits into
Conversation
…on already carries The connect link is shown as a QR code on any desktop client, because the wallet is a phone application and a link is not actionable where it is printed. Its length therefore decides the symbol version, and the symbol has to fit a terminal window. `dl/1` sends `session_id` and `app_id` beside a `description` that already contains both -- and then refuses any payload whose fields disagree with that description, which is to say the description was already authoritative and the two fields were already a copy. On a real link that copy is 223 of 672 characters, three symbol versions. `dl/2` leaves them out. Nothing else moves: - `description` is built exactly as before, so the profile address derived from it is the one this session would have had under `dl/1`; - the decoder accepts both versions and fills the two fields in from the description when they are absent, so every consumer sees the same shape whichever version arrived; - `dl/1` emission is untouched and remains the default. `dl/2` is reached only through the new `create_shared_key_session_compact`. MUST NOT MERGE until the wallets decode `dl/2`. This crate's decoder accepts it from the moment this lands; the wallet does not, and a client that switched early would produce a link the wallet cannot read. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The 449-character link and version 15 were the figures for also trimming the description and dropping the zero padding inside app_id -- neither of which this change makes, because both move the string the profile address is derived from. Measured from this code: 672 -> 517 characters, version 18 -> version 16, 89 -> 81 modules. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #12 on the client side of it.
Что меняется
dl/1кладёт в приглашениеsession_idиapp_idрядом сdescription, который уже содержит ито и другое, а затем отказывает любому приглашению, чьи поля с этим описанием расходятся. То есть
описание и так было главным, а два поля — копией. На живой ссылке эта копия занимает 223 знака из
672, это две версии символа.
dl/2их не посылает. Больше не меняется ничего:descriptionстроится ровно как прежде, поэтому адрес профиля, который из него выводится, тотже самый, что был бы у этой сессии в
dl/1;потребитель видит одну и ту же структуру независимо от того, что пришло;
dl/1не тронут и остаётся умолчанием.dl/2доступен только через новыйcreate_shared_key_session_compact.Почему это того стоит
Ссылку показывают кодом: кошелёк — мобильное приложение, и на рабочей станции ссылку нажать
нечем, поэтому единственная пригодная форма приглашения — сканируемый символ. Его размер задаёт
длина ссылки.
dl/1dl/2Сторона −9,0%, площадь −17%. Длины замерены самим кодом (
payload_json383 → 267 байт,deep_link651 → 496 плюс 21 знак&intent=agent_onboard, который дописывает клиент), а версиясимвола взята из таблицы ёмкости формата и сходится с замером живого символа
dl/1: 89 модулей.Проверки
cargo test -p bee-connect --lib— 59 из 59, из них пять новых:dl/1по-прежнему возит обе копии и по-прежнему их сверяет;dl/2не возит ни одной, а декодер обе восстанавливает из описания;dl/2корочеdl/1не меньше чем на 100 знаков;пустой идентификатор сессии.
Вливать нельзя
Не вливать, пока кошельки не разбирают
dl/2. Декодер этого крейта принимает новую версиюсразу, кошелёк — нет, и клиент, переключившийся раньше, выдаст ссылку, которую кошелёк не
прочитает. Порядок такой: сначала поддержка в кошельке, потом переключение клиентов на
create_shared_key_session_compact.Отдельно, вне этого пиара: внутри
descriptionapp_idедет как0xплюс 64 знака при значении0x78— 60 ведущих нулей. Это ещё около 60 знаков, но их снятие меняет строку, из которойвыводится адрес профиля, то есть это уже миграция точки встречи, а не формата поля. Ещё крупнее
рычаг — кодировка без строчных букв: она пустила бы символ буквенно-цифровым режимом, вдвое более
плотным, но это меняет и формат, и разбор на обеих сторонах.