Practical Analysis of Sending or Not-Sending Twin-Field Quantum Key Distribution with Frequency Side Channels

: The twin-ﬁeld quantum key distribution (TF-QKD) and its variants can overcome the fundamental rate-distance limit of QKD. However, their physical implementations with the side channels remain the subject of further research. We test the side channel of a type of external intensity modulation that applies a Mach–Zehnder-type electro-optical intensity modulator, which shows the distinguishability of the signal and decoy states in the frequency domain. Based on this security loophole, we propose a side-channel attack, named the passive frequency-shift attack, on the imperfect implementation of the sending or not-sending (SNS) TF-QKD protocol. We analyze the performance of the SNS protocol with the actively odd-parity pairing (AOPP) method under the side-channel attack by giving the formula of the upper bound of the real secret key rate and comparing it with the lower bound of the secret key rate under Alice and Bob’s estimation. The simulation results quantitatively show the effectiveness of the attack on the imperfect devices at a long distance. Our results emphasize the importance of practical security at the light source and might provide a valuable reference for device selection in the practical implementation of the SNS protocol.


Introduction
Quantum key distribution (QKD) promises to share the secret key bits with its security guaranteed by the laws of quantum physics [1][2][3]. Combined with the one-time pad, Alice and Bob can achieve unconditionally secure private communication. However, there are inevitable imperfections in the practical QKD systems which can be exploited by Eve and compromise the practical security. With the development of QKD, the proposal of the measurement-device-independent (MDI) QKD [4] and the decoy-state method [5][6][7] have greatly improved the practicality, performance, and practical security.
However, the secret key rate and distance are two implementation bottlenecks of pointto-point QKD. For example, the TGW bound [8] and PLOB bound [9] determine the repeaterless secret key capacity. To overcome this limit of repeaterless QKD, Lucamarini et al. [10] proposed the twin-field QKD (TF-QKD) protocol whose secret key rate scales with the square root of the channel transmittance by using the single-photon interference. However, the security is not completed as a security loophole is caused by the later announcement of the phase information [11]. Then, many variants of TF-QKD [11][12][13][14][15][16][17] have been proposed to deal with this security loophole and each has its own advantages. To accelerate the application of the TF-QKD protocols, many effects have been considered and analyzed, including the finite-key effects [18][19][20][21], the asymmetric effects [22][23][24], the discrete phase randomization [25,26], the optimization of the protocol [27][28][29], and the practical issues [30,31]. Meanwhile, several experiments of the TF-QKD have been carried out in the laboratory and field, demonstrating its ability to break the limit of repeaterless QKD [32][33][34][35][36][37][38][39].
However, the physical implementations of the TF-QKD protocols with the side channels remain to be further researched at present. Ideally, it is assumed that the sending devices are placed in a protected laboratory, and can prepare and encode quantum states correctly without information leakage. Unfortunately, these conditions may be not satisfied in the practical systems due to the imperfect devices [40][41][42][43] or Eve's disturbance [44][45][46][47][48][49][50]. In those QKD protocols with the practical light source, the decoy-state method is vital and used to monitor the channel eavesdropping [51] in which the security is based on the fact that Eve cannot distinguish between the signal and decoy states. However, the indistinguishability of the signal and decoy states may be violated due to the imperfections of the real apparatuses or Eve's disturbance. For instance, the probability distributions of the signal and decoy states do not overlap in the time domain completely with the pump-current modulation [42]. In the frequency domain, Eve could apply the wavelengthselected photon-number-splitting attack [52] or the frequency shift attack [53] actively to distinguish the signal and decoy states in the "plug-and-play" systems. However, the frequency shift attack needs to perform time shift on the signal pulses actively which is only applicable to the "plug-and-play" systems. In addition, it only analyzes the frequency shift in the ideal case. Therefore, to exploit the negative effects of the frequency side channels clearly, we consider the most general case of side channels caused only by the imperfect devices and test it experimentally. As the decoy-state method is used in the TF-QKD protocols, it is of significance to analyze its practical security in this aspect. More specifically, we concentrate on the sending or not-sending (SNS) TF-QKD protocol [11] with the actively odd-parity pairing (AOPP) method [29] and propose a side-channel attack, named the passive frequency-shift attack, which could take advantage of the most general side channels in the frequency domain.
The paper is arranged as follows. In Section 2, we recap the frequency shift of intensity modulators (IMs) and test experimentally the spectral distribution of the signal pulses with the external modulation method, which shows a side channel in the frequency domain. In Section 3, we propose the side-channel attack on imperfect implementation of the SNS protocol with AOPP that applies the imperfect IM. We analyze the adverse impact of the side channels by giving the formula of the upper bound of the secret key rate and comparing it with the lower bound of the secret key rate under Alice and Bob's estimation. In Section 4, we present our simulation results with the finite-key effects. Last, we give some discussion about the countermeasure of the side channels in Section 5 and conclude in Section 6.

