{"id":41386389,"url":"https://github.com/zsystm/gadget","last_synced_at":"2026-01-23T11:58:36.822Z","repository":{"id":223230170,"uuid":"759656312","full_name":"zsystm/gadget","owner":"zsystm","description":"A simple yet powerful CLI tool for various cryptographic and address-related tasks, especially handy in Tendermint(CometBFT) \u0026 Ethereum ecosystems.","archived":false,"fork":false,"pushed_at":"2025-12-22T17:14:17.000Z","size":48,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-24T06:11:27.624Z","etag":null,"topics":["cometbft","cosmos-sdk","cryptography","ed25519","ethereum","secp256k1"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zsystm.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-19T04:39:02.000Z","updated_at":"2025-12-22T17:14:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"a98dffe5-dd6d-403b-93ab-48b4171679f3","html_url":"https://github.com/zsystm/gadget","commit_stats":null,"previous_names":["zsystm/gadget"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/zsystm/gadget","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsystm%2Fgadget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsystm%2Fgadget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsystm%2Fgadget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsystm%2Fgadget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zsystm","download_url":"https://codeload.github.com/zsystm/gadget/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zsystm%2Fgadget/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28690611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T11:01:27.039Z","status":"ssl_error","status_checked_at":"2026-01-23T11:00:26.909Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cometbft","cosmos-sdk","cryptography","ed25519","ethereum","secp256k1"],"created_at":"2026-01-23T11:58:35.501Z","updated_at":"2026-01-23T11:58:36.810Z","avatar_url":"https://github.com/zsystm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gadget\n\u003e A simple yet powerful CLI tool for various cryptographic and address-related tasks, especially handy in Tendermint(CometBFT) \u0026 Ethereum ecosystems.\n\nGadget provides handy subcommands for working with base64/hex conversions, secp256k1/ed25519 keys, address formats (Bech32, Ethereum hex), and more.\n\n## Features\n- Base64 ↔ Hex: Easily convert between base64 and hexadecimal. \n- Ed25519 Key Tools:\n  - Extract Tendermint/CometBFT validator addresses from Ed25519 public keys.\n  - Generate public keys from Ed25519 private keys.\n- Secp256k1 Key Tools:\n  - Derive Ethereum accounts from private keys. \n  - Generate Tendermint-style validator (privval) keys. \n  - Convert private keys to public keys.\n- Address Conversions:\n  - Convert Bech32 to Ethereum hex, or vice versa. \n  - Change Bech32 prefixes.\n- Ethereum Utilities:\n  - Create new Ethereum accounts. \n  - Check balances via RPC.\n- Utility Tools:\n  - Convert between Unix timestamps and UTC date strings.\n\n## Install\n### Option 1) Go Install\n\n```bash\ngo install github.com/zsystm/gadget/cmd/gadget@latest\n```\n\n### Option2) Build from Source\n```bash\ngit clone https://github.com/zsystm/gadget.git\ncd gadget\nmake build\n```\n\n## Quick Examples\nThe following examples demonstrate how to use Gadget for various tasks.\n\u003cdetails\u003e \u003csummary\u003e\u003cstrong\u003e1) Get Validator Hex Address from Ed25519 Public Key\u003c/strong\u003e\u003c/summary\u003e\n\n```bash\n# 1. Check your validator's Ed25519 public key\ncometbft show-validator\n# Outputs something like:\n{\n  \"type\":\"tendermint/PubKeyEd25519\",\n  \"value\":\"xV2T7kMMXB94NOm22wIPrFyaFFGhiodEIliFAaGnODw=\"\n}\n# 2. Get the validator's hex address\ngadget ed25519 addr-from-pubkey xV2T7kMMXB94NOm22wIPrFyaFFGhiodEIliFAaGnODw=\n```\n\n**Result:**\n\n```bash\naddress: 9C1950C518E7F2188B054417A9B33CB41B5935B7\n```\n\n\u003c/details\u003e \u003cdetails\u003e \u003csummary\u003e\u003cstrong\u003e2) Generate Secp256k1 Privval Key\u003c/strong\u003e\u003c/summary\u003e\n\n```bash\n# Generate a Tendermint-style private validator key from a secp256k1 private key\ngadget secp256k1 privval 1afed3c4437316f73d28f69fd5e90ffc551a3862d08c34073e42f89d9dcc7149\n```\n\n**Result:**\n```json\n{\n  \"Key\": {\n    \"address\": \"870B2D7410FA447EBB61E03D41F01B746F413137\",\n    \"pub_key\": {\n      \"type\": \"tendermint/PubKeySecp256k1\",\n      \"value\": \"A1Sh0t3iqUEvMEfxBYaLCmRoDfqvNzIw0UjmkYBivSZC\"\n    },\n    \"priv_key\": {\n      \"type\": \"tendermint/PrivKeySecp256k1\",\n      \"value\": \"FkyINadFe6Dw5TKNHXly4lnxqXnQ63aSwxxfauROJ6M=\"\n    }\n  },\n  \"LastSignState\": {\n    \"height\": \"0\",\n    \"round\": 0,\n    \"step\": 0\n  }\n}\n```\n\n\u003c/details\u003e \u003cdetails\u003e \u003csummary\u003e\u003cstrong\u003e3) Get Account Info from Secp256k1 Private Key\u003c/strong\u003e\u003c/summary\u003e\n\n```bash\ngadget secp256k1 acc story 164c8835a7457ba0f0e5328d1d7972e259f1a979d0eb7692c31c5f6ae44e27a3\n```\n\n**Result:**\n```json\n{\n  \"ethAddr\": \"0x881319354734eb9366A26a4f3e640BA55F1a2e0c\",\n  \"accAddr\": \"story1su9j6aqslfz8awmpuq75ruqmw3h5zvfh7zkaax\",\n  \"valAddr\": \"storyvaloper1su9j6aqslfz8awmpuq75ruqmw3h5zvfhsdzukd\",\n  \"pubKey\": \"A1Sh0t3iqUEvMEfxBYaLCmRoDfqvNzIw0UjmkYBivSZC\"\n}\n```\n\n\u003c/details\u003e \u003cdetails\u003e \u003csummary\u003e\u003cstrong\u003e4) Convert Base64 to Hexadecimal\u003c/strong\u003e\u003c/summary\u003e\n\n```bash\ngadget b64-to-hex A1Sh0t3iqUEvMEfxBYaLCmRoDfqvNzIw0UjmkYBivSZC\n```\n\n**Result:**\n```bash\nhex: 0354a1d2dde2a9412f3047f105868b0a64680dfaaf373230d148e6918062bd2642\n```\n\n## Commands Overview\nThe following is a list of available commands in Gadget. Use `gadget help [command]` for detailed help on any command.\n- Base64 ↔ Hex \n  - `gadget b64-to-hex`: Convert a base64 string to hexadecimal \n  - `gadget hex-to-b64`: Convert a hexadecimal string to base64\n\n- Address Tools(`addr`)\n  - `gadget addr bech-to-eth`: Convert a Bech32 address to a 20-byte Ethereum hexadecimal address\n  - `gadget addr eth-to-bech`: Convert a 20-byte Ethereum hexadecimal address to Bech32 \n  - `gadget addr change-bech-prefix`: Convert a Bech32 address to another prefix\n- Ethereum Tools(`eth`)\n  - `gadget eth addr`: Get Ethereum address from a private key\n  - `gadget eth get-balance`: Get the balance of an Ethereum address using RPC\n  - `gadget eth new-acc`: Generate a random Ethereum account\n- Secp256k1 Tools(`secp256k1`)\n  - `gadget secp2565k1 acc`: (hex, 0x optional) secp256k1 private key → account info.\n  - `gadget secp256k1 privval`: (hex, 0x optional) secp256k1 private key → Tendermint/CometBFT privval key\n  - `gadget secp256k1 pub`: (hex, 0x optional) secp256k1 private key → public key\n- Ed25519 Tools (`ed25519`)\n  - `gadget ed25519 addr-from-pubkey`: Ed25519 public key → Tendermint/CometBFT validator hex address\n  - `gadget ed25519 pubkey-from-privkey`: Ed25519 private key → public key\n- Utility Tools (`util`)\n  - `gadget util timestamp`: Unix timestamp ↔ UTC date (`YYYY:MM:DD h:m:s`)\n\n## License\n\nThis project is licensed under GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzsystm%2Fgadget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzsystm%2Fgadget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzsystm%2Fgadget/lists"}