# Measurement-Device-Independent Two-Party Cryptography with Error Estimation
## 5 Applications for Two Party Cryptography
### Bit Commitment
#### 5.1.1 Definition and Protocol  
Informally, a standard bit commitment scheme consists of two sub-protocols called commitment protocol and revealing protocol. First, [PERSON] and [PERSON] execute the commitment protocol. [PERSON] has commit bit \(c\in\{0,1\}\) as input, and [PERSON] has no input. As a result of this protocol, [PERSON] will get some evidence about \(c\). In the second phase, [PERSON] and [PERSON] execute the revealing protocol, where [PERSON] has an input for remaining evidence and commit bit \(c\) and [PERSON] also has no input. At the end of this protocol, [PERSON] will output accept or reject according to [PERSON]'s inputs from the commitment protocol and revealing protocol. If both parties are honest, [PERSON] always accepts the bit \(c\). If [PERSON] is dishonest, however, [PERSON] should not output accept. If [PERSON] is dishonest, he should not be able to gain any information about \(c\) before the revealing protocol is executed. The definition of security in bit commitment protocol is as follows. **Definition 5** (Bit commitment [17]). : _An \(\varepsilon\)-secure bit commitment is a protocol between [PERSON] and [PERSON], where [PERSON] has input \(c\in\{0,1\}\), and [PERSON] has no input._  
1. _Correctness: If both parties are honest, then the ideal state_ \(\delta_{\text{c}ans}\) _is defined as:_ _The distribution of commit bit_ \(c\) _for [PERSON] is uniform when [PERSON] gets no information about distribution of_ \(c\) _besides the information leakage by this protocol, and [PERSON] accepts the commitment:_ \[\delta_{\text{c}ans}=\tau_{\{0,1\}}\otimes|\mathrm{accept}\rangle\langle \mathrm{accept}|.\]
2. _Security for [PERSON] (_\(\varepsilon\)_-hiding): If [PERSON] is honest, then for any joint state_ \(\rho_{cB^{\prime}}\) _created by the commit protocol, [PERSON] does not learn_ \(c\)_. Here,_ \[\rho_{cB^{\prime}}\approx_{\varepsilon}\tau_{\{0,1\}}\otimes\rho_{B^{\prime}},\] _and the entropy of_ \(c\)_:_ \[\mathrm{H}_{\min}(c|B^{\prime})\geq 1-\varepsilon.\]
3. _Security for [PERSON] (_\(\varepsilon\)_-Binding): If [PERSON] is honest, then there exists an ideal cq-state_ \(\delta_{cA^{\prime}V}\) _such that for all operations for_ \(\rho^{\prime}_{A^{\prime}}\)_, we have:_ \[\Pr[\mathrm{outputs}=\mathrm{accept}|A^{\prime}]\leq\varepsilon.\]We have rewritten the QBC agreement based on the contents of the ROT agreement as shown below. Bit commitment - commit phase: The input is commit bit \(c\in\{0,1\}\) for [PERSON]. The output are \(S_{c}\in\{0,1\}^{l}\) to [PERSON], and \(S_{0}^{\prime},S_{1}^{\prime}\in\{0,1\}^{l}\) to [PERSON]. 1. Preparation: [PERSON] chooses \(x^{n}\in_{R}\{0,1\}^{n}\) and \(\theta_{A}^{n}\in_{R}\{+,\times\}^{n}\) furthermore, [PERSON] chooses \(y^{n}\in_{R}\{0,1\}^{n}\) and \(\theta_{B}^{n}\in_{R}\{+,\times\}^{n}\). Both parties send the encoding quantum state \(|x\rangle_{\theta_{A}}^{n}\) or \(|y\rangle_{\theta_{B}}^{n}\) to the third party [PERSON];
2. Measurement: [PERSON] measures \(|x\rangle_{\theta_{A}}^{n}\) and \(|y\rangle_{\theta_{B}}^{n}\) with Bell basis, and announces the outcome;
3. Error estimation: [PERSON] chooses \(I_{check}\in_{R}2^{|n|}\) and \(|I_{check}|=m\), and sends \(I_{check}\) to [PERSON]. [PERSON] sends \(x_{check},\theta_{A_{check}}=\{x_{i},\theta_{A_{i}}|i\in I_{check}\}\) to [PERSON]. [PERSON] calculates the error rate \(Q_{u}\): \[Q_{u}=\frac{\text{num}(x_{i}\
eq y_{i}|\theta_{B_{i}}=\theta_{A_{i}})}{\text{ num}(\theta_{B_{i}}=\theta_{A_{i}})}.\] If \(Q_{u}>e_{r}\), they stop communication, else they continue. Here \(e_{r}\) is error correction upper bound;
4. Key division: Both parties discard the bits that used in error estimation. [PERSON] sends \(\theta_{B}^{n-m}\) to [PERSON]. [PERSON] divides the key according to \(\theta_{A}^{n-m},\theta_{B}^{n-m}\), where \(I_{c}=\{i|\theta_{A_{i}}=\theta_{B_{i}}\}\) and \(I_{1-c}=\{i|\theta_{A_{i}}\
eq\theta_{B_{i}}\}\), and sends \(I_{0},I_{1}\) to [PERSON];
5.