Frequency Shift of Intensity Modulators
In this section, we will recap the frequency shift of the IMs and test experimentally to show a side channel in the frequency domain.
LiNbO 3 -based EOIMs work using the principle of interference, which is controlled by modulating the optical phase. The incoming light is coupled into a waveguide and then split into two paths of a Mach-Zehnder interferometer equally, which finally interfere at an output coupler. The two arms made of lithium-niobate will induce a phase change when the modulation voltages are applied. Accordingly, the intensity and phase of the output light will be modulated after interference depending on the applied modulation voltages.
Assuming voltages V 1 (t) and V 2 (t) are applied to the two arms separately with the input field of intensity E 0 and frequency ω 0 , the output field can be written as [52] where Here, γ = π/V π is the voltage-to-phase conversion coefficient for two arms, and ϕ 1 and ϕ 2 are the static phases which we will omit for simplicity. Here, V π is the half-wave voltage that is required to change the phase in one modulator arm by π radians. The output intensity is given by where Here, P 0 is the input optical power. The phase is maintained and the intensity is determined by Equation (2) on the condition that the two modulator arms are driven by the same amount, but in opposite directions (i.e., V 1 (t) = −V 2 (t)), which is known as the balanced driving or a push-pull operation. When V(t) is constant we will get pure intensity modulation without a frequency shift. However, once V(t) is not a constant anymore, something unexpected arises in the output field. For example, if V 1 (t) = −V 2 (t) = V 0 + kt, the output field can be expressed as [52] From Equation (3), we can see a frequency shift of the light pulses with ±ω m = ±γk compared with the original frequency ω 0 . The frequency shift of the output field becomes more confusing when the modulation voltages are more complicated. To analyze the spectrum of the output field, the fast Fourier transform method can be used.
To evaluate the frequency shift of different intensity pulses, we tested it experimentally. The 33-MHz optical pulses with 1 ns pulse width were produced by a CW laser, modulated by an IM, and measured by an optical-spectrum analyzer. The IM was driven by an arbitrary waveform generator with an electric signal amplified by an electric amplifier. The measurement was taken before the fixed attenuation where the photon number follows the same distribution with the emitting pulses at the single-photon level. Figure 1a illustrates the wavelength spectrum of three signal pulses, where the intensity ratio is taken from the SNS experiment [36] as 0.1: 0.384: 0.447 (µ a = 0.1, µ b = 0.384, µ z = 0.447), and the original continuous light. The normalized intensity probability distributions are shown in Figure 1b to distinguish the difference. In addition, Figure 2 shows the modulation voltages corresponding to these signal pulses.
Obviously, the states modulated by the IM with different intensities do not overlap completely in the frequency domain. The distinction will be more evident when increasing the repetition rate and narrowing the pulse width to increase the key distribution rate. Therefore, we tested it using the same method and obtained the normalized intensity distribution of 33-MHz optical pulses with 300 and 100 ps pulse widths, which is shown in Figure 3a,b, respectively.
From Figures 1b and 3a,b, we can see that the distinction of the signal states (also the strong-decoy states) and the weak-decoy states is evident. This is because the amplitude of the modulation voltages of the signal and strong-decoy states are higher, which will induce a greater frequency shift. Thus, the peaks of the signal and strong-decoy states are lower than that of the weak-decoy states. There are also slight differences between the signal and strong-decoy states. On this foundation, Eve could take advantage of this side channel to distinguish different states, which will threaten the decoy-state method.

