Skip to content

Commit abc7a3b

Browse files
Add documentation page for similarity verification (#46)
* Add documentation page for similarity verification * Fix wording in similarity verification documentation for clarity about recompilation
1 parent ed492e5 commit abc7a3b

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
id: similarity-verification
3+
title: Similarity verification
4+
slug: /similarity-verification
5+
---
6+
7+
# Similarity verification
8+
9+
Similarity verification allows verifying a contract by comparing its onchain bytecode with existing bytecodes in the Sourcify database. If similar candidates are found in the database, the existing compilation inputs and outputs for each candidate are used to verify the target contract until a match is found.
10+
11+
Sourcify supports similarity verification via the `/v2/verify/similarity` API endpoint, you can find more information in the [APIs documentation](/docs/api/).
12+
13+
## Use cases
14+
15+
- Block explorers can try to use similarity search if users visit a non-verified contract
16+
- A similarity search API call can be triggered after each contract creation event by listening a chain's events.
17+
18+
## Implementation details
19+
20+
Sourcify uses the first 75 bytes of the target runtime bytecode to search the bytecodes table for similar contracts. The process is inspired by [Blockscout's Ethereum Bytecode Database Microservice](https://docs.blockscout.com/devs/verification/ethereum-bytecode-database-microservice). The first 75 bytes are sufficient to identify a contract without interfering with immutables or other values that may differ between deployments of the same contract. After a list of candidates is returned, the target contract goes through the standard Sourcify verification flow for each candidate’s sources and settings.

0 commit comments

Comments
 (0)