What is Near Social?

(6 nL)
3 min read
To Share and +4 nLEARNs

Near Social (previously known as Social08) is a social data protocol built on top of NEAR Protocol.

Please join Telegram group @NearSocial for discussions.

Watch presentation Near Social at NEARCON22

Explore Near Social: near.social

Links

Github: https://github.com/NearSocial

Twitter: @NearSocial_

Telegram: @NearSocial

SocialDB Contract:

Standards: https://github.com/NearSocial/standards

Near Social Browser:

If you are looking for a mastodon based social network for .near users, see an article about mastodon.near.social

SocialDB

SocialDB is a smart contract to store social data on NEAR protocol.

Get API

Takes a list of keys and returns a joined JSON object with the matched data.

  • keys – an array of key patterns to return.
Reading a profile of account self.social.near

To read all fields recursively for a given path add ** suffix.

Returns the aggregated JSON object.

Reading names of all account with profiles

Note that this query iterates over all accounts and will not fit into the available view call gas in the future.

Keys API

Takes a list of keys and returns a joined JSON object with the keys matched the query.

  • keys – an array of key patterns to return.

Returns the aggregated JSON object.

Getting a list of widgets of accounts root.near

Getting a list of accounts that have widgets

Note that this query iterates over all accounts and will not fit into the available view call gas in the future.

Standards

The data in SocialDB is organized as a simple JSON tree. The only enforced rule is that the keys in the root are the account IDs that store the data. This is done on purpose, so the SocialDB contract is not enforcing any structure or a schema. Otherwise, the contract has to be modified for every schema change. The control of the contract schemas can lead to the centralization and restrictions. Instead, Near Social Standards live outside the SocialDB contract.

Currently, Standards on Github is the default place for the standards, but this may change in the future.

Schema description

  • bold means the key is required.
  • italic means the key is optional.
  • [account_id] means the dynamic key is an account ID. For example, alex.near as a key. It usually used to create some edge towards that account.

Root schema

Each account should follow the Root schema

Widgets

Widgets are reusable composable components for Near Social.

You can view and create widgets at near.social.

For example, a data explorer widget allows you to explore raw data from SocialDB.

Open source with version control

The source code of every widget is openly stored in SocialDB. The owner of the widget has ability to upgrade the widget, by updating the source code. But because SocialDB is stored on a blockchain, all the previous versions of the widget are also available. This enables automatic version control for every widget.

Forking

If you are familiar with GitHub, you know that you can fork any public repository to create your local version. Similarly, you can fork any widget straight from the near.social UI.

Forking creates a copy of the widget source code, but under your account. It allows everyone to modify the existing widgets. Once you save the new widget, it becomes immediately available. And everyone can now view and fork your version of the widget.

It’s mostly the question of a UI to create a pull requests, so people can merge changes from other forks. Currently, it has to be done manually.

Programming language

The widgets are implemented in a limited version of JSX (a JavaScript with ReactJS). The code is executed in custom Virtual Machine to create a secure sandbox. This ensures the widgets can’t access local storage or cookies.

Generate comment with AI 2 nL
69

3 thoughts on “What is Near Social?”

Leave a Comment


To leave a comment you should to:


Scroll to Top
Report a bug👀