npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

xrpl-validator-domains

v0.1.0

Published

Decentralized domain verification for the XRP Ledger

Downloads

37

Readme

xrpl-validator-domains

Verify the domain names of XRP Ledger validators, in accordance with domain verification

Usage

To verify manifest signatures and domains, use the verifyValidatorDomain() method.

API

Node.js

Install using npm or yarn.

npm install xrpl-validator-domains --save
import { verifyValidatorDomain, verifyManifestSignature } from 'xrpl-validator-domains'

Browser

<script type="text/javascript" src="https://unpkg.com/[email protected]/build/xrpl-validator-domains-min.js"></script>
<script> const {verifyManifestSignature, verifyValidatorDomain} = window.verifyDomain </script>

verifyValidatorDomain(manifest)

Parse and verify a hex-string manifest. Various manifest formats are supported. The following examples show the supported manifest formats, as well as the structure of the returned object:

> await verifyValidatorDomain("240000007B7121EDA54C85F91219FD259134B6B126AD64AE7204B81DD4052510657E1A5697246AD27321032F7ACF6D67C42C9C898F576F92FE4638EB6C88D0DC7F6710AF00ED6BF50D97D676473045022100BE0B2E6071AED53C19A76BDC6EDE1A351C35343AA7CF917587F93C9D85C5A7B702207135F72654DC3AD70FE8A4DEB128965268A312DFB3E9A7C68BA8E9A8931F4285770F7261626269746B69636B2E636C7562701240C4FF2A6D277D24DEFB1C1EDF67285171EA02DC035FEF6216DEE41019CE41611AD4430AF59938DC505E538CCF669D521AC2A456C3805FE3CA85BB10B2A691B50B")
> {
  verified: true,
  message: 'rabbitkick.club has been verified',
  manifest: {
    Sequence: 123,
    Signature: '3045022100BE0B2E6071AED53C19A76BDC6EDE1A351C35343AA7CF917587F93C9D85C5A7B702207135F72654DC3AD70FE8A4DEB128965268A312DFB3E9A7C68BA8E9A8931F4285',
    MasterSignature: 'C4FF2A6D277D24DEFB1C1EDF67285171EA02DC035FEF6216DEE41019CE41611AD4430AF59938DC505E538CCF669D521AC2A456C3805FE3CA85BB10B2A691B50B',
    Domain: 'rabbitkick.club',
    PublicKey: 'nHUcNC5ni7XjVYfCMe38Rm3KQaq27jw7wJpcUYdo4miWwpNePRTw',
    SigningPubKey: 'n9Li9iXepgXECvTFq2hGoxqSttJy9rrC1NbZ75NXLZyKFekV5ZU1'
  }
}
> await verifyValidatorDomain({
    Sequence: 123,
    Signature: '3045022100BE0B2E6071AED53C19A76BDC6EDE1A351C35343AA7CF917587F93C9D85C5A7B702207135F72654DC3AD70FE8A4DEB128965268A312DFB3E9A7C68BA8E9A8931F4285',
    MasterSignature: 'C4FF2A6D277D24DEFB1C1EDF67285171EA02DC035FEF6216DEE41019CE41611AD4430AF59938DC505E538CCF669D521AC2A456C3805FE3CA85BB10B2A691B50B',
    Domain: 'rabbitkick.club',
    PublicKey: 'nHUcNC5ni7XjVYfCMe38Rm3KQaq27jw7wJpcUYdo4miWwpNePRTw',
    SigningPubKey: 'n9Li9iXepgXECvTFq2hGoxqSttJy9rrC1NbZ75NXLZyKFekV5ZU1'
  })
