Skip to content

Add keccak256 hash algo to the SMT implementation with configurability#177

Merged
jimthematrix merged 5 commits intomainfrom
smt-keccak
Dec 10, 2025
Merged

Add keccak256 hash algo to the SMT implementation with configurability#177
jimthematrix merged 5 commits intomainfrom
smt-keccak

Conversation

@jimthematrix
Copy link
Contributor

See iden3/contracts#402 for details.

This is API breaking. It should be OK given we are pre-v1.0.

Signed-off-by: Jim Zhang <jim.zhang@kaleido.io>
Signed-off-by: Jim Zhang <jim.zhang@kaleido.io>
Signed-off-by: Jim Zhang <jim.zhang@kaleido.io>
Signed-off-by: Jim Zhang <jim.zhang@kaleido.io>
Signed-off-by: Jim Zhang <jim.zhang@kaleido.io>
Comment on lines +24 to +34
jsonObj := map[string]interface{}{
"proof": proofStruct,
}
proofJSONBytes, _ := json.Marshal(jsonObj)

// Create the ABI type with explicit components using shared function
proofType := createProofType()

// Use abi.Arguments to pack the data
arguments := abi.Arguments{abi.Argument{Type: proofType}}
proofBytes, err := arguments.Pack(proofStruct)
arguments := abi.ParameterArray{proofType}
proofBytes, err := arguments.EncodeABIDataJSON(proofJSONBytes)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are just swapping ABI libs here 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above was so that the go-ethereum dependencies only exist for the e2e tests.

Copy link
Contributor

@Chengxuan Chengxuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extending the interface to allow plug-able hasher looks good to me.

@jimthematrix jimthematrix merged commit bebfd19 into main Dec 10, 2025
6 of 7 checks passed
@jimthematrix jimthematrix deleted the smt-keccak branch December 10, 2025 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants