{"id":24054627,"url":"https://github.com/cardinal-cryptography/peer-verifier","last_synced_at":"2025-09-15T16:31:38.526Z","repository":{"id":50464525,"uuid":"503129079","full_name":"Cardinal-Cryptography/peer-verifier","owner":"Cardinal-Cryptography","description":"A tool for verifying prospective Testnet validators","archived":false,"fork":false,"pushed_at":"2023-01-20T11:29:23.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2023-08-07T04:38:02.647Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cardinal-Cryptography.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-13T22:07:48.000Z","updated_at":"2023-06-25T06:59:43.000Z","dependencies_parsed_at":"2023-02-12T01:46:35.054Z","dependency_job_id":null,"html_url":"https://github.com/Cardinal-Cryptography/peer-verifier","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fpeer-verifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fpeer-verifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fpeer-verifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cardinal-Cryptography%2Fpeer-verifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cardinal-Cryptography","download_url":"https://codeload.github.com/Cardinal-Cryptography/peer-verifier/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233132525,"owners_count":18629753,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-09T03:49:05.256Z","updated_at":"2025-09-15T16:31:33.220Z","avatar_url":"https://github.com/Cardinal-Cryptography.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Peer Verification\nThis tool is intended to verify a potential candidate for testnet validator.\nPackage is split into two parts: `signer` and `verifier`.\n\n\nSigner part will be used by the candidate.\nWith this program candidate is going to sign a secret message provided by us to prove they own the p2p secret they claim to own.\n\n\nVerifier part will be used by Aleph Zero team.\nWith this program we are going to check whether supplied public key derives to supplied peer id, signature of secret message is correct and this peer is connected and up to date with our network.\n\n## Step one: signature generation by Validator candidate\nTo generate signature, candidate needs a generated p2p secret.\nFor whole process to work they also need to have a node set up with up to date block creation and public p2p port, so it can be discovered by other nodes as a peer.\nTo generate signature:\n```console\n$ signer --message \"secret message\" --p2p-secret-path \"some_path_to_p2p_secret/p2p_secret\"\nPeer id: 12D3KooWSKmHjpGhJuuR4tasDErtDVq4PQTzecbpDNeQQqyRfHEt\nPublic key: 08011220f542fa114217121d8d264e52da8c3b2a9363d963e8a37fff058046ddff004655\nSigned message: 2160edeec7c777f4e7fea1ddfa6040c7fa937db5d1d691878c0083c4e2e28e5d720c06006afec6a1eeb150c25f7ca7fca7567a3c07823f781065bb8b5a8eeb0f\n```\nOr, alternatively, using cargo, if for some reason the pre-built binary is unavailable:\n```console\n$ cargo run --bin signer -- --message \"secret message\" --p2p-secret-path \"some_path_to_p2p_secret/p2p_secret\"\nPeer id: 12D3KooWSKmHjpGhJuuR4tasDErtDVq4PQTzecbpDNeQQqyRfHEt\nPublic key: 08011220f542fa114217121d8d264e52da8c3b2a9363d963e8a37fff058046ddff004655\nSigned message: 2160edeec7c777f4e7fea1ddfa6040c7fa937db5d1d691878c0083c4e2e28e5d720c06006afec6a1eeb150c25f7ca7fca7567a3c07823f781065bb8b5a8eeb0f\n```\nAvailable arguments:\n*  `--p2p-secret-path` path to p2p secret that is used for signing.\n* `--message` secret message that candidate should sign. This argument is optional. If not provided signer will sign peer_id generated from p2p_secret.\n\nAfter generating signature candidate needs to send peer id, the generated public key and signature to Aleph Zero team.\nSo in this case one would send the following:\n```\n12D3KooWSKmHjpGhJuuR4tasDErtDVq4PQTzecbpDNeQQqyRfHEt\n\n08011220f542fa114217121d8d264e52da8c3b2a9363d963e8a37fff058046ddff004655\n\n2160edeec7c777f4e7fea1ddfa6040c7fa937db5d1d691878c0083c4e2e28e5d720c06006afec6a1eeb150c25f7ca7fca7567a3c07823f781065bb8b5a8eeb0f\n```\n\n## Step two: verification by Aleph Zero Team\nTo verify you need a node setup, that you can send unsafe rpc calls to.\nLet's say we have a running node with rpc socket on `http://127.0.0.1:9933`.\nThis node needs to be up to date with block creation.\nAlso for this process to work we need to have candidate in our peers, so to make sure we connected, we can add it to bootnodes of our node.\nNow we call `verifier` to verify peer and the signature:\n```console\n$ verifier --node \"http://127.0.0.1:9933\" --block-difference=10 --peer-id \"12D3KooWSKmHjpGhJuuR4tasDErtDVq4PQTzecbpDNeQQqyRfHEt\" --message \"secret message\" --public-key 08011220f542fa114217121d8d264e52da8c3b2a9363d963e8a37fff058046ddff004655 --signature 2160edeec7c777f4e7fea1ddfa6040c7fa937db5d1d691878c0083c4e2e28e5d720c06006afec6a1eeb150c25f7ca7fca7567a3c07823f781065bb8b5a8eeb0f\nSignature for peer 12D3KooWSKmHjpGhJuuR4tasDErtDVq4PQTzecbpDNeQQqyRfHEt is correct and peer is up to date with block creation at 1386065\n```\nOr, alternatively, using cargo, if for some reason the pre-built binary is unavailable:\n```console\n$ cargo run --bin verifier -- --node \"http://127.0.0.1:9933\" --block-difference=10 --peer-id \"12D3KooWSKmHjpGhJuuR4tasDErtDVq4PQTzecbpDNeQQqyRfHEt\" --message \"secret message\" --public-key 08011220f542fa114217121d8d264e52da8c3b2a9363d963e8a37fff058046ddff004655 --signature 2160edeec7c777f4e7fea1ddfa6040c7fa937db5d1d691878c0083c4e2e28e5d720c06006afec6a1eeb150c25f7ca7fca7567a3c07823f781065bb8b5a8eeb0f\nSignature for peer 12D3KooWSKmHjpGhJuuR4tasDErtDVq4PQTzecbpDNeQQqyRfHEt is correct and peer is up to date with block creation at 1386065\n```\n\nAvailable arguments:\n*  `--node` address of a node that we will send unsafe rpc calls to. By default set to `http://127.0.0.1:9933`\n* `--block-difference` max block difference with head of our node and head of candidate node. By default set to `10`\n* `--peer-id` peer id of node of candidate we want  to verify\n* `--message` secret message that candidate should sign (provided by us)\n* `--public-key` public p2p key of node of candidate, that should derive to peer id\n* `--signature` signature of secret message that is generated by signer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardinal-cryptography%2Fpeer-verifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcardinal-cryptography%2Fpeer-verifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcardinal-cryptography%2Fpeer-verifier/lists"}