Passive Frequency-Shift Attack on Imperfect Implementation of SNS
In this section, we propose a side-channel attack, named the passive frequency-shift attack, on the imperfect implementation of the SNS protocol with AOPP by exploiting the side channels in the frequency domain. The four-intensity decoy-state SNS protocol with AOPP is reviewed in the Appendix A.
In those TF-QKD protocols that need the post-phase compensation method, such as the SNS TF-QKD [11] and phase-matching (PM) TF-QKD [12], the signal and reference pulses should be produced with a stable CW laser source and modulated with the external modulation method to estimate and compensate for the phase noise. In the four-intensity decoy-state SNS TF-QKD protocol, Alice and Bob need to modulate the continuous light to five kinds of pulses with different intensities. The maximum-intensity pulses are used as the phase reference pulses, the minimums as the vacuum states, and others as the signal states, weak-and strong-decoy states. In the practical SNS systems [35,36], three IMs are used to modulate these five different pulses. The first IM modulates the continuous light to five pulses of different intensities and the second IM modulates the intensity to the designed ratio. The last IM only modulates the signal pulse width to a fixed width which can eliminate the side channels caused by the first two IMs. In this paper, we consider the simplified SNS systems where only one IM is applied to modulate the signal pulses. In this way, the side channels caused by the IM are exposed to Eve totally. We use this to verify the side channels of the IMs, prove their harmfulness, and present a reference for the device selection in the practical implementation.
Suppose Eve intercepts all of the signal pulses at Alice and Bob's output ports where the signal pulses have not been attenuated by the channels, and then distinguishes the signal and decoy states with a wavelength-division multiplexer (WDM) and three singlephoton detectors (SPDs), which is illustrated in Figure 4. To distinguish the states with intensity µ α , Eve sets internals T α with α ∈ {z, a, b}, according to the wavelength spectrum of different states. Suppose the four ports of WDM 1, 2, 3, and 4 can export photons with frequency located in T z , T a , T b , and others. The light-path selector S1 (S2) is controlled by SPD1 (SPD1 and SPD2). Denote it as 1 or 0 when the SPD (i.e., SPD1, SPD2, or SPD3) clicks or not, and 1 or 0 when the light-path selector (i.e., S1 or S2) selects the up or down path. We set Note that only one SPD at most will click under this principle. According to the response of the SPDs, set the total transmittance as η 1 , η 2 , η 3 or η v when SPD1, SPD2, SPD3, or none click, respectively. superconducting-nanowire single-photon detectors. The light-path selector S1 (S2) is controlled by SPD1 (SPD1 and SPD2), and Bob's device is the same as Alice's.
In this process, Eve can get partial raw-key bits after Alice (Bob) announces the signal and decoy windows. It can be understood in this way that Eve can conclude the key bit as 1 (0) for Alice (Bob) when SPD1 ∨ SPD2 ∨ SPD3 = 1 in a Z window. There is no bit-flip error between Alice (Bob) and Eve because Eve can intercept photons at output ports without stray photons. Only the raw bits can be used to distill the secret bits in Z windows when SPD1 ∨ SPD2 ∨ SPD3 = 0 on both sides. Once Eve detects photons successfully on one side, Eve's bit is either the same or a bit-flip error with the other side, which will be revealed in the error-correction step (and the pre-error correction step when the AOPP method is performed). However, the bits are balanced (i.e., random for Eve) in one-detector heralded events with SPD1 ∨ SPD2 ∨ SPD3 = 0, which means the raw bits are unknown to Eve in these windows. Although Eve cannot distinguish the decoy and signal states without errors, the decoy-state method may not estimate the lower bound of the secret key rate correctly when the transmittances of the signal and decoy states differ. When the actual secret key rate is lower than the estimated one, the final secret string is partially insecure.
We emphasize that this side-channel attack will not introduce unnecessary errors, as the beam splitting and measurement by Eve can be viewed as a loss without phase noise. What is more, Eve could control errors completely except the inherent errors of the protocol through channels, superconducting-nanowire single-photon detectors (SNSPDs), and classic information he announces. In the following, we will analyze the effect of this passive frequency-shift attack.
Consider the most general case, assume the envelope of the wavelength spectrum can be written as f i (λ), where i ∈ {z, a, b, v} and f v (λ) ≡ 0 for vacuum states. When the wavelength spectrum of the signal and decoy states do not overlap completely, Eve can distinguish these states with errors by setting the internals T α . The proportion of state µ i in internals T α can be shown as The states of intensity µ i would be transformed with one of four different transmittances η i,k (k ∈ {1, 2, 3, v}) when SPD k clicks (SPD v corresponds to no SPD click), where The total transmittance η i,k can be controlled by Eve completely, which means that Eve is allowed to use a lower-loss or even lossless channel and perfect detectors with 100% detection efficiency and no dark count. In addition, Eve could select the internals T α freely to obtain satisfactory results. For the states with intensity µ i , the probability of being transmitted with η i,k can be shown as where µ i|α = µ i r i|α . Here e −µ i|α is the probatility of zero photons in internal T α with intensity µ i .
Since the TF-QKD protocols are proposed for the implementation of long optical-fiber communications, Eve's best target is to acquire a higher percentage of the key bits as far as possible while maintaining the key rate and communication distance under Alice and Bob's estimation. When the communication distance is long enough, Eve may steal secret key bits.
There are two key rates that matter: the lower bound of the secret key rate under Alice and Bob's estimation R e and the upper bound of the actual secret key rate R u . In the QKD protocols, it is challenging to obtain the actual secret key rate with one communication step by sending N pulses. Fortunately, Alice and Bob can estimate the lower bound of the secret key rate. It is risky to exceed the lower bound because the security of those bits is uncertain, although the final key bits may still be secure. Note that Alice and Bob could not estimate R e correctly under this attack because it is impossible to pick out the decoy states that have undergone the same operation as the signal states, i.e., the decoy-state method does not work properly. The key rate R u , which is an upper bound of the actual secret key rate, is introduced to evaluate the effect of this attack. In the following, we analyze how to obtain the formula of R u .
When the attack is applied, the phase-randomized coherent states with µ z sent by Alice (Bob) will be transformed with one of four transmittances η z,k with probability p z,k . As Alice and Bob will announce their signal and decoy windows, the Z windows are known to Eve. Hence, Eve can obtain Alice's (Bob's) raw bits as 1 (0) when obtaining a detection event with three SPDs in Z windows. In other words, only the raw bits of Alice (Bob) that are caused by the pulses transmitted with η z,v are unknown to Eve. Considering the raw-bit strings of both parties at the same time, there will be four kinds of twin bits, given as {10, 1x, x0, xx} according to Eve's information on raw bits, where the first (second) bit indicates that Alice's (Bob's) bits are known to Eve as 1 (0) or unknown as x.
In the SNS protocol, Alice and Bob will perform the AOPP method on raw bits before error correction. When the AOPP method is performed with partial bits leaked to Eve, from Eve's perspective, Bob will only choose pairs 0x, x0 and, xx, and Alice's pairs can only be 11, 1x, x1, xx accordingly (12 scenarios in total). Note that these bit pairs are between Alice and Bob's own bit strings. Since Bob only chooses odd-parity bit pairs and will keep the second bits if Alice's bit pairs are odd too, Eve can infer that Alice's (Bob's) result bit (i.e., the second bit) is 1, 0, x (1, 0, 1, x), correspondingly. At this time, there will be nine kinds of twin bits {11 P , 10 P , 01 P , 00 P , 1x P , x1 P , 0x P , x0 P , xx P } according to Eve's information on raw bits, where the subscript P represents that the AOPP method is applied. Only the last twin bit xx P can be used to distill the secret-key bits because, for all other twin bits, at least one's bit is leaked and all will be revealed or discarded in the error-correction step. Finally, we note that the twin bits xx P can only be generated with two twin bits xx which correspond to states transmitted with η z,v .
In the decoy-state method [5][6][7], the secret key is only derived from the single-photon component, i.e., the untagged bits [55,56]. In the decoy-state SNS protocol [11,30], the untagged bits are defined during effective events, which are caused by the two-mode singlephoton states |01 or |10 in Z windows (see Appendix A for details). The secret twin bits xx P can only be generated with two untagged-twin bits when the AOPP method is applied. Therefore, the upper bound of the actual secret key rate can be shown as where n 0 1s and n 1 1s are the upper bound of the untagged bits when they make the opposite decision and obtain twin bits 0 and 1, respectively. Note that for the above simplified attack scheme, n 0 1s = n 1 1s = N p 2 where G(x) = e −x x is obtained without considering dark counts.
In addition, note that the above attack scheme is clumsy since Eve does not consider the relevance of the response of the SPDs at Alice and Bob's side. We modify the attack in the following.
There are 16 kinds of state pairs according to the intensities of Alice and Bob, which can be denoted as µ i µ j with i, j ∈ {z, a, b, v}, regardless of the type of windows. Similarly, there will be 16 scenarios about the response of the SPDs denoted as km at Alice and Bob's side, where k, m ∈ {1, 2, 3, v}. Therefore, when Alice and Bob select states with intensities µ i and µ j , the probability when SPDk and SPDm clicks can be shown as Given the loss due to Eve's interception, the total transmission for Alice and Bob can be shown as where η A km (η B km ) is the total transmission between Alice (Bob) and Charlie that Eve sets when SPDk and SPDm clicks at Alice and Bob's side, respectively.
Similarly, only the raw bits that are caused by those signal states transmitted with η zv,vv (η vz,vv ) are secured. At this time, Equation (8) is the upper bound of the actual secret key rate combined with This side-channel attack is a passive attack on the imperfect implementation of the SNS protocol that applies only an IM since the violation of the security assumption is caused by Alice and Bob themselves. The security of the SNS protocol is not dependent on the channels or detectors. This side-channel attack can be applied as long as the wavelengthspectrum distributions of the signal and decoy states are different. The effect of this attack varies based on the distinguishability of the different states.

