Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coinspace/monerolib
Monero JavaScript library
https://github.com/coinspace/monerolib
js monero
Last synced: about 2 months ago
JSON representation
Monero JavaScript library
- Host: GitHub
- URL: https://github.com/coinspace/monerolib
- Owner: CoinSpace
- License: mit
- Created: 2021-03-01T20:03:17.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-21T10:26:33.000Z (over 1 year ago)
- Last Synced: 2024-10-14T04:21:11.012Z (3 months ago)
- Topics: js, monero
- Language: JavaScript
- Homepage:
- Size: 4.96 MB
- Stars: 7
- Watchers: 5
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# monerolib
[![Build](https://github.com/CoinSpace/monerolib/actions/workflows/ci.yml/badge.svg)](https://github.com/CoinSpace/monerolib/actions/workflows/ci.yml)
[![Downloads](https://img.shields.io/npm/dm/monerolib)](https://www.npmjs.com/package/monerolib)
[![Version](https://img.shields.io/npm/v/monerolib?label=version)](https://www.npmjs.com/package/monerolib)
[![License](https://img.shields.io/github/license/CoinSpace/monerolib?color=blue)](https://github.com/CoinSpace/monerolib/blob/master/LICENSE)Monero JavaScript library.
## Install
```
npm i monerolib
```## Common
* `p` - private/secret key, it is scalar
* `P` - public key, it is point
* `pV` - private/secret view key
* `PV` - public view key
* `pS` - private/secret spend key
* `PS` - public spend key
* `HS()` - convert hash to scalar `hashToScalar`
* `G` - is the base pointKey derivation `generateKeyDerivation` means:
```
derivation = P * p * 8
```## Subaddress
```
pSi = pS + HS(pV | i)
pVi = pV * pSi
``````
PSi = PS + HS(pV | i) * G
PVi = pV * PSiPSi = (pS + HS(pV | i)) * G
PVi = pV * (pS + HS(pV | i)) * G
```## Outputs
* `r` - is the transaction private/secret key
* `R` - is the transaction public key, `txPubKey`
* `X` - is the stealth address or one time address `targetKey`Fro address:
```
// Address (it is public key)
R = r * G// Subaddress (it is some public data)
R = r * PSi
```Sending:
```
// Address
X = Hs(r * PV | i)G + PS// Subaddress
X = Hs(r * PVi | i)G + PSi
```Receiving:
```
// Address
X = Hs(R * pV|i)G + PS// Subaddress
X = Hs(R * pV|i)G + PSi
```It is equal because:
```
// Address
R * pV = r * G * pV = r * PV// Subaddress
R * pV = r * PSi * pV = r * PVi
````r * PV` and `R * pV` is a key derivation
## Inputs
* `Hp()` - convert hash to point `hashToPoint` or more correctly `hashToEc`
* `x` - private/secret key of **stealth address** O_o
* `J` - is the key image `keyImage````
x = Hs(r * PV|i) + pS
x = Hs(R * pV|i) + pS
```Key image is:
```
J = x * Hp(X)
```