DutyType
Standard duty types defined in the PD-REL vocabulary.
Duties are obligations that must be fulfilled to exercise a permission. They define what users must provide or do in exchange for access rights. Duties can only be attached to 'permit' rules, not 'prohibit' rules. Custom duties can be defined using URIs.
Per the PD-REL v1.0 specification, the vocabulary includes PAYMENT, ROYALTY (in basis points), ATTRIBUTION, and SHARE_ALIKE as core duty types.
Examples
import { DutyType } from '@pd-institute/pd-rel-sdk';
// Payment requirement
const paymentDuty = {
type: DutyType.PAYMENT,
value: {
amount: '25.00',
currency: 'USD',
recipient: '0xCreatorWallet'
}
};
// Attribution requirement
const attributionDuty = {
type: DutyType.ATTRIBUTION,
value: 'Original artwork by Jane Doe, used under PD-REL license'
};
// Multiple duties on a rule
const rule = {
action: 'MODIFY',
effect: 'permit',
duties: [attributionDuty, {
type: DutyType.SHARE_ALIKE,
value: 'ipfs://QmOriginalPolicy'
}]
};
Definition
const DutyType: object
Properties
DutyType.PAYMENT
A one-time payment required to exercise the permission.
PAYMENT enables monetization through direct payments:
- License fees
- Access charges
- Usage fees
- Purchase prices
Value structure: { amount: string, currency: string, recipient: string }
Type: 'PAYMENT'
Value: 'PAYMENT'
Examples
// Fixed USD payment
{
type: DutyType.PAYMENT,
value: {
amount: '99.99',
currency: 'USD',
recipient: '0xCreatorAddress'
}
}
// Crypto payment
{
type: DutyType.PAYMENT,
value: {
amount: '0.1',
currency: 'ETH',
recipient: 'creator.eth'
}
}
DutyType.ROYALTY
A royalty (in basis points) on downstream sales or use.
ROYALTY enables ongoing revenue sharing:
- Secondary sale percentages
- Revenue sharing on commercial use
- Perpetual creator royalties
- Cascading payment obligations
Value structure: { basisPoints: number, recipient: string }
Note: 100 basis points = 1%
Type: 'ROYALTY'
Value: 'ROYALTY'
Examples
// 5% royalty on resales
{
type: DutyType.ROYALTY,
value: {
basisPoints: 500, // 5%
recipient: '0xArtistWallet'
}
}
// 2.5% platform fee
{
type: DutyType.ROYALTY,
value: {
basisPoints: 250, // 2.5%
recipient: 'platform.eth'
}
}
DutyType.ATTRIBUTION
A string that must be displayed to attribute the creator.
ATTRIBUTION ensures proper credit:
- Artist credits
- Source acknowledgments
- License notices
- Copyright statements
Value type: string (attribution text)
Type: 'ATTRIBUTION'
Value: 'ATTRIBUTION'
Examples
// Simple attribution
{
type: DutyType.ATTRIBUTION,
value: 'Artwork by Jane Doe'
}
// Detailed attribution with license
{
type: DutyType.ATTRIBUTION,
value: 'Original photo by John Smith, licensed under PD-REL. Visit johnsmith.art'
}
// Attribution for modifications
{
type: DutyType.ATTRIBUTION,
value: 'Based on "Sunset Dreams" by Alice Chen, modified with permission'
}
DutyType.SHARE_ALIKE
Requires derivative works to be licensed under a specific policy.
SHARE_ALIKE ensures license propagation:
- Copyleft-style requirements
- Viral licensing terms
- Consistent rights downstream
- Community benefit sharing
Value type: string (policy URI) or object with policy details
Type: 'SHARE_ALIKE'
Value: 'SHARE_ALIKE'
Examples
// Reference to original policy
{
type: DutyType.SHARE_ALIKE,
value: 'ipfs://QmOriginalPolicy123'
}
// Policy template reference
{
type: DutyType.SHARE_ALIKE,
value: 'https://licenses.example.com/open-derivative-v1'
}
// Inline policy requirements
{
type: DutyType.SHARE_ALIKE,
value: {
template: 'CC-BY-SA-4.0',
additions: ['ATTRIBUTION', 'NON_COMMERCIAL']
}
}
See Also
-
- Duty for duty structure
- Rule.duties for usage in rules
Since
Version 1.0.0