| Internet-Draft | NCBP | December 2026 |
| Abdelazim | Expires 5 June 2027 | [Page] |
The Network ClipBoard Protocol (NCBP) enables real-time clipboard synchronization across devices on a shared local network. NCBP defines a client-server architecture where a central relay server accepts clipboard content from connected clients and broadcasts updates to all other authenticated peers. The protocol operates over TCP with mandatory TLS 1.3 encryption and Pre-Shared Key (PSK) authentication derived via PBKDF2-HMAC-SHA256. This document specifies the binary message format, connection lifecycle, keepalive mechanism, service discovery via mDNS/DNS-SD, targeted delivery, and security considerations for NCBP version 1.0.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 4 June 2027.¶
Copyright (c) 2026 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.¶
Modern workflows span multiple devices -- laptops, desktops, phones, and tablets. Copying text on one device and pasting it on another currently requires third-party cloud services, which introduce latency, privacy concerns, and internet dependency.¶
NCBP solves this by providing a lightweight, LAN-optimized protocol for clipboard synchronization that:¶
This specification (version 1.0) covers plain text clipboard content only. Future versions MAY extend the protocol to support images, rich text, files, and other MIME types via the content type registry defined in Appendix B.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
+----------+ +-------------+ +----------+
| Client A | -------> | NCBP Server | -------> | Client B |
| (copy) | CLIP | (relay) | CLIP_ | (paste) |
| | | | NOTIFY | |
+----------+ +-------------+ +----------+
|
+-----> +----------+
| | Client C |
+-----> | (paste) |
+----------+
The default port for NCBP is 31337/tcp. Implementations SHOULD allow configuration of an alternate port.¶
All NCBP connections MUST be encrypted using TLS 1.3 [RFC8446] or later. Implementations MUST NOT fall back to unencrypted TCP in production use.¶
The TLS layer MUST be established before any NCBP messages are exchanged. The NCBP handshake (HELLO/WELCOME) occurs within the encrypted TLS channel.¶
NCBP uses a Pre-Shared Key model for authentication:¶
The PSK derivation parameters:¶
salt = "NCBP-v1-salt" (12 bytes, ASCII) iterations = 100000 dklen = 32 bytes (256 bits) psk = PBKDF2-HMAC-SHA256(passphrase, salt, iterations, dklen)¶
All NCBP messages use a fixed-size binary header followed by a variable-length payload.¶
The header is 36 bytes:¶
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Magic (0x4E42) | Version | Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Flags | Message ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Payload Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Timestamp (64-bit) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | | | Device ID (128-bit) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+¶
| Field | Offset | Size | Description |
|---|---|---|---|
| Magic | 0 | 2 bytes | Protocol identifier: 0x4E42 ("NB" in ASCII) |
| Version | 2 | 1 byte | Protocol version (0x01 for NCBP/1.0) |
| Type | 3 | 1 byte | Message type (see Section 6) |
| Flags | 4 | 2 bytes | Bitfield flags (see Section 5.2) |
| Message ID | 6 | 2 bytes | Sequence number, wraps at 65535 |
| Payload Length | 8 | 4 bytes | Length of payload in bytes (big-endian) |
| Timestamp | 12 | 8 bytes | Unix epoch milliseconds (big-endian) |
| Device ID | 20 | 16 bytes | UUID of the sending device |
All multi-byte integer fields are in network byte order (big-endian).¶
0 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |A|R|E| Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+¶
| Bit | Name | Description |
|---|---|---|
| 0 | ACK_REQ | Sender requests acknowledgment |
| 1 | ACK_RSP | This message is an acknowledgment |
| 2 | ENCRYPT | Payload is additionally encrypted (reserved for future use) |
| 3-15 | Reserved | MUST be zero |
| Value | Name | Direction | Description |
|---|---|---|---|
| 0x01 | HELLO | Client -> Server | Authentication request |
| 0x02 | WELCOME | Server -> Client | Authentication accepted |
| 0x03 | CLIP | Client -> Server | Clipboard content update |
| 0x04 | CLIP_NOTIFY | Server -> Client | Broadcast clipboard to peers |
| 0x05 | PING | Bidirectional | Keepalive request |
| 0x06 | PONG | Bidirectional | Keepalive response |
| 0x07 | PEER_JOIN | Server -> Client | New peer connected notification |
| 0x08 | PEER_LEAVE | Server -> Client | Peer disconnected notification |
| 0x09 | ERROR | Server -> Client | Error notification |
| 0x0A | BYE | Bidirectional | Graceful disconnect |
| 0x0B | SECURE_SEND | Client -> Server | E2E encrypted direct message |
| 0x0C | SECURE_RECV | Server -> Client | Forwarded encrypted direct message |
| 0x0D | SECURE_ACK | Bidirectional | Delivery/read receipt for secure message |
Values 0x00 and 0x0E-0xFF are reserved for future use.¶
Sent by the client immediately after TLS handshake.¶
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | PSK Auth Hash (32 bytes) | | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Nonce (16 bytes) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Device Name Length | Device Name (UTF-8) ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+¶
| Field | Size | Description |
|---|---|---|
| PSK Auth Hash | 32 bytes | HMAC-SHA256(PSK, nonce) |
| Nonce | 16 bytes | Cryptographically random nonce |
| Device Name Length | 2 bytes | Length of device name in bytes |
| Device Name | Variable | UTF-8 encoded device name (max 255 bytes) |
Sent by the server upon successful authentication.¶
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Session ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Peer Count | Peer List ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+¶
Each peer entry in the peer list:¶
| Field | Size | Description |
|---|---|---|
| Device ID | 16 bytes | Peer's UUID |
| Device Name Length | 2 bytes | Length of device name |
| Device Name | Variable | UTF-8 device name |
Sent by a client when its clipboard content changes.¶
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Content Type | | +-+-+-+-+-+-+-+-+ | | Content Hash (32 bytes) | | ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Content Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Content (UTF-8) ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Target Count | Target Device IDs (16 bytes each) ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+¶
| Field | Size | Description |
|---|---|---|
| Content Type | 1 byte | 0x01 = text/plain (version 1.0 only) |
| Content Hash | 32 bytes | SHA-256 of the content bytes |
| Content Length | 4 bytes | Length of content in bytes |
| Content | Variable | The clipboard text (UTF-8 encoded) |
| Target Count | 1 byte | Number of target devices (0 = broadcast to all) |
| Target Device IDs | 16 bytes each | Device IDs of intended recipients |
When Target Count is 0 or the field is absent, the server broadcasts the clip to all connected peers except the sender. Clients that do not understand targeting stop reading after Content Length bytes and ignore trailing data, providing backward compatibility.¶
Server broadcasts to all peers except the sender (or targeted subset). The payload format is identical to CLIP (Section 7.3). The header's Device ID field contains the originating device's ID.¶
| Field | Size | Description |
|---|---|---|
| Ping Data | 8 bytes | Opaque data to be echoed in PONG |
| Field | Size | Description |
|---|---|---|
| Pong Data | 8 bytes | Echoed data from PING |
Broadcast when a new peer joins.¶
| Field | Size | Description |
|---|---|---|
| Device ID | 16 bytes | New peer's UUID |
| Device Name Length | 2 bytes | Length of device name |
| Device Name | Variable | UTF-8 device name |
Broadcast when a peer disconnects.¶
| Field | Size | Description |
|---|---|---|
| Device ID | 16 bytes | Departed peer's UUID |
| Field | Size | Description |
|---|---|---|
| Error Code | 2 bytes | Numeric error code |
| Message Length | 2 bytes | Length of error message |
| Error Message | Variable | UTF-8 error description |
No payload. The header alone signals graceful disconnect. After sending BYE, the sender MUST NOT send further messages and SHOULD close the connection after a reasonable timeout (5 seconds).¶
Sent by a client to deliver end-to-end encrypted content to a specific target peer. The server routes it to the target without being able to decrypt the payload.¶
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Target Device ID (16 bytes) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Flags | TTL (seconds) | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | | Ephemeral Public Key (32 bytes, X25519) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Nonce (12 bytes) | | +-+-+-+-+-+-+-+-+ +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | | Ciphertext Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Ciphertext (AES-256-GCM) ... | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Auth Tag (16 bytes) | | | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+¶
| Field | Size | Description |
|---|---|---|
| Target Device ID | 16 bytes | Recipient's UUID |
| Flags | 1 byte | Bit 0: BURN_AFTER_READ; Bit 1: REQUIRE_ACK; Bit 2: HIGH_SENSITIVITY |
| TTL | 4 bytes | Seconds until undelivered message expires (0 = never) |
| Ephemeral Public Key | 32 bytes | Sender's per-message X25519 public key |
| Nonce | 12 bytes | AES-256-GCM nonce (unique per message) |
| Ciphertext Length | 4 bytes | Length of encrypted content |
| Ciphertext | Variable | AES-256-GCM encrypted plaintext |
| Auth Tag | 16 bytes | GCM authentication tag |
Key derivation:¶
shared_secret = X25519(ephemeral_private, recipient_public_key)
encryption_key = HKDF-SHA256(
ikm = shared_secret,
salt = "NCBP-secret-send",
info = sender_device_id || target_device_id,
dklen = 32
)
¶
The server reads ONLY the Target Device ID. If the target is connected, the server wraps the payload unchanged into a SECURE_RECV and forwards it. If the target is not connected, the server queues the message until the TTL expires, then drops it. The server MUST NOT log, inspect, or modify the ciphertext.¶
The server forwards SECURE_SEND payloads to the target peer using this message type. The payload is identical to SECURE_SEND. The header's Device ID field contains the original sender's Device ID.¶
| Field | Size | Description |
|---|---|---|
| Original Sender Device ID | 16 bytes | Who sent the SECURE_SEND |
| Original Message ID | 2 bytes | Message ID of the SECURE_SEND |
| Status | 1 byte | 0x01=DELIVERED, 0x02=READ, 0x03=EXPIRED, 0x04=REJECTED |
+---------------+
| DISCONNECTED |
+-------+-------+
|
[TCP connect]
|
+-------v-------+
| CONNECTED |
+-------+-------+
|
[send HELLO]
|
+-------v-------+
| AUTHENTICATING|
+-------+-------+
/ \
[WELCOME] / \ [ERROR]
/ \
+-------v--+ +--v-----------+
| ACTIVE | | DISCONNECTED |
+-------+---+ +--------------+
|
[BYE / error / timeout]
|
+-------v-------+
| DISCONNECTED |
+---------------+
¶
+---------------+
| LISTENING |
+-------+-------+
|
[TCP accept]
|
+-------v-------+
| CONNECTED |
+-------+-------+
|
[recv HELLO]
|
+-------v-------+
| AUTHENTICATING|
+-------+-------+
/ \
[PSK OK] / \ [PSK FAIL]
/ \
+-------v--+ +--v--------+
| ACTIVE | | CLOSED |
+-------+---+ +----------+
|
[BYE / error / timeout]
|
+-------v-------+
| CLOSED |
+---------------+
¶
The server SHOULD send PING to each client every 30 seconds. Clients MUST respond to PING with PONG within 10 seconds. If no PONG is received within 10 seconds, the server SHOULD consider the client disconnected. Clients MAY also send PING to the server to verify connectivity.¶
| Parameter | Value | Description |
|---|---|---|
| PING Interval | 30 sec | Time between server PINGs |
| PONG Timeout | 10 sec | Max wait for PONG response |
| HELLO Timeout | 5 sec | Max wait for HELLO after connect |
| BYE Timeout | 5 sec | Max wait after BYE before close |
| Code | Name | Description |
|---|---|---|
| 0x0001 | AUTH_FAILED | PSK authentication failed |
| 0x0002 | VERSION_MISMATCH | Unsupported protocol version |
| 0x0003 | PAYLOAD_TOO_LARGE | Message exceeds maximum size |
| 0x0004 | INVALID_MESSAGE | Malformed or unexpected message |
| 0x0005 | SERVER_FULL | Server at maximum client capacity |
| 0x0006 | INTERNAL_ERROR | Server internal error |
NCBP servers SHOULD announce their presence using DNS-SD [RFC6763] over mDNS [RFC6762].¶
Service Type: _ncbp._tcp.local.¶
TXT Record Fields:¶
| Key | Description | Example |
|---|---|---|
| version | NCBP protocol version | "1" |
| name | Human-readable server name | "HomeNet" |
| psk | Whether PSK is required | "true" |
Example mDNS records:¶
_ncbp._tcp.local. SRV 0 0 31337 ncbp-server.local. _ncbp._tcp.local. TXT "version=1" "name=HomeNet" "psk=true" ncbp-server.local. A 192.168.1.100¶
NCBP assumes a local network environment with the following threats:¶
This document requests registration of the following port:¶
A new registry "NCBP Message Types" is requested with the initial values from Section 6. Values 0x00 and 0x0E-0xFF are reserved for future use. New assignments require Specification Required policy.¶
MAGIC = 0x4E42 VERSION = 0x01 HEADER_SIZE = 36 bytes MAX_PAYLOAD = 1,048,576 bytes (1 MiB) MAX_DEVICE_NAME = 255 bytes DEFAULT_PORT = 31337 PING_INTERVAL = 30 seconds PONG_TIMEOUT = 10 seconds HELLO_TIMEOUT = 5 seconds BYE_TIMEOUT = 5 seconds MAX_CLIENTS = 50 PSK_ITERATIONS = 100,000 PSK_SALT = "NCBP-v1-salt" PSK_DKLEN = 32 bytes¶
| Value | MIME Type | Status |
|---|---|---|
| 0x01 | text/plain | Required |
| 0x02 | image/png | Reserved |
| 0x03 | image/jpeg | Reserved |
| 0x04 | text/html | Reserved |
| 0x05 | text/uri-list | Reserved |
| 0x06-0xFE | - | Reserved |
| 0xFF | - | Custom/Extension |
Client A Server Client B | | | |--- [TLS Handshake] ---->| | |<-- [TLS Established] ---| | | | | |--- HELLO --------------->| | |<-- WELCOME --------------| | | | | | |<-- [TLS Handshake] ------| | |--- [TLS Established] --->| | | | | |<-- HELLO ----------------| |<-- PEER_JOIN ------------|--- WELCOME ------------->| | | | |--- CLIP ---------------->| | | |--- CLIP_NOTIFY --------->| | | | | |<-- CLIP -----------------| |<-- CLIP_NOTIFY ----------| | | | | |--- BYE ----------------->| | | |--- PEER_LEAVE ---------->| | | |¶
The author wishes to thank the contributors to the NCBP reference implementation for their testing and feedback. This document follows the guidance in [RFC7322].¶