Numerical Simulations
We numerically simulate the behavior of the SNS protocol with AOPP, which applies an imperfect IM, under the passive frequency-shift attack in this section.
In the actual systems, the key rate under Alice and Bob's estimation may be affected by the spectral distribution of signal pulses. Ideally, there will be an expected key rate without attack denoted as R ideal when eliminating the effects of the spectral distribution. Here, we ignore the effect of the spectral distribution for simplicity. We suppose that Eve's target is to acquire more key bits, i.e., lower the upper bound of the secret key rate while maintaining the key rate under Alice and Bob's estimation constant with the expected key rate. Therefore, Eve need to maximize R u while keeping R e equal to the expected key rate R ideal by optimizing the transmittances η A km and η B km , which can be expressed as When R u is lower than R e , it means the final key bits are partially insecure. And the secret key rate is reduced to 0 when R u = 0. For simulation purposes, the experimental parameters listed in Tables 1 and 2 are taken according to the SNS experiment [36]. The most important of the passive frequencyshift attack is the side channels in the frequency domain. To distinguish the states and obtain raw bits probabilistically, Eve will intercept pulses in three internals T z , T a and T b . According to our experimental results, the internals are marked in Figures 1b and 3a,b. And the parameters r i|α , the proportion if state with intensity µ i in internals T α , are listed in Table 3. Note that the side channels in Table 3 are independent with the experiment [36] which we have discussed at the beginning of Section 3. Table 1. List of the experimental parameters. Here, γ is the fiber loss coefficient (dB/km), η d is the detection efficiency of detectors, e d is the misalignment-error probability, f EC is the error-correction inefficiency, ξ is the failure probability of the statistical-fluctuations analysis, p d is the dark-count rate, M is the number of phase slices, and N is the number of pulses sent at one communication step.  Table 3. List of the parameter r i|α , which is the proportion of the state µ i in the internal T α . The left column indicates the numbers of the groups. The parameters are taken from Figures 1b and 3a Last, we simulate the expected secret key rate without attack R ideal , the key rate under Alice and Bob's estimation R e , and the upper bound of the secret key rate under the frequency-shift attack R u . There are nine parameters should be obtained by statistics in the practical systems, including n αβ (αβ ∈ S = {vv, va, av, vb, bv}), n R ∆ + , n L ∆ − , n t , and E z . Here, n t = n sig + n err is the length of the raw bits, and E z = n err /n t is the bit-flip error rate of the raw bits, where n sig and n err are the number of right and wrong raw bits, respectively. Under the passive frequency-shift attack, these parameters could be simulated as discussed in the Appendix B.
In Figure 5, the estimated key rate R e under the passive frequency-shift attack represented by the blue solid line is the same as the expected key rate, which means that Eve's action would not be detected by Alice and Bob. In comparison, the dashed lines represent the upper bounds of the secret key rates R ul (l ∈ {1, 2, 3}) under the frequency-shift attack with the parameters taken from Group l in Table 3. And the details of transmission η A km and η B km are shown in Appendix C. The effects of the side-channel attack can be analyzed by comparing R e and R ul . Specifically, the upper bounds R u1 , R u2 and R u3 are lower than R e at 230 km, 298 km, and 376 km, respectively. At this time, the final key bits are partially insecure which can be depicted with the upper bounds of the percentage of the secret key bits, defined as R rl = R ul /R e and shown in Figure 6. And the farther the distance, the smaller the proportion of secret key bits. R u1 , R u2 , and R u3 are reduced to zero at 412 km, 370 km, and 306 km, respectively, which means no secret-key bits can be distributed when exceeding this distance.

