Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@dsnp/did-resolver-frequency
Advanced tools
This package contains a resolver for the @dsnp/did-resolver library which enables resolution of did:dsnp:*
DIDs on the Frequency blockchain.
npm install @dsnp/did-resolver-frequency
The resolver object can be constructed with Frequency connection information in one of two ways.
import { FrequencyResolver } from "@dsnp/did-resolver-frequency";
const frequencyResolver = new FrequencyResolver({
providerUri: "ws://127.0.0.1:9944",
frequencyNetwork: "local",
});
If constructed this way, you must call disconnect()
to explicitly release the connection; the process will not exit if this is not done.
or,
ApiPromise
object from @polkadot/api
:import { FrequencyResolver } from "@dsnp/did-resolver-frequency";
const frequencyResolver = new FrequencyResolver({
apiPromise: myApiPromise, // from ApiPromise.create(...)
frequencyNetwork: "local",
});
The frequencyNetwork
key is required in both cases (this is expected to be unnecessary with Frequency schema naming in the future).
Summary of options:
Configuration option | Description |
---|---|
providerUri | Provider URI for Frequency RPC node (optional; alternative to apiPromise |
apiPromise | An ApiPromise object (optional; alternative to providerUri |
frequencyNetwork | One of local , testnet , mainnet |
See .env.example
for example configuration.
Here's a full usage example with the DID resolver framework:
import { Resolver } from "did-resolver";
import dsnp from "@dsnp/did-resolver";
const frequencyResolver = new FrequencyResolver({
providerUri: "wss://rpc.rococo.frequency.xyz",
frequencyNetwork: "testnet"
});
const resolver = new Resolver(dsnp.getResolver([frequencyResolver]));
const myDid = "did:dsnp:13972";
const result = await resolver.resolve(myDid);
console.log(JSON.stringify(result, null, 2));
frequencyResolver.disconnect();
/* Example output:
{
"didResolutionMetadata": {
"contentType": "application/did+ld+json"
},
"didDocument": {
"@context": [
"https://www.w3.org/ns/did/v1"
],
"id": "did:dsnp:13972",
"assertionMethod": [
{
"@context": "https://w3id.org/security/multikey/v1",
"id": "did:dsnp:13972#z6MkuzE4hBVHTmwFff37ZuPQs9sbkdJo8jifN9sZ1jXbgyMp",
"type": "Multikey",
"controller": "did:dsnp:13972",
"publicKeyMultibase": "z6MkuzE4hBVHTmwFff37ZuPQs9sbkdJo8jifN9sZ1jXbgyMp"
}
],
"keyAgreement": []
},
"didDocumentMetadata": {}
}
*/
The example above is provided as a command line script.
cp .env.example .env
npm run resolve -- 13972
Currently this resolver implements the minimal functionality required to support lookup of public keys by DSNP applications.
keyType
1 are listed in the keyAgreement
array.keyType
2 are listed in the assertionMethod
array.Public keys are encoded using the Multikey
type.
The id
consists of the DSNP DID and a URL fragment that is the same as the publicKeyMultibase
value, which is a multicodec value in base58btc
encoding.
The decoded value for ed25519-pub
keys will be 34 bytes, including the two-byte multicodec identifier.
notFound
error if there is no corresponding Frequency MSA.FAQs
A DSNP over Frequency DID resolver
The npm package @dsnp/did-resolver-frequency receives a total of 2 weekly downloads. As such, @dsnp/did-resolver-frequency popularity was classified as not popular.
We found that @dsnp/did-resolver-frequency demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.