Skip to content

Commit

Permalink
docs: clarify monetization property application (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremiahlee authored Feb 3, 2025
1 parent f6b884c commit 957a8e2
Showing 1 changed file with 67 additions and 40 deletions.
107 changes: 67 additions & 40 deletions src/content/docs/docs/references/activitystreams.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@
title: 'Activity Streams JSON-LD'
---

Social web community servers and apps can expose the wallet address of a user’s profile or post to a Web Monetization client, such as the Web Monetization browser extension or embedded SDK.
Social web community servers and apps can expose the wallet address of a user or post to a Web Monetization client, such as the Web Monetization browser extension or embedded SDK.

Web Monetization links are represented in [Activity Streams 2.0](https://www.w3.org/TR/activitystreams-core/) [Object Types](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object) using the `monetization` property from the Web Monetization namespace (`https://webmonetization.org/ns.jsonld`).
The `monetization` property from the Web Monetization namespace (`https://webmonetization.org/ns.jsonld`) applies to an [Activity Streams 2.0](https://www.w3.org/TR/activitystreams-core/) [`Object`](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object).

### User `Profile` example
A Web Monetization wallet address may be applied to either an [`Actor`](https://www.w3.org/TR/activitystreams-vocabulary/#actor-types) performing an action of creation or an [Object Type](https://www.w3.org/TR/activitystreams-vocabulary/#object-types) created by the `Actor`.

A `monetization` property must only be applied to an [Object Type](https://www.w3.org/TR/activitystreams-vocabulary/#object-types) when its desired monetization attribution is distinct from the [`Actor`](https://www.w3.org/TR/activitystreams-vocabulary/#actor-types) who created it.

### User profile example

```jsonc
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",

// Add the Web Monetization namespace
// Add the Web Monetization context
"https://webmonetization.org/ns.jsonld",

{
Expand All @@ -37,75 +41,98 @@ Web Monetization links are represented in [Activity Streams 2.0](https://www.w3.
"sharedInbox": "https://alpaca.gold/inbox"
},
"tag": [{
"type": "Hashtag",
"href": "https://alpaca.gold/tags/WebMonetizationRocks",
"name": "#WebMonetizationRocks"
"type": "Hashtag",
"href": "https://alpaca.gold/tags/WebMonetizationRocks",
"name": "#WebMonetizationRocks"
}],

// Wallet address when viewing this user’s profile
// Wallet address when viewing this user’s profile and posts
"monetization": "https://fynbos.me/jeremiah"
}
```

### User post (`Note`) example

```jsonc
{
"@context": [
"https://www.w3.org/ns/activitystreams",
"https://webmonetization.org/ns.jsonld",

// Add the Web Monetization context
"https://webmonetization.org/ns.jsonld",

{
"ostatus": "http://ostatus.org#",
"atomUri": "ostatus:atomUri",
"conversation": "ostatus:conversation"
}
],
"id": "https://demo.interledger.social/users/WebMonetizationTest/statuses/113917664614618248",
"type": "Note",
"published": "2025-01-30T14:00:14Z",
"url": "https://demo.interledger.social/@WebMonetizationTest/113917664614618248",
"attributedTo": "https://demo.interledger.social/users/WebMonetizationTest",
"to": ["https://www.w3.org/ns/activitystreams#Public"],
"cc": [
"https://demo.interledger.social/users/WebMonetizationTest/followers",
"https://alpaca.gold/users/Jeremiah"
],
"atomUri": "https://demo.interledger.social/users/WebMonetizationTest/statuses/113917664614618248",
"conversation": "tag:demo.interledger.social,2025-01-30:objectId=26:objectType=Conversation",
"content": "<p>“When you go viral, you should get paid.” —<span class=\"h-card\" translate=\"no\"><a href=\"https://alpaca.gold/@Jeremiah\" class=\"u-url mention\">@<span>Jeremiah</span></a></span></p>",
"contentMap": {
"en": "<p>“When you go viral, you should get paid.” —<span class=\"h-card\" translate=\"no\"><a href=\"https://alpaca.gold/@Jeremiah\" class=\"u-url mention\">@<span>Jeremiah</span></a></span></p>"
},
"tag": [{
"type": "Mention",
"href": "https://alpaca.gold/users/Jeremiah",
"name": "@[email protected]"
}],

// Wallet address distinct from the Note’s author
"monetization": "https://fynbos.me/jeremiah"
}
```

### Post with multiple wallet addresses example

```jsonc
{
"@context": [
"https://www.w3.org/ns/activitystreams",

// Add the Web Monetization namespace
// Add the Web Monetization context
"https://webmonetization.org/ns.jsonld",

{
"ostatus": "http://ostatus.org#",
"atomUri": "ostatus:atomUri",
"inReplyToAtomUri": "ostatus:inReplyToAtomUri",
"conversation": "ostatus:conversation",
"sensitive": "as:sensitive",
"Hashtag": "as:Hashtag"
}
],
"id": "https://alpaca.gold/users/Jeremiah/statuses/113677237228956618",
"id": "https://alpaca.gold/users/Jeremiah/statuses/816659822732776311",
"type": "Note",
"published": "2024-12-19T02:56:24Z",
"url": "https://alpaca.gold/@Jeremiah/113677237228956618",
"published": "2025-03-03T02:03:03Z",
"url": "https://alpaca.gold/@Jeremiah/816659822732776311",
"attributedTo": "https://alpaca.gold/users/Jeremiah",
"to": ["https://www.w3.org/ns/activitystreams#Public"],
"cc": ["https://alpaca.gold/users/Jeremiah/followers"],
"sensitive": false,
"atomUri": "https://alpaca.gold/users/Jeremiah/statuses/113677237228956618",
"inReplyToAtomUri": null,
"conversation": "tag:alpaca.gold,2024-12-19:objectId=3727991:objectType=Conversation",
"content": "<p>When you go viral, you should get paid. <a href=\"https://alpaca.gold/tags/WebMonetizationRocks\" class=\"mention hashtag\" rel=\"tag\">#<span>WebMonetizationRocks</span></a></p>",
"attachment": [],
"tag": [{
"type": "Hashtag",
"href": "https://alpaca.gold/tags/webmonetizationrocks",
"name": "#webmonetizationrocks"
}],
"atomUri": "https://alpaca.gold/users/Jeremiah/statuses/816659822732776311",
"conversation": "tag:alpaca.gold,2025-03-03:objectId=4838002:objectType=Conversation",
"content": "<p>I can’t take full credit for the awesomeness of this post.</p>",
"replies": {
"id": "https://alpaca.gold/users/Jeremiah/statuses/113677237228956618/replies",
"id": "https://alpaca.gold/users/Jeremiah/statuses/816659822732776311/replies",
"type": "Collection",
"first": {
"type": "CollectionPage",
"next": "https://alpaca.gold/users/Jeremiah/statuses/113677237228956618/replies?only_other_accounts=true&page=true",
"partOf": "https://alpaca.gold/users/Jeremiah/statuses/113677237228956618/replies",
"items": []
"next": "https://alpaca.gold/users/Jeremiah/statuses/816659822732776311/replies?only_other_accounts=true&page=true",
"partOf": "https://alpaca.gold/users/Jeremiah/statuses/816659822732776311/replies"
}
},
"likes": {
"id": "https://alpaca.gold/users/Jeremiah/statuses/113677237228956618/likes",
"type": "Collection",
"totalItems": 42
},
"shares": {
"id": "https://alpaca.gold/users/Jeremiah/statuses/113677237228956618/shares",
"type": "Collection",
"totalItems": 9
},

// Wallet address when viewing this Note
"monetization": "https://fynbos.me/jeremiah"
"monetization": ["https://fynbos.me/jeremiah", "https://fynbos.me/adam"]
}
```

0 comments on commit 957a8e2

Please sign in to comment.