Discussion
It is widely known that the inevitable side channels are detrimental to the security of the practical QKD systems. For this reason, how can Eve exploit these side channels and how much the systems may be affected are worth researching. The side-channel attack proposed above on the imperfect implementation of the SNS protocol, which applies an imperfect IM, truly proves that even small side channels at the light source can compromise the secret key rate severely.
We note that there are two key points of the side-channel attack. The first and the most important is the imperfect IM is applied, which produces the decoy and signal states differently in the frequency domain, i.e., the frequency side channels. The second is the long-distance key distribution where the channel attenuation is large enough, which could be utilized by Eve to amplify the effects of the side channels. Since the long-distance key distribution is a primary goal of the SNS protocol, the above attack emphasizes the harmfulness of the side channels specifically and may provide a reference for the practical implementation.
To guarantee the security in the practical systems with the side channels, the first potential way is to improve the experimental techniques or modulation methods to restrain the side channels [57,58]. For example, three IMs can be used to modulate the signal pulses and reference pulses, where the last IM is used to eliminate the side-channels [35,36]. The second alternative is to develop the mathematical models in theory to include the side channels, such as the loss-tolerant method [59][60][61][62][63] with the characterization of the real apparatuses [64]. Finally, it would be a good choice to improve the protocol theoretically to resist the side-channel attack [65]. An ongoing search for the side channels may be needed to guarantee the practical security of QKD systems.

