# A Redactable Blockchain Scheme Supporting Quantum-Resistance and Trapdoor Updates
## 3 Hierarchical Identity-Based Chameleon Hash with Revocable Subkey
### Accountability and Traceability  
Redactable blockchain necessitate ongoing maintenance and security assessments. Hence, this subsection delineates the mechanisms employed to establish accountability and traceability within the blockchain, thereby fortifying the overall security of the system.  
In the design detailed in [27], edit operations are parallelized alongside modified blocks, giving rise to an edit chain. However, our approach can align with the pre-established structure and seamlessly integrate with the blockchain system.  
In Algorithm 4, we design a traceability scheme for the history of editing operations. In the redactable block structure, a redactable transaction contains a list of edited historical block number transactions (\(B_{e}Number\)) associated with it. From the list, we can trace all the actions to the redacted transaction.  
```
Input: The redacted transaction \(Tx_{i}\). Output: The edit history list \(EHL_{i}\). Extract \(B_{e}Number_{i}=\{BN_{1},\ldots,BN_{n}\}\) by \(Tx_{i}\). for\(i\)\(\
eq\)\((1,\ldots,n)\) do: Extract edit block \(B_{er_{i}}\) by \(BN_{i}\). \(EHL_{i}=\{B_{er_{i}}.MT_{1}.M^{\prime},\ldots,B_{er_{i}}.MT_{i}.M^{\prime}\}\) return \(EHL_{i}\)
```  
**Algorithm 4** Trace edit history.  
For accountability, we give details in Algorithms 5 and 6. In Algorithm 5, we mainly implement how to restrict or reclaim the editor's permission when there is an illegal edit request by adding malicious users to the revocation list.  
```
Input: Illegal edit request \(ER_{i}\) and revocation list \(RL\). Output: The revocation list \(RL^{\prime}\). Send \(ER_{i}\) to verifiers nodes Receive \(reply:=(reply_{1},\ldots reply_{n})\) if\(sum(reply_{i}=\"reject\")>n\) do: \(rID:=ER_{i}.MC.ID\) \(RL^{\prime}=\{RL,rID\}\)  Delete \(ER_{i}\) return \(RL^{\prime}\).
```  
**Algorithm 5** Accountability for edit request.  
Algorithm 6 implements how to roll back the edit operation. It is important to note that this rollback requires a member with higher privileges to perform and is strictly monitored because it removes the edits that have already been performed.  
```
Input: The redacted transaction \(\mathrm{Tx}_{i}\), the number of rollback times \(\mathrm{m}(\mathrm{m}\leq\mathrm{n})\), and identity ID. Output: The rollback block \(\mathrm{RB}^{\prime}\). Extract RB by \(\mathrm{Tx}_{i}\) Extract \(\mathrm{B}_{\mathrm{e}}\) by \(\mathrm{RB}.\mathrm{B}_{\mathrm{e}}\mathrm{Number}_{\mathrm{i}}.\mathrm{BN}_{ \mathrm{n-m}}\) \(\mathrm{RB}^{\prime}=\mathrm{RB};\mathrm{RB}^{\prime}.\mathrm{r}_{\mathrm{i}}^ {\prime}=\mathrm{B}_{\mathrm{e}}.\mathrm{MT}_{\mathrm{i}}.\mathrm{r}_{ \mathrm{i}}^{\prime}\) \(\mathrm{RB}^{\prime}.\mathrm{Tx}_{i}=\mathrm{B}_{\mathrm{e}}.\mathrm{MT}_{ \mathrm{i}}.\mathrm{M}^{\prime};\mathrm{B}_{\mathrm{e}}\mathrm{Number}_{\mathrm{i }}^{\prime}=\{\mathrm{BN}_{\mathrm{1}},\ldots,\mathrm{BN}_{\mathrm{n-m}}\}\) \(\mathrm{MT}_{\mathrm{i}}=\{\mathrm{r}^{\prime},\mathrm{MC}_{\mathrm{i}}=\{ \mathrm{Tx}_{\mathrm{i}},\mathrm{ID},\mathrm{h},\}\}\) for j=\((\mathrm{n-m}+1,\ldots,\mathrm{n})\) do: Extract \(\mathrm{B}_{\mathrm{e}}\) by \(\mathrm{BN}_{\mathrm{j}}\) \(\mathrm{Delete\ B}_{\mathrm{e}}.\mathrm{MT}_{\mathrm{i}}\) return \(\mathrm{RB}^{\prime}\)
```  
**Algorithm 6** Rollback the edit operation.  
Furthermore, our edit cache structure significantly curbs the likelihood of unauthorized edit operations. Recognizing that editing operations may be essential but sporadic within the blockchain ecosystem, preserving the history of such operations does not unduly strain the system. Quite the opposite: it bolsters the legitimacy and security of editing endeavors.  
By implementing these measures, our model ensures a robust framework for accountability, traceability, and secure edit operations, thereby enhancing the overall stability and credibility of the blockchain system.