4b576a70ad
feat(pairing)!: add fallback flow to pairing This commit includes the following changes: *Breaking change in connection string* The local pairing code that was parsing the connection string had a few non-upgradable features: - It was strictly checking the number of parameters, throwing an error if the number was different. This made it impossible to add parameters to it without breaking. - It was strictly checking the version number. This made increasing the version number impossible as older client would just refuse to connect. The code has been changed so that: - Version is not used. Better not to use something than to use it wrongly, rarely version is needed if the protocol is correctly upgraded. - Two parameters have been added, `installation-id` and `key-uid`. Those are needed for the fallback flow. I have also removed version from the payload, since it wasn't used. This means that we don't support v1 anymore. V2 parsing should be supported (a new might be able to parse a v2 client, but not the other way around). It is to be considered a complete breaking change. 2.30 -> 2.30 syncing only is supported, but going forward there's a clear strategy on how to update the protocol (append parameters, don't change existing one). *Changed `MessengerResponse` to use internally a map of `installations` rather than an array (minor)* Just moving towards maps as arrays tend to lead to subtle bugs. *Moved pairing methods to messenger_pairing.go* Just moved some methods *Added 2 new methods for the fallback flow* `FinishPairingThroughSeedPhraseProcess` https://github.com/status-im/status-go/pull/5567/files#diff-1ad620b07fa3bd5fbc96c9f459d88829938a162bf1aaf41c61dea6e38b488d54R29 `EnableAndSyncInstallation` https://github.com/status-im/status-go/pull/5567/files#diff-1ad620b07fa3bd5fbc96c9f459d88829938a162bf1aaf41c61dea6e38b488d54R18 *Flow for clients* Client A1 is logged in Client A2 is logged out 1) Client A1 shows a QR code 2) Client A2 scans a QR code 3) If connection fails on A2, the user will be prompted to enter a seed phrase. 4) If the generated account matches the `key-uid` from the QR code, A2 should call `FinishPairingThroughSeedPhraseProcess` with the installation id passed in the QR code. This will send installation information over waku. The user should be shown its own installation id and prompted to check the other device. 5) Client A1 will receive new installation data through waku, if they are still on the qr code page, they should show a popup to the user showing the received installation id, and a way to `Enable and Sync`, which should call the `EnableAndSyncInstallation` endpoint. This should finish the fallback syncing flow. *Current issues* Currently I haven't tested that all the data is synced after finishing the flow. I see that the two devices are paired correctly, but for example the `DisplayName` is not changed on the receiving device. I haven't had time to look into it further. |
||
---|---|---|
.. | ||
anonmetrics | ||
audio | ||
common | ||
communities | ||
datasync | ||
discord | ||
encryption | ||
ens | ||
identity | ||
internal/sqlite | ||
migrations | ||
peersyncing | ||
protobuf | ||
pushnotificationclient | ||
pushnotificationserver | ||
requests | ||
sqlite | ||
storenodes | ||
subscription | ||
transport | ||
tt | ||
urls | ||
v1 | ||
verification | ||
wakusync | ||
zaputil | ||
LICENSE | ||
README.md | ||
activity_center.go | ||
activity_center_persistence.go | ||
activity_center_persistence_test.go | ||
chat.go | ||
chat_group_proxy.go | ||
chat_test.go | ||
communities_events_eventual_consistency_test.go | ||
communities_events_owner_without_community_key_test.go | ||
communities_events_token_master_test.go | ||
communities_events_utils_test.go | ||
communities_key_distributor.go | ||
communities_messenger_admin_test.go | ||
communities_messenger_helpers_test.go | ||
communities_messenger_shared_member_address_test.go | ||
communities_messenger_signers_test.go | ||
communities_messenger_test.go | ||
communities_messenger_token_permissions_test.go | ||
contact.go | ||
contact_test.go | ||
delete_message.go | ||
edit_message.go | ||
emoji_reaction.go | ||
errors.go | ||
group_chat_invitation.go | ||
group_chat_system_messages.go | ||
identity_images.go | ||
linkpreview_unfurler.go | ||
linkpreview_unfurler_image.go | ||
linkpreview_unfurler_oembed.go | ||
linkpreview_unfurler_opengraph.go | ||
linkpreview_unfurler_status.go | ||
local_notifications.go | ||
message_builder.go | ||
message_persistence.go | ||
message_validator.go | ||
message_validator_test.go | ||
messages_iterator.go | ||
messenger.go | ||
messenger_activity_center.go | ||
messenger_activity_center_test.go | ||
messenger_auto_message.go | ||
messenger_backup.go | ||
messenger_backup_handler.go | ||
messenger_backup_test.go | ||
messenger_base_test.go | ||
messenger_bookmarks.go | ||
messenger_bridge_message_test.go | ||
messenger_browsers.go | ||
messenger_browsers_test.go | ||
messenger_builder_test.go | ||
messenger_chat_context_test.go | ||
messenger_chats.go | ||
messenger_collapsed_community_categories.go | ||
messenger_collapsed_community_categories_test.go | ||
messenger_communities.go | ||
messenger_communities_import_discord.go | ||
messenger_communities_sharding_test.go | ||
messenger_community_for_mobile_testing.go | ||
messenger_community_for_mobile_testing_test.go | ||
messenger_community_metrics.go | ||
messenger_community_metrics_test.go | ||
messenger_community_shard.go | ||
messenger_community_storenodes.go | ||
messenger_config.go | ||
messenger_config_test.go | ||
messenger_contact_requests_test.go | ||
messenger_contact_update_test.go | ||
messenger_contact_verification.go | ||
messenger_contact_verification_test.go | ||
messenger_contacts.go | ||
messenger_contacts_test.go | ||
messenger_curated_communities.go | ||
messenger_delete_message_for_everyone_test.go | ||
messenger_delete_message_for_me_test.go | ||
messenger_delete_messages_test.go | ||
messenger_discv5.go | ||
messenger_edit_message_test.go | ||
messenger_emoji_reactions.go | ||
messenger_emoji_test.go | ||
messenger_ens.go | ||
messenger_group_chat.go | ||
messenger_group_chat_test.go | ||
messenger_handler.go | ||
messenger_handler_test.go | ||
messenger_handlers.go | ||
messenger_identity.go | ||
messenger_identity_display_name_test.go | ||
messenger_identity_image_test.go | ||
messenger_installations_test.go | ||
messenger_keycard.go | ||
messenger_linkpreview.go | ||
messenger_linkpreview_test.go | ||
messenger_mailserver.go | ||
messenger_mailserver_cycle.go | ||
messenger_mailserver_processMailserverBatch_test.go | ||
messenger_maps.go | ||
messenger_mention.go | ||
messenger_mention_test.go | ||
messenger_messages.go | ||
messenger_messages_order_controller_test.go | ||
messenger_messages_tracking_test.go | ||
messenger_mute_test.go | ||
messenger_offline_test.go | ||
messenger_pairing.go | ||
messenger_pairing_test.go | ||
messenger_peers.go | ||
messenger_peersyncing.go | ||
messenger_peersyncing_test.go | ||
messenger_pin_message_test.go | ||
messenger_pin_messages.go | ||
messenger_profile_showcase.go | ||
messenger_profile_showcase_proto_conversions.go | ||
messenger_profile_showcase_test.go | ||
messenger_raw_message_resend.go | ||
messenger_remove_message_test.go | ||
messenger_reply_test.go | ||
messenger_response.go | ||
messenger_response_test.go | ||
messenger_saved_address.go | ||
messenger_send_images_album_test.go | ||
messenger_settings.go | ||
messenger_settings_test.go | ||
messenger_share_image_test.go | ||
messenger_share_urls.go | ||
messenger_share_urls_test.go | ||
messenger_status_updates.go | ||
messenger_status_updates_test.go | ||
messenger_store_node_request_manager.go | ||
messenger_store_node_request_manager_config.go | ||
messenger_storenode_comunity_test.go | ||
messenger_storenode_request_test.go | ||
messenger_switcher_cards.go | ||
messenger_sync_activity_center_test.go | ||
messenger_sync_bookmark_test.go | ||
messenger_sync_chat_test.go | ||
messenger_sync_clear_history_test.go | ||
messenger_sync_contact_request_decision_test.go | ||
messenger_sync_customization_color_test.go | ||
messenger_sync_keycard_change_test.go | ||
messenger_sync_keycards_state_test.go | ||
messenger_sync_profile_picture_test.go | ||
messenger_sync_raw_messages.go | ||
messenger_sync_saved_addresses_test.go | ||
messenger_sync_settings.go | ||
messenger_sync_settings_test.go | ||
messenger_sync_verification_test.go | ||
messenger_sync_wallets_test.go | ||
messenger_test.go | ||
messenger_testing_utils.go | ||
messenger_unread_test.go | ||
messenger_validate_requests_test.go | ||
messenger_waku_wrapper_test.go | ||
messenger_wallet.go | ||
messenger_walletconnect.go | ||
messenger_walletconnect_test.go | ||
node_config_persistence_test.go | ||
persistence.go | ||
persistence_collapsed_community_categories.go | ||
persistence_metrics.go | ||
persistence_profile_showcase.go | ||
persistence_profile_showcase_test.go | ||
persistence_quoted_message_test.go | ||
persistence_test.go | ||
push_notification_test.go | ||
status_update.go | ||
switcher_card.go | ||
transaction_validator.go | ||
transaction_validator_test.go | ||
waku_builder_test.go |
README.md
status-go/protocol
This is an implementation of the secure transport and payloads which are a part of the Status Client specification.
This implementation uses SQLite and SQLCipher for persistent storage.
The payloads are encoded using protocol-buffers.
Content
messenger.go
is the main file which exportsMessenger
struct. This is a public API to interact with this implementation of the Status Chat Protocol.protobuf/
contains protobuf files implementing payloads described in the Payloads spec.encryption/
implements the Secure Transport spec.transport/
connects the Status Chat Protocol with a wire-protocol which in our case is either Whisper or Waku.datasync/
is an adapter for MVDS.applicationmetadata/
is an outer layer wrapping a payload with an app-specific metadata like a signature.identity/
implements details related to creating a three-word name and identicon.migrations/
contains implementation specific migrations for the sqlite database which is used byMessenger
as a persistent data store.
History
Originally this package was a dedicated repo called status-protocol-go
and was migrated into status-go
. The new status-go/protocol
package maintained its own dependencies until sub modules were removed and the root go.mod file managed all dependencies for the entire status-go
repo.