## 2 Backgrounds and Related Works
### Shard by Sidechain and Dual Sidechain  
HMBS uses multiple sidechain (SC) and dual sidechain (dSC) pairs to transfer the cryptocurrency as in (12), create a smart contract as in (13), or execute an exiting smart contract as in (14) by spending UCs through multiple shards. In HMBS, we assume that one shard of HMBS consists of a sidechain and dual sidechain pair. Let \(\mathcal{S}_{\sigma}\) be the shard formed by the sidechain \(\mathbb{S}_{\sigma}\) and its dual sidechain \(\hat{\mathbb{S}}_{\sigma}\). In HMBS, each SC \(\mathbb{S}_{\sigma}\) consists of a series of _segments_, each segment is formed by _SC blocks_, and each SC block has transactions. We denote the \(n\)-th segment of SC \(\mathbb{S}_{\sigma}\) by \(\mathbb{S}_{\sigma}^{[n]}\), the \(j\)-th SC block of \(\mathbb{S}_{\sigma}^{[n]}\) by \(b_{\sigma}^{[n,\bar{j}]}\), and the \(k\)-th transaction of \(b_{\sigma}^{[n,\bar{j}]}\) by \(t_{k}^{[\sigma,n,\bar{j}]}\). Here, we note that \(t_{k}^{[\sigma,n,\bar{j}]}\) is the transaction that performs (12), (13), or (14). The proposed method uses a predetermined rule based on the block index \(n\) of \(B^{[n]}\) to select one SC, in which the old segment (being mined in the SC network) is terminated and a new segment is initiated. To explain this, let us assume that the block index \(n_{i}\) of the MC block \(B^{[n_{i}]}\), based on the predetermined rule, initiates the \(n\)-th segment \(\mathbb{S}_{\sigma}^{[n]}\) of \(\mathbb{S}_{\sigma}\). Let us also assume that \(B^{[n_{i+1}]}\) is the next MC block, which initiates the next segment \(\mathbb{S}_{\sigma}^{[n+1]}\) of \(\mathbb{S}_{\sigma}\). Let  
\[\mathbb{S}_{\sigma}^{[n]}=b_{\sigma}^{[n,0]},b_{\sigma}^{[n,1]},\ldots,b_{ \sigma}^{[n,k]} \tag{18}\]  
be the SC blocks mined in the \(\mathbb{S}_{\sigma}\) network during the time interval, which \(B^{[n_{i}]}\) to \(B^{[n_{i+1}]}\) are mined in the MC network. In HMBS, each SC \(\mathbb{S}_{\sigma}\) must have a dual dSC \(\hat{\mathbb{S}}_{\sigma}\). We will explain how these are related shortly. Just like \(\mathbb{S}_{\sigma}\), each dSC consists of a series of _segments_, and each segment consist of _dSC blocks_. We denote the \(n\)-th segment of dSC \(\hat{\mathbb{S}}_{\sigma}\) by \(\hat{\mathbb{S}}_{\sigma}^{[n]}\) and the \(j\)-th dSC block of \(\hat{\mathbb{S}}_{\sigma}^{[n]}\) by \(\hat{b}_{\sigma}^{[n,\bar{j}]}\). Let  
\[\hat{\mathbb{S}}_{\sigma}^{[n]}=\hat{b}_{\sigma}^{[n,0]},b_{\sigma}^{[n,1]}, \ldots,\hat{b}_{\sigma}^{[n,k]} \tag{19}\]  
be the dSC blocks mined in the \(\hat{\mathbb{S}}_{\sigma}\) network during the time interval that \(B^{[n_{i}]}\) to \(B^{[n_{i+1}]}\) are computed in the MC network. The block chaining in the SC segment has the same structure as MC; the mining of the SC block \(b_{\sigma}^{[n,\bar{i}]}\) in the SC segment \(\mathbb{S}_{\sigma}^{[n]}\) needs to find a nonce \(\tau\), which proves  
\[H(h_{\sigma}^{[n,l-1]}||i_{1}^{[\sigma,n,\bar{i}]}||\ldots||i_{c^{[\sigma,n, \bar{i}]}}^{[\sigma,n,\bar{i}]}||r)\in\mathcal{C}_{\mathbb{S}_{\sigma}}, \tag{20}\]  
where \(c^{[\sigma,n,\bar{i}]}\) is the number transactions to be included in \(b_{\sigma}^{[n,\bar{i}]}\), \(h_{\sigma}^{[n,\bar{i}-1]}\) is the hash value of the SC block \(b_{\sigma}^{[n,\bar{i}-1]}\), and \(\mathcal{C}_{\mathbb{S}_{\sigma}}\) represents the condition determined by the consensus algorithm of the SC \(\mathbb{S}_{\sigma}\). The hash value of the SC block \(b_{\sigma}^{[n,\bar{i}]}\) is defined by  
\[h_{\sigma}^{[n,\bar{i}]}=H(h_{\sigma}^{[n,\bar{i}-1]}||i_{1}^{[\sigma,n,\bar{i }]}||\ldots||i_{c^{[\sigma,n,\bar{i}]}}^{[\sigma,n,\bar{i}]}||r^{[\sigma,n, \bar{i}]}) \tag{21}\]  
with a nonce \(r^{[\sigma,n,\bar{i}]}\), which satisfies (20). The block chaining of dSC segment is almost identical to that of the SC segment. One difference is that the dSC block records only one special _smart contract_, which announces the state changes made by transactions in the preceding sidechain segment to HMBS, while the SC block records the multiple transactions. A detailed explanation will be given shortly.