tcn protocol tcn protocol the temporary contact numbers protocol, or tcn protocol, is an open source, decentralized, anonymous exposure alert protocol developed by covid watch in response to the covid-19 pandemic. the covid watch team, started as an independent research collaboration between stanford university and the university of waterloo was the first in the world to publish a white paper, develop, and open source fully anonymous bluetooth exposure alert technology in collaboration with coepi after writing a blog post on the topic in early march. temporary contact numbers protocoldeveloped bytcn coalition, incl. covid watch and coepiintroducedmarch 17, 2020 (2020-03-17)industryexposure notificationphysical range~10 m (33 ft) covid watch's tcn protocol received significant news coverage and was followed by similar decentralized protocols in early april 2020 like dp-3t, pact, and google/apple exposure notification framework. covid watch then helped other groups like the tcn coalition and mit safepaths implement the tcn protocol within their open source projects to further the development of decentralized technology and foster global interoperability of contact tracing and exposure alerting apps, a key aspect of achieving widespread adoption. covid watch volunteers and nonprofit staff also built a fully open source mobile app for sending anonymous exposure alerts first using the tcn protocol and later using the very similar google/apple exposure notification framework (enf). the protocol, like bluetrace and the google / apple contact tracing project, use bluetooth low energy to track and log encounters with other users. the major distinction between tcn and protocols like bluetrace is the fact the central reporting server never has access to contact logs nor is it responsible for processing and informing clients of contact. because contact logs are never transmitted to third parties, it has major privacy benefits over approaches like the one used in bluetrace. this approach however, by its very nature, does not allow for human-in-the-loop reporting, potentially leading to false positives if the reports are not verified by public health agencies.: p. 6 the tcn protocol received notoriety as one of the first widely released digital contact tracing protocols alongside bluetrace, the exposure notification framework, and the pan-european privacy-preserving proximity tracing (pepp-pt) project. it also stood out for its incorporation of blockchain technology, and its influence over the google/apple project. overview the tcn protocol works off the basis of temporary contact numbers (tcn), semi-random identifiers derived from a seed. when two clients encounter each other, a unique tcn is generated, exchanged, and then locally stored in a contact log. then, once a user tests positive for infection, a report is sent to a central server. each client on the network then collects the reports from the server and independently checks their local contact logs for a tcn contained in the report. if a matching tcn is found, then the user has come in close contact with an infected patient, and is warned by the client. since each device locally verifies contact logs, and thus contact logs are never transmitted to third parties, the central reporting server cannot by itself ascertain the identity or contact log of any client in the network. this is in contrast to competing protocols like bluetrace, where the central reporting server receives and processes client contact logs. temporary contact numbers the entire protocol is based on the principle of temporary contact numbers (tcn), a unique and anonymous 128-bit identifier generated deterministically from a seed value on a client device. tcns are used to identify people with which a user has come in contact, and the seed is used to compactly report infection to a central reporting server. tcn reports are authenticated to be genuine by a secret held only by the client. generation to generate a tcn, first a report authorization key (rak) and report verification key (rvk) are created as the signing and verification keys of a signature scheme (rak-rvk pair). in the reference implementation this pair is created using the ed25519 signature scheme.: line. 13 then, using the rak an initial temporary contact key (tck) is generated using the algorithm t c k 0 = h _ t c k ( r a k ) =h\_tck(rak)} , where h _ t c k ( ) is the sha-256 hash function as h _ t c k ( s ) = s h a 256 ( b'h _ tck' | | s ) \_||s)} . this tck is not used to generate any tcns, but is used in the next tck; where all future tcks are calculated using the algorithm t c k i = h _ t c k ( r v k | | t c k i − 1 ) =h\_tck(rvk||tck_)} . a 128 bit tcn is then generated from a given tck using the algorithm t c n i > 0 = h _ t c n ( l e _ u 16 ( i ) | | t c k i ) =h\_tcn(le\_u16(i)||tck_)} , where l e _ u 16 ( ) formats a supplied number as a little endian unsigned 2 byte integer, and h _ t c n ( ) is the sha-256 hash function as h _ t c n ( s ) = s h a 256 ( b'h _ tcn' | | s ) [ 0 : 128 ] \_||s)} . the following diagram demonstrates the key derivation process:tcns are unique to each device encounter, and rak-rvk pairs are cycled at regular intervals to allow a client to report only specific periods of contact. reporting when a client wishes to submit a report for the tcn indices s > 0 to e , it structures the report as r e p o r t = r v k | | t c k s − 1 | | l e _ u 16 ( s ) | | l e _ u 16 ( e ) | | m e m o ||le\_u16(s)||le\_u16(e)||memo} . a signature is then calculated using the rak, and it is transmitted to the server as s _ r e p o r t = r e p o r t | | s i g . because any given tck can only be used to derive an equal or higher indexed tcns, by submitting t c k s − 1 no encounters prior to t c n s − 1 can be calculated. however, there is no upper limit to encounters calculated using the same rak-rvk pair, which is why they are cycled often. to prevent clients calculating unused tcns, e indicates the last tcn index generated with the given rvk.: lines. 49–61 additionally, since the rvk is used to calculate a tck, and t c k s − 1 is provided, no valid tcns in the reporting period can be derived from an illegitimate report. the only correct tcn calculable from a mismatched rvk and t c k s − 1 is t c n s − 1 , the tcn before the start of the reporting period. once a report is received, clients individually recalculate tcks and tcns for a given period using the original algorithms: t c k s = h _ t c k ( r v k | | t c k s − 1 ) t c n s = h _ t c n ( l e _ u 16 ( s ) | | t c k s ) t c k s + 1 = h _ t c k ( r v k | | t c k s ) t c n s + 1 = h _ t c n ( l e _ u 16 ( s + 1 ) | | t c k s + 1 ) . . . t c k e = h _ t c k ( r v k | | t c k e − 1 ) t c n e = h _ t c n ( l e _ u 16 ( e ) | | t c k e ) tck_=h\_tck(rvk||tck_)\\tcn_=h\_tcn(le\_u16(s)||tck_)\\tck_=h\_tck(rvk||tck_)\\tcn_=h\_tcn(le\_u16(s+1)||tck_)\\...\\tck_=h\_tck(rvk||tck_)\\tcn_=h\_tcn(le\_u16(e)||tck_)\end this is used by client devices to check their local contact logs for potential encounters with the infected patient, but has the dual benefit of verifying reports since false reports will never produce matching tcns. memo in the report structure, the memo is a space for freeform messages that differ between tcn implementations. the section is between 2 and 257 bytes, and made up of a tag identifying the specific implementation, as well as a data and data length pair. it is formatted as m e m o = t a g | | l e n ( d a t a ) | | d a t a . the data is standardized for different tags, and can be as follows: tag data standard 0x0 coepi symptom report v1 0x1 covid watch test result v1 0x2 ito report v1 0x3-0xfe allocated for future official tcn apps or versions 0xff reserved (can be used to add more than 256 types later) technical specification the protocol can be divided into two responsibilities: an encounter between two devices running tcn apps, and the notification of potential infection to users that came in contact with a patient. for the purposes of this specification, these areas are named the encounter handshake, and infection reporting. the encounter handshake runs on bluetooth le and defines how two devices acknowledge each other's presence. the infection reporting is built on https and defines how infection notices are distributed among clients. encounter handshake when two devices come within range of each other, they exchange a handshake containing tcns. in order to achieve this the encounter handshake operates in two modes (both with two sub-modes), broadcast oriented and connection oriented. broadcast oriented operates using the modes broadcaster and observer, while connection oriented operates using peripheral and central. the two modes are used to circumvent certain device limitations, particularly in regard to ios restrictions in place before version 13.4. in both modes the protocol is identified with the 16 bit uuid 0xc019. in broadcast mode, a broadcaster advertises a 16-byte tcn using the service data field of the advertisement data. the observer reads the tcn from this field. in connection-oriented mode, the peripheral advertises using the uuid. the service exposes a read and writeable packet for sharing tcns. after sharing a tcn, the central disconnects from the peripheral. infection reporting when a user tests positive for infection, they upload a signed report, allowing the past 14 days of encounters to be calculated, to a central server. on a regular basis, client devices download reports from the server and check their local contact logs using the verification algorithm. if there is a matching record, the app notifies the user to potential infection. tcn coalition on 5 april 2020, the global tcn coalition was founded by covid watch and other groups that had coalesced around what was essentially the same approach and largely overlapping protocols, with the goal to reduce fragmentation, and enable global interoperability of tracing and alerting apps, a key aspect of achieving widespread adoption. the tcn coalition also helped establish the data rights for digital contact tracing and alerting framework, which functions as a bill of rights for users of such apps. currently the protocol is used by tcn coalition members coepi and covid watch, and was likely a source of inspiration for the similar google / apple contact tracing project.