Conclusions
The goal of QKD at present is to provide long-distance and high-speed key distribution. Increasing the repetition rate and narrowing the pulse width may make the pulses complex and the parameters, such as the frequency, polarization, and temporal shape, more distinguishable. Any small imperfections may be exploited and enhanced by Eve utilizing the channel loss. Therefore, it is necessary to pay more attenuation to the practical implementations of the TF-QKD systems.
In this paper, we investigate and test the frequency side channels with the external modulation method. The imperfect IM will produce the signal and decoy states distinguishable in the frequency domain. Based on this, we propose a side-channel attack, named the passive frequency-shift attack, on the imperfect implementation of the SNS TF-QKD protocol that applies to the most general case of frequency side channels. Normally, when without the side channels, Alice and Bob could estimate the lower bound of the secret key rate correctly no matter what Eve does. However, this estimation is not accurate once Eve's operations on the signal and decoy states are different, which may cause insecure bits when the upper bound of the secret key rate is lower than the estimated lower bound. The numerical results quantitatively show the effectiveness of the attack at a long distance if Alice and Bob neglect this distinguishability.
Finally, we note that at present the side channel in the frequency domain can be restrained with more than one IM in the actual QKD systems [35,36]. We test with only one IM in this study just to prove the harmfulness of the side channels and emphasize the practical security of the light source specifically. Our results might provide a reference for the device selection in the practical implementation. The final goal is to build the hardened implementations of the practical QKD systems.

