
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
luckyf-my-dummy-lib
Advanced tools
This packages translates domain names into crypto wallet addresses, using standard TXT records set by the DNS.
This packages translates domain names into crypto wallet addresses, using standard TXT records set by the DNS.
Crypto currency wallet addresses aren't readable or rememberable. Just like in the "normal" DNS system, where we translate domain names to IP addresses, a system which translates domain names to wallet addresses would be useful.
There are several providers of such translation services like ENS which are using smart contracts for the translation, but using those will result in gas fees, which are currently really high.
Fortunately we already have DNS as a global translation system in place, which we can use. By adding TXT records we are able to associate wallet addresses for one or multiple crypto currencies to our domain or subdomain. This package is heavily inspired by this blog post of Mattias Geniar.
Using npm:
npm install crypto-dns
Using yarn:
yarn add crypto-dns
Lookup single address for a currency with the highest priority:
import { lookupOne } from 'crypto-dns';
const lookupSingleAddress = await lookupOne('thirdweb.de', 'ETH');
// -> string
// 0xD982065960f77282eDB555b43B175Cf3A7dAC72d
You can also lookup all addresses for a currency (sorted by priority):
import { lookupMany } from 'crypto-dns';
const lookupMultipleAddresses = await lookupMany('thirdweb.de', 'ETH');
// -> array
//[
// {
// version: 1,
// priority: 10,
// currency: 'ETH',
// address: '0xB9Af69a9850a98d9Fb66Ce210E88021Ad583961a',
// },
// {
// version: 1,
// priority: 10,
// currency: 'ETH',
// address: '0xD982065960f77282eDB555b43B175Cf3A7dAC72d',
// },
// {
// version: 1,
// priority: 20,
// currency: 'ETH',
// address: '0xccaa72d80EeB1A2Ac91B6Fdebff995D55ea9368a',
// },
//];
To receive addresses for every available currency you can use the lookup
method:
import { lookup } from 'crypto-dns';
const lookupResultForAllCurrencies = await lookup('thirdweb.de');
// -> array
//[
// {
// version: 1,
// priority: 10,
// currency: 'ETH',
// address: '0xB9Af69a9850a98d9Fb66Ce210E88021Ad583961a',
// },
// ...
// {
// version: 1,
// priority: 10,
// currency: 'MATIC',
// address: '0xD982065960f77282eDB555b43B175Cf3A7dAC72d',
// },
//];
crypto:<formatVersion>:<priority> <currency>:<walletAddress>
Keyword | Description |
---|---|
formatVersion | Version of the format of the DNS string Currently only 1 is available. |
priority | Specify priority of the entry (3 digits). The lower, the higher priority. |
currency | Symbol of the crypto currency (case-insensitive). Use CoinMarketCap to find all symbols. |
walletAddress | String with your wallet address. The format depends on the currency. |
Regex:
/^"+crypto:(?<formatVersion>\d):(?<priority>\d{1,3})\s(?<currency>\w+):(?<walletAddress>.*)"+/
Examples:
`crypto:v1:10 eth:0xD982065960f77282eDB555b43B175Cf3A7dAC72d`
`crypto:v1:10 matic:0xD982065960f77282eDB555b43B175Cf3A7dAC72d`
`crypto:v1:10 btc:XXXX`
Subdomains can be used like root domains. Just use your subdomain when adding it to the DNS instead of the @
path.
You can validate all tests by running:
yarn test
This library is licensed under the MIT License.
For Bug reports or feature requests, please create an issue in the crypto-dns repository.
If you would like to support or fund the development of this project, feel free to contact me via mail.
FIX1
FAQs
This packages translates domain names into crypto wallet addresses, using standard TXT records set by the DNS.
We found that luckyf-my-dummy-lib demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.