# Follow Node

### Introduction

The **`follow`** node is an integral part of the MetaID specification, allowing users to create and maintain their social relationships within the blockchain network. By utilizing **`follow`**, we can significantly enhance the social capabilities of MetaID, providing users with a richer and more in-depth interaction experience.

<figure><img src="/files/PQv6jFAOc4XXrn10g2wp" alt=""><figcaption></figcaption></figure>

### Spec

The script format for the **`follow`** protocol is as follows:

```jsx
OP_FALSE
OP_IF
	metaid                           
	create                          
	/follow                         
	0                               
	0                                
	application/json;utf-8         
	{metaid}                        
OP_ENDIF
```

#### Conventions for **`follow`**

1. In the **`follow`** format, **`create`** represents a follow action, while **`revoke`** represents an unfollow action.
2. In the **`revoke`** operation, the **`path`** must locate a valid `PIN`, and this `PIN` must be a valid **`follow`** `PIN`.

### Example

Taking user A following user B as an example:

* User A's MetaID: **`c08c4e96514ee5c4f91b6df3de7a42f797a36af7265918a6b74d5198f87682ad`**
* User B's MetaID: **`2464ad8d35e601f8b73c80976104ff00e878f58dc2f2936ec3a269fe34d962c2`**

The script operation for user A to follow user B is as follows:

```jsx
OP_FALSE
OP_IF
	metaid                         
	create                         
	/follow                        
	0                              
	0                              
	application/json;utf-8         
	2464ad8d35e601f8b73c80976104ff00e878f58dc2f2936ec3a269fe34d962c2 
OP_ENDIF
```

After the **`follow`** `PIN` is committed to the blockchain, the generated **`pinId`** is: **`dcvv5d4377f36c7c2466259593d0d4a0c1e5d7ec19500e082ce1eea3993f22b1aac1i0`**

Then, the script operation for user A to unfollow user B is as follows:

```jsx
OP_FALSE
OP_IF
	metaid                         
	revoke                         
	@dcvv5d4377f36c7c2466259593d0d4a0c1e5d7ec19500e082ce1eea3993f22b1aac1
	OP_0                           
	OP_0                           
	OP_0                           
	OP_0                            
OP_ENDIF
```

Both follow and unfollow operations take effect immediately and generate corresponding records on the blockchain.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.metaid.io/metaid-specification/metaid-tree/follow-node.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