Conflicts of Interest:
The authors declare no conflict of interest.

Appendix A. SNS TF-QKD Protocol with AOPP
We make a review of the SNS protocol with AOPP and the key rate formula [11,19,29] in the following.
(1) Preparation and measurement. At any time window i, Alice (Bob) randomly determines whether it is a signal window or a decoy window with probabilities p z and p x = 1 − p z . If it is a signal window, Alice (Bob) sends a phase-randomized coherent state with intensity µ z and denotes it as 1 (0), or a vacuum state |0 and denotes it as 0 (1) with probabilities p z1 = 1 − p z0 and p z0 , seperately. If it is a decoy window, Alice (Bob) sends a phase-randomized coherent state | √ µ a e iθ A , | √ µ b e iθ A or |0 (| √ µ a e iθ B , | √ µ b e iθ B or |0 ) with probabilities p a , p b and p v = 1 − p a − p b , where µ a < µ b . The third party, Chrelie, renamed as Eve is supposed to perform the interferometic measurements on the incoming pulses and announce the results.
(2) Different types of time windows. Suppose Alice and Bob repeat the above process N times, then they announce their signal windows and decoy windows through the public channels. If both Alice and Bob determine a signal window, it is a Z window. The effective events in Z windows are defined as the one-detector heralded events no matter which detector clicks. Alice and Bob will get two raw n t -bit strings Z A and Z B according to the effective events in Z windows. Note that the phase-randomized coherent state of intensity µ is equivalent to a probabilistic mixture of different photon-number states ∑ ∞ k=0 e −µ µ k k! |k k|. Therefore, we can define the Z 1 windows as a subset of the Z windows when only one party determines to send and she (he) actually sends the single-photon state |1 . The bits from the effective Z 1 windows are regarded as the untagged bits by the tagged model [56]. Then, the intensity of pulses would be announced to each other expect the intensity in Z windows. If both commit to a decoy window, it is an X window. Alice and Bob also announce their phase information θ A , θ B when they choose the same intensity µ a in an X window denoted as an X a window. And if only one detector clicks in X a windows with phases satisfying it is an effective event. All effective events in X a windows can be divided into two subsets as C ∆ + and C ∆ − according Equations (A1) and (A2), respectively. And the number of the events in C ∆ + and C ∆ − can be defined as N ∆ + and N ∆ − . Here, ϕ AB is set properly to obtain a satisfactory key rate which will be different over time due to the phase drift. In the following, we will omit the phase drift without loss of generality and set ϕ AB = 0.
(3) Parameter estimation. They can estimate parameters, including the bit-flip error rate of the raw bits E Z , the lower bound of untagged bits n 1 (or the lower bound of the counting rate s 1 equivalently), and the upper bound of the phase-flip error rate of the untagged bits e ph 1 . The bit-flip error rate E Z can be obtained by error test, s 1 and e ph 1 can be estimated with the decoy-state method as follows.
Denote ρ v = |0 0|, ρ a = ∑ ∞ k=0 e −µ a µ k a /k!|k k| and ρ b = ∑ ∞ k=0 e −µ b µ k b /k!|k k|, where ρ a and ρ b are density operators of the phase-randomized coherent states used in X windows in which the phase is not announced. Let N αβ be the number of intsnces when Alice sends state ρ α and Bob sends state ρ β , and n αβ be the number of corresponding one-detector heralded events, where αβ ∈ S = {vv, va, av, vb, bv}. Thus, the counting rate can be defined as S αβ = n αβ /N αβ . And s 1 can be estimated with the decoy-state method as [30,66] Denote the bit-flip errors in C ∆ + (C ∆ − ) as the effective events when the right (left) detector clicks and its total number as n R ∆ + (n L ∆ − ). The bit-flip error rate in C ∆ = C ∆ + C ∆ − can be shown as Therefore e ph 1 can be estimated with the decoy-state method as [11,30] e ph 1 ≤ T ∆ − 1/2e −2µ a S vv 2µ a e −2µ a s 1 .
(A5) (4) Key rate formula. With these quantities, the final key length can be expressed as [11,67] R = 2p z0 (1 − p z0 )µ z e −µ z s 1 [1 − H(e ph 1 )] − n t f H(E Z )/N. (A6) where N f is the number of the final bits, H(x) = −xlog 2 x − (1 − x)log 2 (1 − x) is the binary entropy function, and f is the error correction efficiency factor. (5) AOPP method. AOPP method [19,29] is a pre-error correction process on the raw strings Z A and Z B , which can improve the direct transmission key rate. In the AOPP method, Bob randomly select two unequal bits as the pairs and will obtain n p = min(n t0 , n t1 ) pairs, where n t0 (n t1 ) is the number of the bits 0 (1) in the raw string Z B . There will be only two types of pairs that can survive when Alice makes exactly the same or opposite decision as Bob for two bits. Denote the correspond number as n vd or n cc , respectively. Therefore, the bit error after the AOPP is shown as The lower bound of the number of the untagged bits is n 1 = n p n 0 1 n t0 where n 0 1 and n 1 1 is the lower bound of the untagged bits when they make the opposite decision and obtain bits 0 and 1, correspondingly. The phase-flip error rate changes into e ph 1 = 2e ph 1 (1 − e ph 1 ). Besides, the finite-key effects should be considered in the practical systems using the Chernoff bound [68,69]. The parameters can be estimated as n 1 = ϕ L (n 1 ) and e ph 1 = ϕ U (n 1 e ph 1 )/n 1 . Finally, the improved key length can be shown as [19,29,67]  Similarly, we can obtain the parameters n va , n vb , and n bv . The number of the effective events when both Alice and Bob send the vacuum states is Above, p d is the dark count rate and p d = 1 − p d , µ A av,km = µ a η A av,km , µ B va,km = µ a η B va,km , µ A bv,km = µ b η A bv,km , and µ A vb,km = µ b η A vb,km . Note that the intensities of state |e iθ A µ a η A aa,km and |e iθ B µ a η B aa,km from Alice and Bob in X a windows may be different, but this does not mean it could not cause right detection. After the interference, the intensity of the left and right detectors will be µ l aa,km = where e d is the misalignment-error probability and e d = 1 − e d . Similarly, we can obtain the parameter n L ∆ − .

Appendix C. Details of Transmission
We show the total transmission η A km which are set to acquire R e and R ul in the following. And for Bob we set η B km = η A mk , symmetrically. Figure A1 corresponds to R u1 , Figure A2 corresponds to R u2 , and Figure A3 corresponds to R u3 . Among them the key parameter η A vv is shown by dashed lines.