{"id":18351197,"url":"https://github.com/storyicon/sigverify","last_synced_at":"2025-08-23T04:16:53.107Z","repository":{"id":45807572,"uuid":"514188114","full_name":"storyicon/sigverify","owner":"storyicon","description":"Signature verification of Ethereum. It supports standard elliptic curve, eip712, erc1271 and some hardware wallets such as ledger.","archived":false,"fork":false,"pushed_at":"2022-07-21T08:22:54.000Z","size":98,"stargazers_count":66,"open_issues_count":1,"forks_count":13,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-21T21:51:19.300Z","etag":null,"topics":["blockchain","ethereum","go","golang","signature","web3"],"latest_commit_sha":null,"homepage":"","language":"Go","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/storyicon.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-07-15T08:10:38.000Z","updated_at":"2024-10-24T04:19:05.000Z","dependencies_parsed_at":"2022-09-26T21:30:46.593Z","dependency_job_id":null,"html_url":"https://github.com/storyicon/sigverify","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storyicon%2Fsigverify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storyicon%2Fsigverify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storyicon%2Fsigverify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/storyicon%2Fsigverify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/storyicon","download_url":"https://codeload.github.com/storyicon/sigverify/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247470339,"owners_count":20944146,"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":["blockchain","ethereum","go","golang","signature","web3"],"created_at":"2024-11-05T21:29:51.180Z","updated_at":"2025-04-06T10:32:25.419Z","avatar_url":"https://github.com/storyicon.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SigVerify\n\n[![API Reference](\nhttps://camo.githubusercontent.com/915b7be44ada53c290eb157634330494ebe3e30a/68747470733a2f2f676f646f632e6f72672f6769746875622e636f6d2f676f6c616e672f6764646f3f7374617475732e737667\n)](https://pkg.go.dev/github.com/storyicon/sigverify?tab=doc)\n[![Go Report Card](https://goreportcard.com/badge/github.com/storyicon/sigverify)](https://goreportcard.com/report/github.com/storyicon/sigverify)\n\n![sigverify](./docs/images/logo.png)\n\nThis project is used to verify signatures under various specifications of ethereum. In addition to the standard elliptic curve signature, it also supports the signature of wallets such as ledger and argent.\n\nIt supports:\n1. Standard elliptic curve signature verification. (eth_sign).\n2. [EIP712](https://eips.ethereum.org/EIPS/eip-712) typed data verification. (eth_signTypedData_v*).\n3. [ERC1271](https://eips.ethereum.org/EIPS/eip-1271) Smart contract wallet signature verification (isValidSignature).\n4. Some hardware wallets signature verification such as `ledger`.\n\n## Examples\n\n### 1. Standard elliptic curve signature verification\n\n```cgo\npackage main\n\nimport (\n\t\"fmt\"\n\n\tethcommon \"github.com/ethereum/go-ethereum/common\"\n\t\"github.com/storyicon/sigverify\"\n)\n\nfunc main() {\n\tvalid, err := sigverify.VerifyEllipticCurveHexSignatureEx(\n\t\tethcommon.HexToAddress(\"0xb052C02346F80cF6ae4DF52c10FABD3e0aD24d81\"),\n\t\t[]byte(\"hello\"),\n\t\t\"0x0498c6564863c78e663848b963fde1ea1d860d5d882d2abdb707d1e9179ff80630a4a71705da534a562c08cb64a546c6132de26eb77a44f086832cbc1dbe01f71b\",\n\t)\n\tfmt.Println(valid, err) // true \u003cnil\u003e\n}\n```\n\n### 2. EIP-712 Typed data verification\n\n```cgo\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\n\tethcommon \"github.com/ethereum/go-ethereum/common\"\n\t\"github.com/ethereum/go-ethereum/signer/core/apitypes\"\n\t\"github.com/storyicon/sigverify\"\n)\n\nconst ExampleTypedData = `\n{\n    \"types\": {\n        \"EIP712Domain\": [\n            {\n                \"name\": \"name\",\n                \"type\": \"string\"\n            },\n            {\n                \"name\": \"chainId\",\n                \"type\": \"uint256\"\n            }\n        ],\n        \"RandomAmbireTypeStruct\": [\n            {\n                \"name\": \"identity\",\n                \"type\": \"address\"\n            },\n            {\n                \"name\": \"rewards\",\n                \"type\": \"uint256\"\n            }\n        ]\n    },\n    \"domain\": {\n        \"name\": \"Ambire Typed test message\",\n        \"chainId\": \"1\"\n    },\n    \"primaryType\": \"RandomAmbireTypeStruct\",\n    \"message\": {\n        \"identity\": \"0x0000000000000000000000000000000000000000\",\n        \"rewards\": 0\n    }\n}\n`\n\nfunc main() {\n\tvar typedData apitypes.TypedData\n\tif err := json.Unmarshal([]byte(ExampleTypedData), \u0026typedData); err != nil {\n\t\tpanic(err)\n\t}\n\tvalid, err := sigverify.VerifyTypedDataHexSignatureEx(\n\t\tethcommon.HexToAddress(\"0xaC39b311DCEb2A4b2f5d8461c1cdaF756F4F7Ae9\"),\n\t\ttypedData,\n\t\t\"0xee0d9f9e63fa7183bea2ca2e614cf539464a4c120c8dfc1d5ccc367f242a2c5939d7f59ec2ab413b8a9047de5de2f1e5e97da4eba2ef0d6a89136464f992dae11c\",\n\t)\n\tfmt.Println(valid, err) // true \u003cnil\u003e\n}\n```\n\n### 3. EIP1271 Smart contract wallet signature verification\n\n```cgo\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\tethcommon \"github.com/ethereum/go-ethereum/common\"\n\t\"github.com/ethereum/go-ethereum/ethclient\"\n\t\"github.com/storyicon/sigverify\"\n)\n\nfunc main() {\n\tclient, err := ethclient.Dial(\"https://polygon-rpc.com\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tvalid, err := sigverify.VerifyERC1271HexSignature(\n\t\tcontext.Background(),\n\t\tclient,\n\t\tethcommon.HexToAddress(\"0x4836A472ab1dd406ECb8D0F933A985541ee3921f\"),\n\t\t[]byte{120, 113, 119},\n\t\t\"0xc0f8db6019888d87a0afc1299e81ef45d3abce64f63072c8d7a6ef00f5f82c1522958ff110afa98b8c0d23b558376db1d2fbab4944e708f8bf6dc7b977ee07201b00\",\n\t)\n\tfmt.Println(valid, err) // true \u003cnil\u003e\n}\n```\n\n## Contribution\n\nThank you for considering to help out with the source code! Welcome contributions\nfrom anyone on the internet, and are grateful for even the smallest of fixes!\n\nIf you'd like to contribute to this project, please fork, fix, commit and send a pull request\nfor me to review and merge into the main code base.\n\nPlease make sure your contributions adhere to our coding guidelines:\n\n* Code must adhere to the official Go [formatting](https://golang.org/doc/effective_go.html#formatting)\n  guidelines (i.e. uses [gofmt](https://golang.org/cmd/gofmt/)).\n* Code must be documented adhering to the official Go [commentary](https://golang.org/doc/effective_go.html#commentary)\n  guidelines.\n* Pull requests need to be based on and opened against the `master` branch.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoryicon%2Fsigverify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstoryicon%2Fsigverify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstoryicon%2Fsigverify/lists"}