Back to Spacedrive

Secure Device Pairing Protocol

.tasks/core/NET-002-device-pairing.md

0.4.3993 B
Original Source

Description

A secure protocol for pairing two devices will be implemented. The flow uses a human-readable BIP39 mnemonic code to establish a secure, end-to-end encrypted session, after which devices are mutually trusted.

Implementation Notes

  • The complete state machine and logic will be implemented in src/services/networking/protocols/pairing/.
  • The PairingProtocolHandler manages the initiator and joiner roles.
  • Cryptographic operations, including challenge-response using ed25519-dalek, are handled by pairing/security.rs.
  • Multi-process integration tests (device_pairing_test.rs, device_persistence_test.rs) validate the real-world functionality.

Acceptance Criteria

  • An initiator can generate a 12-word pairing code.
  • A joiner can use the code to discover and connect to the initiator.
  • Devices successfully exchange keys and establish a trusted relationship.
  • Paired device information is persisted securely for automatic reconnection.