Legal Token Protocol

LTP is a module of the open-source @smartledger/bsv library for representing legal rights as tokens, anchoring them on the BSV blockchain, and verifying them later.

What it provides

LTP is reachable as bsv.LTP. Its public members are:

Install

Install the scoped package. The unscoped smartledger-bsv package is deprecated and must not be used.

npm install @smartledger/bsv

Hashing a claim

Through 9.x the default canonicalization is a legacy sorted-key form rather than RFC 8785. For most claims the two agree, but they differ where a claim has integer-like field names, so pass the canonicalization explicitly. The default is deprecated and becomes JCS in a future major release.

const bsv = require('@smartledger/bsv')

const claim = {
  type: 'ownership',
  subject: 'did:example:alice',
  asset: 'title-123',
  issued: '2026-10-15'
}

const h = bsv.LTP.Claim.hash(claim, bsv.LTP.Claim.CANONICALIZATION.JCS)
// 'a73086f85ad6affdb1ab9b1cb584436517cb7aad18a0c522dd9db6031adbfe14'

Avoid field names containing ., [ or ] in tokens; they are deprecated because the path cannot be read back unambiguously, so a commitment and the value it names can come apart. They are removed in the next major release.

Read before you rely on it

The library documents which properties it guarantees and which it does not (what is canonical, what is malleable, what it refuses). Read RELIED-UPON-PROPERTIES.md before building on it.

Links