{"id":15023822,"url":"https://github.com/coinspace/monerolib","last_synced_at":"2025-10-27T16:16:19.030Z","repository":{"id":45243989,"uuid":"343541551","full_name":"CoinSpace/monerolib","owner":"CoinSpace","description":"Monero JavaScript library","archived":false,"fork":false,"pushed_at":"2023-06-21T10:26:33.000Z","size":5196,"stargazers_count":7,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-09T22:07:46.463Z","etag":null,"topics":["js","monero"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/CoinSpace.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}},"created_at":"2021-03-01T20:03:17.000Z","updated_at":"2024-12-20T10:26:58.000Z","dependencies_parsed_at":"2024-09-24T21:42:04.096Z","dependency_job_id":null,"html_url":"https://github.com/CoinSpace/monerolib","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoinSpace%2Fmonerolib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoinSpace%2Fmonerolib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoinSpace%2Fmonerolib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CoinSpace%2Fmonerolib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CoinSpace","download_url":"https://codeload.github.com/CoinSpace/monerolib/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248529846,"owners_count":21119580,"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":["js","monero"],"created_at":"2024-09-24T19:59:28.930Z","updated_at":"2025-10-27T16:16:18.937Z","avatar_url":"https://github.com/CoinSpace.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# monerolib\n\n[![Build](https://github.com/CoinSpace/monerolib/actions/workflows/ci.yml/badge.svg)](https://github.com/CoinSpace/monerolib/actions/workflows/ci.yml)\n[![Downloads](https://img.shields.io/npm/dm/monerolib)](https://www.npmjs.com/package/monerolib)\n[![Version](https://img.shields.io/npm/v/monerolib?label=version)](https://www.npmjs.com/package/monerolib)\n[![License](https://img.shields.io/github/license/CoinSpace/monerolib?color=blue)](https://github.com/CoinSpace/monerolib/blob/master/LICENSE)\n\nMonero JavaScript library.\n\n## Install\n```\nnpm i monerolib\n```\n\n## Common\n\n* `p` - private/secret key, it is scalar\n* `P` - public key, it is point\n* `pV` - private/secret view key\n* `PV` - public view key\n* `pS` - private/secret spend key\n* `PS` - public spend key\n* `HS()` - convert hash to scalar `hashToScalar`\n* `G` - is the base point\n\nKey derivation `generateKeyDerivation` means:\n\n```\nderivation = P * p * 8\n```\n\n## Subaddress\n\n```\npSi = pS + HS(pV | i)\npVi = pV * pSi\n```\n\n```\nPSi = PS + HS(pV | i) * G\nPVi = pV * PSi\n\nPSi = (pS + HS(pV | i)) * G\nPVi = pV * (pS + HS(pV | i)) * G\n```\n\n## Outputs\n\n* `r` - is the transaction private/secret key\n* `R` - is the transaction public key, `txPubKey`\n* `X` - is the stealth address or one time address `targetKey`\n\nFro address:\n```\n// Address (it is public key)\nR = r * G\n\n// Subaddress (it is some public data)\nR = r * PSi\n```\n\nSending:\n```\n// Address\nX = Hs(r * PV | i)G + PS\n\n// Subaddress\nX = Hs(r * PVi | i)G + PSi\n```\n\nReceiving:\n```\n// Address\nX = Hs(R * pV|i)G + PS\n\n// Subaddress\nX = Hs(R * pV|i)G + PSi\n```\n\nIt is equal because:\n```\n// Address\nR * pV = r * G * pV = r * PV \n\n// Subaddress\nR * pV = r * PSi * pV = r * PVi\n```\n\n`r * PV` and `R * pV` is a key derivation\n\n## Inputs\n\n* `Hp()` - convert hash to point `hashToPoint` or more correctly `hashToEc`\n* `x` - private/secret key of **stealth address** O_o\n* `J` - is the key image `keyImage`\n\n```\nx = Hs(r * PV|i) + pS\nx = Hs(R * pV|i) + pS\n```\n\nKey image is:\n```\nJ = x * Hp(X)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinspace%2Fmonerolib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoinspace%2Fmonerolib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoinspace%2Fmonerolib/lists"}