Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
rohenaz committed Jul 24, 2021
1 parent a2f886f commit 460573b
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 45 deletions.
2 changes: 1 addition & 1 deletion docs/_sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- [Getting Started](getting_started.md "Get started now using Schema")
- **Browse Schemas**
- [All](schemas.md "Browse all the active schemas")
<!-- - [Generic](generic_schema.md "Generic schema models") -->
- [Generic](generic_schema.md "Generic schema models")
- [Social](social_schema.md "Communication schemas")
- **Resources**
- [Terms of Service](terms_of_service.md "Terms of Service for our site")
43 changes: 33 additions & 10 deletions docs/generic_schema.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,58 @@
## Description
(description of generic schemas)
These are generic Schemas that can be used for many use cases.

?> More Schemas will be added as common use cases are identified and implemented.

### Payment

Payment is used to describe a payment send from one identity to another.

##### OP_RETURN

```
MAP SET app <appname> type payment context tx tx <txId>
```

##### Optional Parameters

- Context
- ContextValue
- Subcontext
- Subcontext Value

<!--
### Image
(schema purpose, id, properties, model, version)
```json
{
"image": {
"property": "value"
}
"image": {
"property": "value"
}
}
```
### Handle
(schema purpose, id, properties, model, version)
```json
{
"handle": {
"property": "value"
}
"handle": {
"property": "value"
}
}
```
### Profile
(schema purpose, id, properties, model, version)
```json
````json
{
"profile": {
"property": "value"
}
}
```
``` -->
7 changes: 6 additions & 1 deletion docs/getting_started.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
## Using Schema
(here's a simple example of using schema)

## JavaScript Example

(js example)

## Go Example

(go example)

## Getting help

[TonicPow](https://tonicpow.com) maintains an [#open-social](https://join.slack.com/t/tonicpow/shared_invite/zt-mlccqx28-IEabvOGPx_QLyFJJbWE3hQ) Slack channel dedicated to supporting on-chain social network development.
4 changes: 3 additions & 1 deletion docs/schemas.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## List of All Schemas

<!-- - [Generic](generic_schema.md) -->
- [Generic](generic_schema.md)

- [Social](social_schema.md)

?> More Schemas will be added as common use cases are identified and implemented.
62 changes: 30 additions & 32 deletions docs/social_schema.md
Original file line number Diff line number Diff line change
@@ -1,95 +1,93 @@
## Social Schemas
These schemas are the building blocks for building social networking apps. These on-chain records can be indexed and queried to build full-featured social platforms of all kinds.

These schemas are the building blocks for building social networking apps.

### Like
## Like

Used to express positive sentiment about a post, transaction, or any other global identifier.

#### OP_RETURN
###### OP_RETURN

```
MAP SET app <appame> type like tx <txid> | AIP paymail <pubkey> <signature>
```

#### go-bitcoin-schema
##### go-bitcoin-schema

```go
tx, err := CreateLike(likeTxID, utxos, changeAddress, privateKey)
```

### Unlike
## Unlike

Used to undo a like

#### OP_RETURN
##### OP_RETURN

```
MAP SET app <appame> type unlike tx <txid> | AIP paymail <pubkey> <signature>
```

#### go-bitcoin-schema
##### go-bitcoin-schema

```
tx, err := CreateUnlike(unlikeTxID, utxos, changeAddress, privateKey)
```

### Follow
## Follow

Used to express a relationship between two identities.

#### OP_RETURN
##### OP_RETURN

```
MAP SET app <appame> type follow idKey <pubkey> | AIP paymail <pubkey> <signature>
```

#### go-bitcoin-schema
##### go-bitcoin-schema

```go
tx, err := CreateFollow(followIdKey, utxos, changeAddress, privateKey)

```

### Unfollow
## Unfollow

Used to express a relationship between two identities.

#### OP_RETURN
##### OP_RETURN

```
MAP SET app <appame> type unfollow idKey <pubkey> | AIP paymail <pubkey> <signature>
```

#### go-bitcoin-schema
##### go-bitcoin-schema

```go
tx, err := CreateUnfollow(unfollowIdKey, utxos, changeAddress, privateKey)

