{"id":15744804,"url":"https://github.com/ryardley/ecdsa-ethereum-example","last_synced_at":"2025-03-31T05:44:25.308Z","repository":{"id":185789947,"uuid":"674109406","full_name":"ryardley/ecdsa-ethereum-example","owner":"ryardley","description":"An example of how ECDSA works in Ethereum","archived":false,"fork":false,"pushed_at":"2023-08-04T01:36:43.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T10:19:02.001Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryardley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-03T06:56:18.000Z","updated_at":"2023-08-03T06:58:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"1d16b7b2-c2f3-4b48-8ee0-47933ac736dd","html_url":"https://github.com/ryardley/ecdsa-ethereum-example","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"dec438a356c958e0de1f7d5d4201b4f2ea64fb46"},"previous_names":["ryardley/ecdsa-ethereum-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryardley%2Fecdsa-ethereum-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryardley%2Fecdsa-ethereum-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryardley%2Fecdsa-ethereum-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryardley%2Fecdsa-ethereum-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryardley","download_url":"https://codeload.github.com/ryardley/ecdsa-ethereum-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246423494,"owners_count":20774796,"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":"2024-10-04T04:01:09.136Z","updated_at":"2025-03-31T05:44:25.263Z","avatar_url":"https://github.com/ryardley.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ECDSA in Ethereum\n\nAn example of how ECDSA works in Ethereum in TypeScript\n\n```ts\nconst sk = toHexString(crypto.randomBytes(32));\nconst kp = await keypair(sk);\n\nconst msg = \"Hello World!\";\nconst msgh = hash(msg);\n\nconst { r, s, v } = ecsign(msgh, kp.privateKey);\nconst pk = ecrecover(msgh, v, r, s);\n\nassert(toHexString(kp.publicKey) == toHexString(pk)); // true\n```\n\n## References\n\n- https://github.com/MetaMask/eth-simple-keyring/blob/main/src/simple-keyring.ts\n- https://github.com/ethereum/js-ethereum-cryptography#readme\n- https://github.com/paulmillr/noble-curves","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryardley%2Fecdsa-ethereum-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryardley%2Fecdsa-ethereum-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryardley%2Fecdsa-ethereum-example/lists"}