Skip to content

Latest commit

 

History

History
194 lines (164 loc) · 2.99 KB

File metadata and controls

194 lines (164 loc) · 2.99 KB

JSON Schemas

This document describes the stable JSON output shapes currently emitted by nsec-tree-cli when --json is used.

These are practical schemas intended for scripting with tools like jq.

root create

{
  "rootType": "mnemonic-backed",
  "recoverable": true,
  "masterNpub": "npub1...",
  "mnemonic": "abandon ... about",
  "profile": "optional-profile-name"
}

root restore / root import-nsec / root inspect

{
  "rootType": "mnemonic-backed | nsec-backed",
  "recoverable": true,
  "masterNpub": "npub1...",
  "profile": "optional-profile-name",
  "source": "optional-source-description"
}

derive path

{
  "rootType": "mnemonic-backed | nsec-backed",
  "recoverable": true,
  "path": "personal@0/forum-burner@0",
  "segments": [
    {
      "name": "personal",
      "requestedIndex": 0,
      "actualIndex": 0,
      "npub": "npub1..."
    }
  ],
  "npub": "npub1...",
  "publicKey": "hex",
  "purpose": "forum-burner",
  "index": 0,
  "secretRequested": false,
  "profile": "optional-profile-name"
}

export npub

{
  "path": "personal@0",
  "npub": "npub1..."
}

export nsec

{
  "path": "personal@0",
  "nsec": "nsec1..."
}

export identity

{
  "path": "personal@0/forum-burner@0",
  "segments": [],
  "npub": "npub1...",
  "nsec": "nsec1...",
  "publicKey": "hex",
  "purpose": "forum-burner",
  "index": 0
}

prove private / prove full

The CLI emits the proof object from nsec-tree directly:

{
  "masterPubkey": "hex",
  "childPubkey": "hex",
  "purpose": "optional-purpose",
  "index": 0,
  "attestation": "string",
  "signature": "hex"
}

verify proof

{
  "valid": true,
  "proofType": "private | full",
  "proof": {
    "masterPubkey": "hex",
    "childPubkey": "hex",
    "purpose": "optional-purpose",
    "index": 0,
    "attestation": "string",
    "signature": "hex"
  }
}

shamir split

{
  "rootType": "mnemonic-backed",
  "recoverable": true,
  "shares": [
    {
      "index": 1,
      "threshold": 2,
      "words": ["abandon", "ability"],
      "phrase": "abandon ability ..."
    }
  ]
}

shamir recover

{
  "rootType": "mnemonic-backed",
  "recoverable": true,
  "mnemonic": "abandon ... about"
}

profile list

[
  {
    "name": "personal",
    "savedAt": "2026-03-19T00:00:00.000Z",
    "rootType": "mnemonic-backed",
    "recoverable": true,
    "masterNpub": "npub1...",
    "active": true
  }
]

profile show

The CLI emits the stored profile record:

{
  "name": "personal",
  "savedAt": "2026-03-19T00:00:00.000Z",
  "rootType": "mnemonic-backed",
  "recoverable": true,
  "masterNpub": "npub1...",
  "root": {
    "type": "mnemonic-backed",
    "mnemonic": "abandon ... about",
    "passphrase": "optional"
  }
}

inspect path

{
  "path": "personal@0/forum-burner@0",
  "segments": [
    {
      "name": "personal",
      "requestedIndex": 0
    }
  ],
  "deterministic": true
}