Sign In

@dcprotocol/core

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dcprotocol/core

Core encryption, wallet, storage, and policy engine for DCP Vault

Source
npmnpm
Version
0.2.0
Version published
Weekly downloads
33
32%
Maintainers
1
Weekly downloads
 
Created
Source

@dcprotocol/core

Core cryptography + storage layer for DCP. This is the low‑level engine that powers the CLI, MCP server, and REST server.

If you’re building your own tooling or embedding DCP into another service, this is the package you use. Most users should start with @dcprotocol/cli, @dcprotocol/mcp, or @dcprotocol/server.

Install

npm install @dcprotocol/core

What It Provides

  • Envelope encryption (XChaCha20-Poly1305)
  • Master key management (Argon2id wrapping)
  • SQLite storage schema + CRUD for vault records
  • Wallet creation + signing helpers (Solana + EVM)
  • Budget engine + audit logging

API Overview (Common Exports)

Crypto

  • generateKey, generateNonce, generateSalt
  • deriveKeyFromPassphrase
  • encrypt, decrypt
  • envelopeEncrypt, envelopeDecrypt
  • zeroize, secureAlloc
  • generateRecoveryMnemonic, deriveKeyFromMnemonic, validateMnemonic

Wallets

  • createWallet, importWallet, isChainSupported
  • signTransaction, signSolanaMessage, signEvmMessage
  • getPublicAddress

Storage

  • VaultStorage with initializeSchema, createRecord, getRecord, listRecords, createSession, listActiveSessions, getPendingConsents, logAudit, recordSpend

Budget

  • BudgetEngine with checkBudget, enforceBudget, getLimits, setConfig

Example: Initialize + Store a Record

import { VaultStorage } from '@dcprotocol/core';

const storage = new VaultStorage();
storage.initializeSchema();

// Initialize master key once (during setup)
await storage.initializeMasterKey('your-passphrase');

// Store a record (data is encrypted automatically)
storage.createRecord({
  scope: 'identity.email',
  item_type: 'IDENTITY',
  sensitivity: 'sensitive',
  data: { email: 'user@example.com' },
});

Notes

  • This package assumes local‑first storage (SQLite + OS keychain).
  • It includes native dependencies such as better-sqlite3, keytar, and sodium-native.
  • On Linux, local keychain-backed usage may require system packages such as libsecret-1-0.
  • If you need agent access, use @dcprotocol/mcp or @dcprotocol/server.
  • See the root README for the full architecture and security model.

Keywords

vault

FAQs

Package last updated on 18 Mar 2026

Did you know?

Socket

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.

Install

Related posts