```

### Post
## Post

Post is meant to express a new piece of content to the network.

- B protocol is used for the content. This means the post could be anything from plain text, an image, some markdown, or even binary. Any file type can be expressed as a post.
- Attachments can be made in addition to the post content (see [Attachments])
- The Context and Subcontext properties are optional. They allow you to post within a specific context such as a geolocation. Some contexts require more than 1 level, such as commenting on a YouTube video. In the case of youtube we use a context name of "provider" and a value of "youtube". We then specify a subcontext name of "videoID" and set the value to the YouTube video ID our post is associated with. This pattern allows us to comment on anything in a flexible way that is machine readable.

#### OP_RETURN
##### OP_RETURN

```
B <content> <mediaType> <encoding> | MAP SET app <appame> type post | AIP paymail <pubkey> <signature>
```

#### Optional Parameters
##### Optional Parameters

- Context
- ContextValue
- Subcontext
- Subcontext Value

#### go-bitcoin-schema
##### go-bitcoin-schema

```go
// identity key of the user you are requesting
Expand All @@ -105,17 +103,17 @@ post := bschema.Post{
tx, err := bschema.CreatePost(post, utxos, changeAddress, privateKey)
```

### Reply
## Reply

Replies are just Posts with a context of a transaction ID.

#### OP_RETURN
##### OP_RETURN

```
OP_FALSE OP_RETURN B <content> <mediaType> <encoding> | MAP SET app <appame> type post context tx tx <txid> | AIP paymail <pubkey> <signature>
```

#### go-bitcoin-schema
##### go-bitcoin-schema

```go
reply := bschema.Post{
Expand All @@ -126,42 +124,42 @@ reply := bschema.Post{
tx, err := CreateReply(reply, replyTxID, utxos, changeAddress, privateKey)
```

### Repost
## Repost

A repost is used to amplify an existing post, without reposting the actual content. Like with a post, it is possible to repost with a new context and/or subcontext. This allows you surface posts in multiple contexts. Imagine a post is made with a context of a UPC code (comment on a physical produt). Someone might then repost that comment with a context of 'url' and value = the company's web address. This would repost that comment against the company website, surfacing it in new apps such as metalens.

#### Optional Parameters
##### Optional Parameters

- Context
- ContextValue
- Subcontext
- Subcontext Value

#### OP_RETURN
##### OP_RETURN

```
MAP SET app <appame> type repost tx <txid> | AIP paymail <pubkey> <signature>
```

#### go-bitcoin-schema
##### go-bitcoin-schema

```go
tx, err := CreateRepost(repostTxID, utxos, changeAddress, privateKey)
```

### Tags
## Tags

Tags allow you to categorize content. Unlike context, which determines when / where the content should be rendered and with what view, tags are a general purpose tool for aiding with search and filtering posts based on their tag values.

Tags are added as an additional output, with the following format:

#### OP_RETURN
##### OP_RETURN

```
MAP ADD tags <tag1> <tag2> <tag3> ... | AIP paymail <pubkey> <signature>
```

#### go-bitcoin-schema
##### go-bitcoin-schema

You can include tags on any post

Expand All @@ -177,11 +175,11 @@ post := Post{
}
```

### Attachments
## Attachments

Attachments are included as additional OP_RETURN outputs using B protocol, signed with AIP.

#### OP_RETURN
##### OP_RETURN

Attachment 1:

Expand All @@ -195,7 +193,7 @@ Attachment 2:
B <attachment2Data> <mediaType> <encoding> | paymail <pubkey> <signature>
```

#### go-bitcoinb-schema
##### go-bitcoinb-schema

```go
htmlAttachment := "<html><h1>This is a html attachment</h1></html>"
Expand Down

0 comments on commit 460573b

Please sign in to comment.