Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@identity.com/cryptid
Advanced tools
The Cryptid client library provides functionality for signing transactions and managing Cryptid DID wallets.
The Cryptid client library provides functionality for signing transactions and managing Cryptid DID wallets.
npm i --save @identity.com/cryptid
This example shows creating a new keypair, and a Cryptid instance.
import {Connection, Keypair, LAMPORTS_PER_SOL, SystemProgram, Transaction} from '@solana/web3.js';
import { build, util } from '@identity.com/cryptid';
const connection = new Connection(clusterApiUrl('devnet'), 'confirmed');
// Create (or provide) a Solana keypair
const key = Keypair.generate();
const did = util.publicKeyToDid(key.publicKey, 'devnet');
// Create the Cryptid instance
const cryptid = build(did, key, {
connection,
waitForConfirmation: true,
});
Note both accounts would need to be funded (e.g. via an Airdrop)
const pubKey = Keypair.generate().publicKey;
const keyAlias = 'mobile';
// Add a key to the Cryptid account
await cryptid.addKey(pubKey, keyAlias);
// Remove a key from the Cryptid account
await cryptid.removeKey(keyAlias);
const serviceAlias = 'domains';
// Add a service to a Cryptid account
await cryptid.addService({
id: `${did}#${serviceAlias}`,
type: serviceAlias,
serviceEndpoint: 'https://example.com',
description: 'Domains'
});
// Remove a service from the Cryptid account
await cryptid.removeService(serviceAlias);
const controllerDid = 'did:sol:devnet:GxsFhrQNMU4HDgJ69vvYUmnzwzXNEve4tskCqTx7SsHK';
// Add a controller to the Cryptid account
await cryptid.addController(controllerDid);
// Remove a controller from Cryptid acccount
await cryptid.removeController(controllerDid);
const didDocument = await cryptid.document();
An example of using Cryptid to sign a transaction to send
const {blockhash: recentBlockhash} = await connection.getRecentBlockhash();
const transferTx = new Transaction({recentBlockhash, feePayer: cryptidAddress}).add(SystemProgram.transfer({
fromPubkey: cryptidAddress,
toPubkey: recipient,
lamports: lamportsToTransfer,
}));
const [cryptidTransferTx] = await cryptid.sign(transferTx);
const transferTxSignature = await connection.sendRawTransaction(cryptidTransferTx.serialize());
await connection.confirmTransaction(transferTxSignature);
This example shows how a Cryptid account can control and transact on behalf of another Cryptid account.
const cryptid = build(controllerDID, controllerDidKey, {
connection,
waitForConfirmation: true,
});
// Create the controller Cryptid instance
const controllerCryptid = cryptid.as(controlledDID);
// Create a transaction from the controlled Cryptid instance
const {blockhash: recentBlockhash} = await connection.getRecentBlockhash();
const tx = new Transaction({recentBlockhash, feePayer: controlledCryptidAddress}).add(
SystemProgram.transfer({
fromPubkey: controlledCryptidAddress,
toPubkey: recipient,
lamports: lamportsToTransfer,
})
);
// Sign the transaction with the controller Cryptid instance
const txSignedByController = await controllerCryptid.sign(tx);
FAQs
The Cryptid client library provides functionality for signing transactions and managing Cryptid DID wallets.
We found that @identity.com/cryptid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 13 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 researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.