{"id":20152884,"url":"https://github.com/web3p/secp256k1","last_synced_at":"2025-04-09T21:32:57.112Z","repository":{"id":62547253,"uuid":"121364235","full_name":"web3p/secp256k1","owner":"web3p","description":"secp256k1","archived":false,"fork":false,"pushed_at":"2018-06-01T13:22:45.000Z","size":26,"stargazers_count":5,"open_issues_count":2,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T23:26:41.328Z","etag":null,"topics":["ethereum","secp256k1"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/web3p.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":"2018-02-13T09:40:08.000Z","updated_at":"2023-09-11T17:14:05.000Z","dependencies_parsed_at":"2022-11-02T22:02:24.124Z","dependency_job_id":null,"html_url":"https://github.com/web3p/secp256k1","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3p%2Fsecp256k1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3p%2Fsecp256k1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3p%2Fsecp256k1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3p%2Fsecp256k1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web3p","download_url":"https://codeload.github.com/web3p/secp256k1/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248114839,"owners_count":21050128,"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":["ethereum","secp256k1"],"created_at":"2024-11-13T23:15:11.849Z","updated_at":"2025-04-09T21:32:57.077Z","avatar_url":"https://github.com/web3p.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# secp256k1\nsecp256k1 for ethereum, this package depends on mdanter/ecc package.\n\n[![Build Status](https://travis-ci.org/web3p/secp256k1.svg?branch=master)](https://travis-ci.org/web3p/secp256k1)\n[![codecov](https://codecov.io/gh/web3p/secp256k1/branch/master/graph/badge.svg)](https://codecov.io/gh/web3p/secp256k1)\n[![Licensed under the MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/web3p/secp256k1/blob/master/LICENSE)\n\n# Install\n\nSet minimum stability to dev\n```\ncomposer require web3p/secp256k1\n```\n\n# Usage\n\nSign a message:\n```php\nuse Web3p\\Secp256k1\\Secp256k1;\nuse Web3p\\Secp256k1\\Serializer\\HexSignatureSerializer;\n\n$secp256k1 = new Secp256k1();\n\n// return signature contains r and s.\n// message and privateKey are hex string\n$signature = $secp256k1-\u003esign($message, $privateKey);\n\n// get r\n$r = $signature-\u003egetR();\n\n// get s\n$s = $signature-\u003egetS();\n\n// encode to hex\n$serializer = new HexSignatureSerializer();\n$signatureString = $serializer-\u003eserialize($signature);\n\n// or you can call toHex\n$signatureString = $signature-\u003etoHex();\n```\n\nVerify a message:\n```php\nuse Web3p\\Secp256k1\\Secp256k1;\n\n$secp256k1 = new Secp256k1();\n\n// signature was created from sign method.\n// hash and publicKey are hex string\n$isVerified = $secp256k1-\u003everify($hash, $signature, $publicKey);\n```\n\n# API\n\nTodo.\n\n# License\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3p%2Fsecp256k1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb3p%2Fsecp256k1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3p%2Fsecp256k1/lists"}