> {
  verified: true,
  message: 'rabbitkick.club has been verified',
  manifest: {
    Sequence: 123,
    Signature: '3045022100BE0B2E6071AED53C19A76BDC6EDE1A351C35343AA7CF917587F93C9D85C5A7B702207135F72654DC3AD70FE8A4DEB128965268A312DFB3E9A7C68BA8E9A8931F4285',
    MasterSignature: 'C4FF2A6D277D24DEFB1C1EDF67285171EA02DC035FEF6216DEE41019CE41611AD4430AF59938DC505E538CCF669D521AC2A456C3805FE3CA85BB10B2A691B50B',
    Domain: 'rabbitkick.club',
    PublicKey: 'nHUcNC5ni7XjVYfCMe38Rm3KQaq27jw7wJpcUYdo4miWwpNePRTw',
    SigningPubKey: 'n9Li9iXepgXECvTFq2hGoxqSttJy9rrC1NbZ75NXLZyKFekV5ZU1'
  }
}
> await verifyValidatorDomain({
    seq: 2,
    domain: "payid.mayurbhandary.com",
    master_key: "nHBd6ZRXfG353vtK1kwCahqbMk6BAqUz57rVy77Do5YTBG8LHkye",
    signing_key: "n9KqxB1nyphLfQnj8YBWtwt9ekhM58QQR3UWG3bRFKofSvBUDhXu",
    signature: "3045022100A887F4C261786803AD033839FB52272E1123A57DFF48C07C06616D2028A4CC0502203F3325B1635864EBBFE44991910D66836F66FC00E14E965AB0F5352AD97816FF",
    master_signature: "1234567890ABCDEF",
    type: "manifestReceived"
})
> {
  verified: false,
  message: 'Cannot verify manifest signature',
  manifest: {
    seq: 2,
    domain: 'payid.mayurbhandary.com',
    master_key: 'nHBd6ZRXfG353vtK1kwCahqbMk6BAqUz57rVy77Do5YTBG8LHkye',
    signing_key: 'n9KqxB1nyphLfQnj8YBWtwt9ekhM58QQR3UWG3bRFKofSvBUDhXu',
    signature: '3045022100A887F4C261786803AD033839FB52272E1123A57DFF48C07C06616D2028A4CC0502203F3325B1635864EBBFE44991910D66836F66FC00E14E965AB0F5352AD97816FF',
    master_signature: '1234567890ABCDEF'
  }
}

verifyManifestSignature(manifest): bool

Verify a manifest signature. Various manifest formats are supported. The following examples show the supported manifest formats:

> await verifyManifestSignature("240000007B7121EDA54C85F91219FD259134B6B126AD64AE7204B81DD4052510657E1A5697246AD27321032F7ACF6D67C42C9C898F576F92FE4638EB6C88D0DC7F6710AF00ED6BF50D97D676473045022100BE0B2E6071AED53C19A76BDC6EDE1A351C35343AA7CF917587F93C9D85C5A7B702207135F72654DC3AD70FE8A4DEB128965268A312DFB3E9A7C68BA8E9A8931F4285770F7261626269746B69636B2E636C7562701240C4FF2A6D277D24DEFB1C1EDF67285171EA02DC035FEF6216DEE41019CE41611AD4430AF59938DC505E538CCF669D521AC2A456C3805FE3CA85BB10B2A691B50B")
> true
> await verifyManifestSignature({
  Sequence: 123,
  Signature: '3045022100BE0B2E6071AED53C19A76BDC6EDE1A351C35343AA7CF917587F93C9D85C5A7B702207135F72654DC3AD70FE8A4DEB128965268A312DFB3E9A7C68BA8E9A8931F4285',
  MasterSignature: 'C4FF2A6D277D24DEFB1C1EDF67285171EA02DC035FEF6216DEE41019CE41611AD4430AF59938DC505E538CCF669D521AC2A456C3805FE3CA85BB10B2A691B50B',
  Domain: 'rabbitkick.club',
  PublicKey: 'nHUcNC5ni7XjVYfCMe38Rm3KQaq27jw7wJpcUYdo4miWwpNePRTw',
  SigningPubKey: 'n9Li9iXepgXECvTFq2hGoxqSttJy9rrC1NbZ75NXLZyKFekV5ZU1'
})
> true
> await verifyManifestSignature({
  master_key: "nHBQ3CT3EWYZ4uzbnL3k6TRf9bBPhWRFVcK1F5NjtwCBksMEt5yy",
  master_signature: "0B7C84A7F192A3CC781393876C76863AE401AEE57937A706D7FD0F1BA1C2582C07D37FC714DFA73310923518A188B25E45D9CA1D4D56C34B0CA52639D5992C03",
  seq: 2,
  signature: "3045022100A4622D77AF27AD6E92166D8A4BC2B8A80646757C1F4F1E33F3C4BC9344765D38022062FC193AF1555E7D1D46B6023861ECD1415B319C488DFCB99648D99060A41120",
  signing_key: "n9K7fyu8uvmCoWvW4ZQVCWgW2zrz7sh33Ao7ceNkL7iQGDYtuwTU"
})
> true

Testing

To run the tests:

  1. Install dependencies with yarn install or npm install
  2. Run yarn test or npm test