# Getting Started Guides

Guides for signing up to the beta, testnet, and navigating Script Network will be available here. Any specific questions, please [head to our discord](https://discord.com/invite/scriptnetwork), and open a support ticket.&#x20;


# How to Sign Up + Sign In to Script TV

{% hint style="info" %}

#### PREREQUISITES

* &#x20;   You should have a stable internet connection.
* &#x20;   A browser having wallet extension.
* &#x20;   You should have supported wallet like Metamask or WalletConnect.&#x20;
* &#x20;   You should have verified Email ID.

{% endhint %}

**How to Sign In & Sign Up in Script TV**

In this documentation we will conclude how to sign up and sign in again into Script TV. This documentation also includes the procedure of how to link and verify your supported wallet with Script TV.

## Connect wallet and sign up

* Head to Script TV by typing in (<https://get.script.tv>)&#x20;
* At the upper right-side sign-up tab shows up. Click on it.
* &#x20; It will automatically show the following screen, for which you choose how you'd like to sign up / sign in  &#x20;

<figure><img src="/files/9NNo19JnSCrNQcy6k9iL" alt=""><figcaption></figcaption></figure>

*

```
<div align="center"><figure><img src="/files/CWUPooH4JFmHNpFHyS4i" alt=""><figcaption></figcaption></figure> <figure><img src="/files/9t7PvLTAE1u7UnGJWXaI" alt=""><figcaption></figcaption></figure></div>
```

* &#x20;If you choose to sign in via Metamask a pop up will come up as per the image above. This is to switch to Script Blockchain Testnet, click 'Switch Network'.&#x20;
* You will be asked to type in your email address, nickname, and a referral code (if you have one).&#x20;
* You will then be prompted to sign a message. This is totally safe, and the warning message from Metamask **is completely normal** - due to Script Testnet being new. This will change in due course.&#x20;
* Once you have signed the message, you will have a host of options within your profile to select and choose from.&#x20;
* \*If you wish to sign up for a new account, you must use a different wallet.

·   &#x20;


# Using the Live TV player

{% hint style="info" %}
The TV application is currently in live working beta. This means many functions will be currently flawed / not work as it intends to. **Changes are being made daily with updates on the development of this product.** \
\
Albeit most of this section is self explanatory by nature (watching live TV), we will constantly do our best to update as much as possible and provide further information as to how it works. Do of course check out [our discord](https://discord.com/invite/scriptnetwork) for further detailed updates and information regarding this. \
\
**Please only view the beta on desktop / laptop only for now.**\
\
**To clarify once more, many of the action buttons across the TV app is not fully workable, and is currently for testing / viewing purposes only\*\***
{% endhint %}

## Getting Started

To get started using the TV player, head to our current beta URL, here: <https://token.script.tv/tv>. You should then see a page similar to this:

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

This shows a number of action items of the page.\
**Menu** - an opportunity to check out other channels (not currently available), get more information about the network, and view on chain data on the explorer page (data not currently correct)

**Banners** - These will change and update on rotation and feature everything from community messages to competition opportunities and new feature films / TV shows launching. Incidentally, there is a live Christmas Marathon happening for the next week, where users who watch over 3 hours a day has an opportunity to win $5,000 worth of SPAY.&#x20;

**Your Mini Dashboard** - Will feature data on your usage, including total minutes watched, most watched channel and the most common glasses you equip when watching content. This is currently a working feature.&#x20;

**TV player** - This will play content on the respective TV channel, 24/7. As you scroll down, the TV player will automatically shift into a mini window.&#x20;

**Live chat** - This will give an opportunity for users to connect live, whilst watching TV shows and films

<figure><img src="/files/5cDNvTRkWNjiPuwRRZcT" alt=""><figcaption><p>Electronic Programme Guide  (TV Schedule) - <strong>**This is not currently visible on most devices**</strong></p></figcaption></figure>

**Electronic Programme Guide (TV Schedule)  -** This is where you can switch channels, and view the upcoming TV shows and films over the coming hours. The timing at the top will match your timezone, and will run for the time that the respective show / film shows under the respective names. Like television you sit and watch on your sofa, this is NOT on demand television, and you do not have the ability to pause, skip or rewind. \
This allows there to be an exciting experience for all users and content partners, with the ability to launch NFTs or live quizzes during a film (spontaneously), and reward those who are watching at the time. **This is simply not possible on any other mechanism / platform built in web2 or web3 to date.**&#x20;

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

**ScriptGLASS stats** - Here will feature the key stats for ScriptGLASS. This is not currenly a workable feature.&#x20;


# Navigating the Script TV Dashboard (Test Phase)

{% hint style="info" %}
To avoid confusion - the dashboard is currently in live non-working beta - and full instructions will follow before the end of 2023 as to what all of the actions mean and how to interact with it. **Ultimately, most of it is for viewing purposes only.** \
\
Here will be full details as to how to Create a wallet, access the faucet, and interact with Script Testnet. This is NOT live yet and this message will remain here until it is. \
\
**To clarify once more, almost all action buttons across the profile / dashboard is not workable, and is currently for testing / viewing purposes only\*\***
{% endhint %}

The dashboard will act as the central hub as to where you can view everything from your most watched channel and glasses, to tracking your rewards in order to mint your free pair of Script Glasses.&#x20;

<div><figure><img src="/files/DWWfnzVYk6l6M28bYsyK" alt=""><figcaption></figcaption></figure> <figure><img src="/files/TmCyMvcjefDrhxHjoNCt" alt=""><figcaption></figcaption></figure></div>


# Testnet, Explorer + Creating a Wallet (Test Phase)

{% hint style="info" %}
There will be full details as to how to Create a wallet, access the faucet, and interact with Script Testnet. <br>
{% endhint %}

<div><figure><img src="/files/mGxmPvZe5inY1iO0zU5h" alt=""><figcaption><p>This Data is NOT accurate currently</p></figcaption></figure> <figure><img src="/files/jtBjUxh552IRw4Nyy5DE" alt=""><figcaption><p>Wallet app NOT functional currently</p></figcaption></figure></div>

Full details on how to create a wallet, is here: <https://medium.com/script-network/script-network-launches-v2-testnet-with-a-host-of-new-upgraded-features-7f1feca436d0>


# Reward System: Script Points, Zealy, Galxe + more

{% hint style="info" %}
**Important that this is read carefully. Script Points, Galxe and other platforms all have entirely different and rewards for them are completely seperate in the type of rewards given, the release schedule, and how they are accrued.**\
\
**You are encouraged to reach out on** [**our discord**](https://discord.gg/scriptnetwork) **should you have any questions in regards to it.**&#x20;
{% endhint %}

## Reward System&#x20;

Given that Script Network is and always will be focused on the wider user base, there are multiple different reward mechanisms / platforms that Script Network is connected and thus, there are multiple ways users can be rewarded. We have explained in more detail the 5 core reward mechanisms / platform in use.&#x20;

### <mark style="color:green;">**Script Points**</mark>&#x20;

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

\
**What is it?** This is currently live, but will be featured rewards that are available daily, by completing tasks (similar to that of a computer game), and earning points for it. This varies frorm watching 1 hour of content a day, to signing in everyday (and hitting 'claim'), alongside referrals. The key part of Script Points is it lives only on the platform - there is no other way to accrue Script Points anywhere else besides on the script.tv website.&#x20;

Watch 3 hours of content per day: This earns you (automatically)/ Total is 100 Script Points per day

Login Everyday: This MUST be collected by clicking the 'collect reward' button once a day. If you do not do this, you will not earn the points. Total is 10 Script Points per day.

Invite Friends: Head to the left hand side to view your referral code - this does not change. This code can be used for newcomers when they are signing up. Total is 20 Script Points per referral.

Speaking Live Chat: Talk with others daily in live chat. Total is 2 Script Points per day.

**When does it end?** This will be ongoing post token launch.&#x20;

**What is the benefit?** You will be able to, (subject to a community wide snapshot), convert Script Points to tokens. The conversion ratio is not confirmed.&#x20;

There are 4 current ways that you cane earn Script Points, but these ways will change and be modified in due course. For now, here they are:

### <mark style="color:green;">**Zealy**</mark>

<figure><img src="/files/9lCs2ApNBBI6X5HHXMRd" alt=""><figcaption></figcaption></figure>

**What is it?** This is currently live. Crew3 is an engagement platform which rewards users with XP points from completing numerous quests. These quests vary from following the Script Network twitter account, to completing video reviews of the platform. These quests vary in XP rewards and is consistently updated multiple times a week. The updates of these quests can be found in [the discord](https://discord.gg/scriptnetwork).&#x20;

**When does it end?** This will be ongoing til (at least), the end of Q2 2025.&#x20;

**What is the benefit?** The conversion ratio is not confirmed yet, however, all users with Crew3 XP, are guaranteed the opportunity to claim tokens. Tokens in this regard may be retroactive - meaning users who remain engaged may receive further rewards, with those who are not, missing the chance to claim.&#x20;

### [<mark style="color:green;">Galxe</mark>](https://galxe.com/ScriptNetwork)

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

**What is it?** [Galxe](https://galxe.com/ScriptNetwork) is more of an engagement platform, largely giving opportunity for users who was engaged at a given time, to earn a reward or OAT. Galxe will largely be used for event based activations - (partnerships, AMAs, and off chain activations)

**When does it end?** This is ongoing for now.&#x20;

**What is the benefit?** Usually gives a specific role, and access to specific channels, with many of them then bringing exclusive opportunities, and potential airdrops post launch. None of these specific rewards or airdrops in regards to Galxe is confirmed.&#x20;

### <mark style="color:green;">Script Network Competitions</mark>

<div><figure><img src="/files/iiHpZlvvse3JvzLhEZEs" alt=""><figcaption></figcaption></figure> <figure><img src="/files/miagNfIFhn4rfeZ2MIhO" alt=""><figcaption></figcaption></figure></div>

**What is it?** These are competitions Script Network largely runs across socials - Instagram, Twitter or Discord. They vary from quizzes, to trivia - with one of the longest running competitions being 'Guess the film' as shown above.&#x20;

**When does it end?** This is ongoing

**What is the benefit?** Cash or SCPT prizes at TGE.&#x20;


# ScriptGLASS - How to mint


# About Script Network

With television progressively turning into a cord-cutting, digital experience, Script.TV is focused on delivering a unique, industry-defining experience, using blockchain technology.

Although there are multiple options to consume content globally, Script.TV is the first to bring live television to the blockchain, with on-chain rewards through NFTs, gifts, and tokens by watching content every hour.

In this documentation, we have explained the functionalities, working mechanisms, and benefits of Script TV.

{% content-ref url="/pages/pXDOtUpaAvgFVcwryXhu" %}
[Introduction](/about-script-network/introduction)
{% endcontent-ref %}

{% content-ref url="/pages/K9O9nulP7cRLAYpD8Dwf" %}
[Products](/about-script-network/products)
{% endcontent-ref %}

{% content-ref url="/pages/J5LSHTeWvkPYd0BWrX3W" %}
[Why Script TV?](/about-script-network/why-script-tv)
{% endcontent-ref %}

{% content-ref url="/pages/unwxEjpHZSLa9Evmylae" %}
[How it works](/about-script-network/how-it-works)
{% endcontent-ref %}

{% content-ref url="/pages/75KA37KWDQPxUhFMltMF" %}
[Understanding the Script Blockchain](/about-script-network/understanding-the-script-blockchain)
{% endcontent-ref %}

{% content-ref url="/pages/wFtalh7tGLwqZOyZZkMv" %}
[Script TV + Web3](/about-script-network/script-tv-+-web3)
{% endcontent-ref %}

{% content-ref url="/pages/30QB4nhaR6kgER8mXINO" %}
[Benefits](/about-script-network/benefits)
{% endcontent-ref %}

{% content-ref url="/pages/jPn8GXFvo7vy7L0F8xdi" %}
[Comparison](/about-script-network/comparison)
{% endcontent-ref %}


# Introduction

Script TV is a decentralized video delivery network that furnishes an expansive range of blockchain-enabled solutions to the problems related to the traditional video-streaming sector. The platform offers high-quality video streaming as well as multiple incentive mechanisms for decentralized bandwidth and content-sharing at a reduced cost as compared to conventional service providers.

## **Script Network Defined**

Script Network is the leading video delivery network powered by blockchain technology.

**Script Network allows users to simultaneously watch video content and earn token rewards for relaying video to other users who are also watching the same content.**&#x20;

In the same vein as other sharing economy models, users opt-in to volunteering their spare bandwidth and computing resources to relay video to other users and earn token rewards for their contributions. Users can contribute to Script Network on any PC or Server. For video platforms, integrating Script Network into their video delivery stack enables them to reduce video delivery costs, deepen viewer engagement, and drive incremental revenues. By spending less on video delivery infrastructure, and more on rewarding their users, Script-enabled video platforms can grow their user base and gain market share.

## **About Script Blockchain**

The Script Blockchain is a purpose-built blockchain designed for video and data relaying from the ground up. Script’s unique multi-BFT consensus design combines a committee Validator Nodes with a second layer of community-run Validator Nodes. Validator Nodes propose and produce new blocks in the chain, while Lightning Nodes seal blocks and act as a check on malicious or non-functional Validator Nodes.

The Script blockchain mainnet enables the support for Turing-complete smart contracts. Smart contracts open up a new set of user experiences and attribution models for DApps built on the Script network.

{% hint style="info" %}
For example, leveraging smart contracts on the Script network could enable fully digitized item ownership, innovative payment-consumption models, transparent royalty distributions, trustless crowdfunding mechanisms, and much more. This provides an additional layer of social and economic interactivity that supplements the core functionality of video and data delivery and significantly increases the engagement and retention of platform users.
{% endhint %}

In addition to the Validator and Lightning Nodes, the Script community members also host the Script Node, which forms the **Script Network**, a fully decentralized network for data delivery and, more generally, computing. This new fully decentralized technology stack adds the ability to capture live video, transcode it in real-time, cache and relay live stream video data to users globally - all through Script’s P2P network run by thousands of community members. Not a single central server or service is used in this pipeline. This is a huge challenge and a huge accomplishment.&#x20;

The Script Token (SCPT) is the governance token of the Script protocol. SCPT is used to stake as a Validator and Lightning Nodes, contributing to block production and the protocol governance of the Script Network. By staking and running a node, users will earn a proportional amount of the new SCPT generated. The supply of SCPT is fixed at 1 billion and will never increase. SCPT is used for on-chain operations like payments to relayers for sharing a video stream, or for deploying or interacting with smart contracts. Relayers earn SCPT for every video stream they relay to other users on the network.


# Products

**Overview**

The Script Blockchain is a purpose-built blockchain designed for video and data relaying from the ground up. Script’s unique multi-BFT consensus design combines a committee Validator Nodes with a second community-run layer named Lightning Nodes. Validator Nodes propose and produce new blocks in the chain, while lightning Nodes seal blocks and act as a check on malicious or otherwise non-functional Validator Nodes. The Script blockchain enables the support for Turing-complete smart contracts that open up a whole new set of user experiences.

**Products**

Script Network is a layer one video protocol with its own ecosystem. Here are some of the products in the Script ecosystem.

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


# Why Script TV?

## **The Problems Associated With Video Streaming**

With the ever-increasing users on the internet, the shift from traditional TV broadcasting to online video streaming on smart devices has risen significantly. The most significant contributors to this exponential rise amid the pandemic are social media, online news, and video-on-demand (VOD) services.

This tremendous growth in demand for online content and the subsequent rise in data volumes being transmitted had already begun before the pandemic. However, as these figures continue to swell, traditional video streaming services and the infrastructure that supports them cannot cope with the rise in demand. A significant issue that content delivery networks (CDNs) face is ‘last-mile’ delivery problems resulting from these networks’ heavy dependency on cloud service providers.

To resolve the existing challenges, more widely distributed groups of servers that can cooperate in providing faster content delivery are being used. However, with this infrastructure, users can experience longer buffering times, packet loss, and even extended service downtime, ultimately resulting from complete system failures.

## **The Solution: Script TV**

All of the aforementioned problems can be theoretically solved with a community-operated video streaming platform backed by a decentralized peer-to-peer (P2P) network. With such networks, all content and data can be shared and distributed by participating nodes, which can be rewarded for their contributions using tokens and cryptocurrencies. This sharing of bandwidth by network users would not only overcome existing bottlenecking issues but would ultimately create a vastly more cost-effective, efficient, faster network.

{% hint style="info" %}
Further benefits include extremely secure & faster transactions, full transparency as well as traceability for transactions, immutability, automated trustless actions, and cryptographically protected data to protect and safeguard user privacy and security.&#x20;
{% endhint %}

**With Script TV, we intend to achieve similar goals.**


# How it works

**Step 1:** The Script Network consists of a token design, the governance token of the Script protocol.

**Step 2:** The whole network includes the two node layers: Validator and lightning.

**Step 3:** To come up with a complete setup of the Validator node, a user needs to stake at least 5,000,000 SCPT tokens.

**Step 4:** For lightning, the least amount of SCPT is 10,000 tokens, where that user will get approximately 5% of the total stake amount in a year as a reward.

## **Script TV B2B Model**

The advertisement model of Script.TV can benefit various crypto projects. Script.TV offers a transparent, open, and uniquely valuable alternative. Crypto projects and other businesses can easily advertise their services on Script.TV, going past most of the bureaucracy and regulation. Using the $SPAY token, companies can pay for marketing campaigns, thereby attaining rights to view, create, and track results from their ads.

{% hint style="info" %}
The most pivotal aspect of Script.TV is that ads created on this platform will offer more engaging and immersive experiences to users. Businesses can mint their own NFTs, leverage them as a promotional tool, and organize events, contests, and other live programs live on Script.TV channels.
{% endhint %}

Script.TV offers a unique solution for advertisers, and we are indubitably geared towards transforming advertisement into a social and interactive experience. Our B2B model can also serve the crypto community, accepting every legitimate crypto project and placing no restrictions.


# Understanding the Script Blockchain

The Script blockchain has been specifically architected to handle videos and the transmission of large packets of data. It has also been perfected for the scalability of users on a chain interacting with multiple areas. Furthermore, the Script virtual machine is compatible with the EVM or Ethereum virtual machine. This makes it easier for video-related products and services created on the internet to integrate with the Script platform.

## **Multilevel Blockchain**

Since the Script blockchain has a multi-level consensus program, it efficaciously enables thousands upon thousands of nodes to openly participate in the consensus process. The first level is known as the validator level. There is also a smaller subset of validators who will have the responsibility of processing transactions and creating blocks. The second level comprises the Lightning node operators and there are more than 1,000 Lightning node operators. They will verify and confirm the transactions processed by the validator nodes. The huge number of Lightning nodes means that all transactions will be confirmed and verified in a faster and more secure way. Nevertheless, the second level of the blockchain increases its integrity and reduces the chances of any false alarms.


# Script TV + Web3

While Web 1.0 and Web 2.0 furnished many possibilities for the global population, there were still many issues involved, such as data privacy, safety, centralization, and more. The problem is that we lost sovereignty of our data when large unified companies like Facebook began to own user data. Nowadays, the information we share on social media is used without our consent and sold to marketers to more efficiently target us as consumers or influence our political leanings.

## **ScriptTV: Bridging Video Streaming With Web 3.0**

Thanks to blockchain technology and the inception of Script.tv, we are now beginning to return to a more decentralized internet. It is the only viable solution that will allow us to regain control of our data, preserve rights for online privacy, and ensure the free flow of information.

Script.tv has the potential to revolutionize video streaming for television stations and broadcasts while providing the necessary infrastructure for web 3.0, allowing anyone to host video content and live streams in a decentralized manner.

Due to the immutability of the blockchain, Script.tv creators will have the creative liberty to post any content without the fear of being censored or de-platformed. Furthermore, Script.tv will offer a more affordable and robust storage system than cloud services. There won’t be any server downtime or security leaks/hacks related to central points of failure.

Another essential element of web 3.0 protocols like Script is establishing a fairer distribution of profits for content creators and rewarding users for helping maintain the platform’s functioning.


# Market Strategy

Script Network’s go-to-market strategy focuses on promoting and marketing to the film and content creator spaces on and offline. We aim to keep the user experience and product marketing as jargon-free as possible to attract the broadest possible audience. Script.TV is built on advanced blockchain technology, yet to the average user, the platform and its interface will feel familiar and intuitive in this design, Script.TV is positioned to bring a tidal wave of new participants into our video streaming ecosystem, as well as to the broader cryptocurrency market.

Our initial focus will be on bringing linear television onto the blockchain and leveraging NFT technology to create unprecedented connections between creators and consumers. We will also focus on solving two major problems within current platforms. Firstly, users cannot engage with each other and earn money for the content they consume. Secondly, currently, no television platform can pay users for watching video content.

{% hint style="info" %}
Broadly, our goal at Script.TV is to deliver an end-to-end television experience on the Script.TV blockchain. This includes storage, tokenization, original content production, NFTs, and integrating existing content into Script.TV with our content-managing system, profit-sharing framework, and much more.
{% endhint %}

## **Script.TV is developed in three phases:**

### Initial Phase&#x20;

• Script TV token site launch, Script TV entire site launch (beta)

• Token distribution (private and public round)

• Build market awareness and community

• Set up social channels, confirm initial partnerships

### Development Phase&#x20;

• Begin ad software test net, deploy ad rollout

• Scale the site from 3-5 channels to 25-30 channels, all 24/7, all with their style

• Develop easy on- and off-ramping methods

• Sign further multinational partnerships for content, strategy, and growth.

### Expansion Phase&#x20;

• Significant user growth

• Mobile app

• Mass adoption and usage

• Creation and development of Script Studios¬ – an original film and tv content production studio

We intend to work with many different influencers on promotional activity, live streams, and growth and build active communities on Reddit, Discord, Telegram, and Twitter. In these groups, we will hold weekly giveaways (through Twitter), polls, competitions, and loyalty rewards (Discord) and keep our community as up-to-date as possible (Telegram).


# Benefits

● **Greater Trust**:- With Script Network, you can rest assured that the data received is accurate and timely, and your confidential records will be shared with the network members who have access.

● **Reduced Costs**: Block chain's nature also can cut costs for organizations. It creates efficiencies in processing transactions. It also reduces manual tasks such as aggregating and amending data and easing reporting and auditing processes.

● **Speed**: Our network can handle transactions faster than conventional methods by eliminating the intermediaries and replacing the remaining manual process.

● **Proven Dependability**: You will want to build a proven Script Network platform that is already successful across the industries, with multiple use cases already in our production.

● **Greater Security**: All the network members are required to provide consensus on data accuracy; also, all of the validated transactions are immutable as they are permanently recorded. Not even the system administrator has the right to delete a transaction.

● **Earn Money:** Your computer and internet can earn money using video streaming. How? Our documentation can guide you to make money.


# Comparison

<table><thead><tr><th width="241">Attributes</th><th width="221">Bitcoin</th><th width="223">Ethereum</th><th width="222">Polkadot</th><th>Script Network</th></tr></thead><tbody><tr><td>Transactional Throughput</td><td>5</td><td>13</td><td>166</td><td>1000+</td></tr><tr><td>Transactional Finality</td><td>10 Min</td><td>5 Min</td><td>2 Min</td><td>2 Sec</td></tr><tr><td>Energy Efficient</td><td>No ASIC-Optimal</td><td>No GPU-Optimal</td><td>Yes CPU-Optimal</td><td>Yes CPU-Optimal</td></tr><tr><td>Number Of Validators</td><td>3 Pools w/51% hash rate</td><td>2 Pools w/51% hash rate</td><td>&#x3C; 200 nodes relay chain</td><td>10-15 nodes</td></tr><tr><td>Sybil Protection</td><td>Proof of work</td><td>Proof of stake</td><td>Proof of stake</td><td>Proof of stake</td></tr><tr><td>Storage Ability/Content</td><td>No</td><td>No</td><td>No</td><td>Yes</td></tr><tr><td>Safety Threshold</td><td>51%</td><td>51%</td><td>33%</td><td>80%</td></tr></tbody></table>


# Roadmap

&#x20;

### **Phase 1: Migration & Mainnet Launch**

* Merge $SCPT and $SPAY into a single token: **$SF**
* Launch of **Script Chain mainnet** with validator onboarding
* Begin token migration via claim portal
* Release **Dev Station** for developers to start building
* Community onboarding with watch-to-earn and referral campaigns

***

### **Phase 2: Core Platform Expansion**

* Launch **Ad Console**, creator dashboards, and analytics tools
* Expand **Script TV** mobile + smart TV apps globally
* Onboard major content partners and regional channels
* Grow validator + Lightning node network
* Roll out **SocialFi features** (fan tokens, tipping, chat)

***

### **Phase 3: Creator Economy & Governance**

* Launch **creator studio tools** and **ScriptSWAP marketplace**
* Open **Video API** for partners and apps
* Activate **DAO voting** for token holders on platform decisions
* Launch first **Script Studios original content**
* Deploy **AI film vaults** and autonomous content creation tools

***

### **Phase 4: Global Scaling & Full Decentralization**

* Fully scale to 1,000+ nodes and complete PoS validator network
* Complete all ecosystem tools: ads, analytics, creator monetization
* Launch large-scale creator projects and community governance
* Expand Script TV into a mainstream global streaming platform
* Drive Web2 to Web3 user adoption through content and partnerships


# Script Tokens

## **Script Tokenomics Overview**

ScriptTV uses a dual token system. The primary token, $SCPT, is used to power and govern the overall network, while $SPAY is responsible for transactions, gas fees, smart contract interactions, and rewards.

$SCPT is an BEP-20 / SRC-20 token that will be multi chain. Our community can stake $SCPT in exchange for multiple crypto rewards and NFTs, use it to manage the Script Network through our upcoming decentralized autonomous organization (DAO), or earn $SCPT by running a node and supporting the network amongst other utilities.

### Tokens

Script.TV will be a first-of-its-kind online TV platform in which both users and content publishers earn valuable tokens through video streaming. Script.TV will be a feature-rich application that provides users with round-the-clock entertainment through a range of exciting channels.

The network will use the blockchain-based Script token (SCPT) as a direct incentive for users to not only watch and discover great new content but also to contribute their computers’ bandwidth and memory to the network. Fundamentally this incentive mechanism is what powers the network and allows Script.TV to avoid the problems currently plaguing traditional streaming platforms.

Content partners earn SPAY tokens for every minute their content is watched on Script.TV and users earn SPAY tokens every time they watch programs on Script.TV. By operating and utilizing the Script. TV web app, any device can become a Script node able to earn users additional rewards for caching and distributing video data. $SCPT & $SPAY Storage

SCPT & SPAY are the two tokens on the Script Blockchain. To begin with, to ensure instant liquidity, ease of trading, and a platform to perform swapping with popular pairs at scale, SCPT will launch as an BEP-20/ SCR-20 token. This means that SCPT (and SPAY in the future) can be stored in popular wallets such as Metamask and Trustwallet.

Further down the line in our roadmap, we will perform a 1:1 conversion for SCPT and SPAY to the Script Blockchain. Users and content partners will have further flexibility on where to store SCPT and SPAY. Users and content partners can store, send and receive their tokens securely within their wallets on the Script Network. And as SCPT and SPAY are listed on more exchanges (both CEX & DEX), these will provide further storage options for users. Should users or content partners wish to store their tokens away offline, they will eventually be able to hold their tokens on hardware wallets.

## **Native Tokens**

The Script blockchain has two primary native tokens: the Script Token ($SCPT) and the Script Pay token ($SPAY). SCPT is a governance token used to stake the validator and Lightning nodes. On the other hand, SPAY, the utility token, is used to pay content consumers, reward node operators, and pay for transactions on the Script blockchain.

## **Types of Tokens:**

The SPAY and SCPT tokens were created to increase the platform's integrity. Moreover, they make it unlikely that the tokens will be stored for future sale. This deterrent to removing tokens from circulation and storing them in wallets means that the Script platform can keep more tokens in circulation and easily control their value.

**SCPT:** It is a dual-use token. It is used for governance and staking. There will be a maximum supply of 1,000,000,000 (1 billion) SCPT tokens.

**SPAY:** The SPAY token is used for compensations, rewards, and blockchain payments. Initially, there will be a supply 5,000,000,000 (5 billion) tokens. However, unlike SCPT, their supply is not strictly capped. New SPAY tokens will be minted and released into the market every year. The number of tokens that will be minted and released will depend on a protocol algorithm.

{% hint style="info" %}
SPAY tokens are supposed to be used in our everyday transactions. Their huge supply is supposed to keep their value low so that everyone can easily afford them. In addition, since more SPAY tokens are put into circulation every year, investors will not benefit from hoarding them. This means that platform users are better off using their tokens because if there is a glut of tokens on the market, their value will either remain the same or decline.
{% endhint %}


# SCPT

SCPT is a blockchain-based Script Token used by the Script network. As a multi-use token, it acts as a token of governance for producing and validating blocks and as a direct incentive for users.

To simplify the early stages and launch of Script.TV the initial SCPT token will be available as an ERC20 but will be available for migration later in the roadmap. The Validators will be selected from the holders who bought SCPT during the first-stage private sale, who then deployed their nodes and were screened on the Testnet.

Script. TV will use the SCPT Token as a direct incentive for users to not only watch and discover great new content but also to share their bandwidth and memory for videos, improving the overall stream quality for all users. In total, 1,000,000,000 SCPT utility tokens will be released. Initially, tokens will be issued on BNB Chain, and after the launch of the network, each token holder will receive native SCPT tokens on the new blockchain at a 1:1 ratio. The amount of the new SCRIPT blockchain tokens will also be limited to 1,000,000,000, and no new SCPT tokens will ever be issued.

**SCPT Utility**

<figure><img src="/files/R0v5HqBFnewR7WPMmGbH" alt=""><figcaption><p>SCPT Utility</p></figcaption></figure>


# Detailed SCPT Tokenomics

After completion of the IDO, the SCPT token will not be offered on the free market. From then, they will only be obtainable by becoming a part of the project's ecosystem (for example, as a validator).

**Ticker:** SCPT&#x20;

**Blockchain:** Script blockchain Token Supply: 1,000,000,000&#x20;

**Fully Diluted Valuation at launch:** $ 10 000 000

<table data-header-hidden><thead><tr><th width="301">Drivers</th><th width="163"></th><th width="149"></th><th width="141"></th><th width="140"></th><th data-type="files"></th></tr></thead><tbody><tr><td><strong>Drivers</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td><strong>Total token supply</strong></td><td><strong>1 000 000 000</strong></td><td></td><td></td><td></td><td></td></tr><tr><td><strong>Token Metrics</strong></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td><strong>Token holders</strong></td><td><strong>Distribution</strong></td><td><strong>Tokens</strong></td><td><strong>Token Price</strong></td><td></td><td></td></tr><tr><td>Seed Round</td><td>18,44%</td><td>184 444 000</td><td>0,00667</td><td></td><td></td></tr><tr><td>Alpha Round</td><td>1,05%</td><td>10 490 000</td><td>0,00715</td><td></td><td></td></tr><tr><td>KOL Round</td><td>3,75%</td><td>37 500 000</td><td>0,00800</td><td></td><td></td></tr><tr><td>Community Round</td><td>2,54%</td><td>25 380 000</td><td>0,00940</td><td></td><td></td></tr><tr><td>Public</td><td>6,49%</td><td>64 900 000</td><td>0,00940</td><td></td><td></td></tr><tr><td>Partnerships</td><td>2,50%</td><td>25 000 000</td><td></td><td></td><td></td></tr><tr><td>Team</td><td>10,00%</td><td>100 000 000</td><td></td><td></td><td></td></tr><tr><td>Advisors</td><td>3,00%</td><td>30 000 000</td><td></td><td></td><td></td></tr><tr><td>Product Development + Content</td><td>13,73%</td><td>137 286 000</td><td></td><td></td><td></td></tr><tr><td>Liquidity</td><td>5,50%</td><td>55 000 000</td><td></td><td></td><td></td></tr><tr><td>Network Seeding + Grants</td><td>9,00%</td><td>90 000 000</td><td></td><td></td><td></td></tr><tr><td>Marketing</td><td>15,00%</td><td>150 000 000</td><td></td><td></td><td></td></tr><tr><td>Community + Airdrops</td><td>9,00%</td><td>90 000 000</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Total supply Cumulative</td><td>100,00%</td><td>1 000 000 000</td><td></td><td></td><td></td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="212">Vesting Schedule</th><th width="142"></th><th width="138"></th><th width="146"></th><th width="162"></th><th width="149"></th><th></th><th data-hidden>1</th><th data-hidden>2</th><th data-hidden>3</th><th data-hidden>4</th><th data-hidden>5</th><th data-hidden>6</th><th data-hidden>7</th><th data-hidden>8</th><th data-hidden>9</th><th data-hidden>10</th><th data-hidden>11</th><th data-hidden>12</th><th data-hidden>13</th></tr></thead><tbody><tr><td><strong>Vesting Schedule</strong></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td><strong>Token holders</strong></td><td><strong>Comments</strong></td><td><strong>% TGE</strong></td><td><strong>Cliff (months)</strong></td><td><strong>Vesting(month)</strong></td><td><strong>Launch</strong></td><td></td><td><strong>3</strong></td><td><strong>6</strong></td><td><strong>9</strong></td><td><strong>12</strong></td><td><strong>15</strong></td><td><strong>18</strong></td><td><strong>21</strong></td><td><strong>24</strong></td><td><strong>27</strong></td><td><strong>30</strong></td><td><strong>33</strong></td><td><strong>36</strong></td><td><strong>Total</strong></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Seed Round</td><td></td><td>5,00%</td><td>3</td><td>12</td><td>9 000 000</td><td></td><td>0</td><td>5 383 333</td><td>5 383 333</td><td>5 383 333</td><td>5 383 333</td><td>5 383 333</td><td>5 383 333</td><td></td><td></td><td></td><td></td><td></td><td>34 000 000</td></tr><tr><td>Alpha Round</td><td></td><td>100,00%</td><td></td><td>0</td><td>10 490 000</td><td></td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td></td><td></td><td></td><td></td><td></td><td>5 350 000</td></tr><tr><td>KOL Round</td><td></td><td>20,00%</td><td></td><td>4</td><td>5 000 000</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Community Round</td><td></td><td>100,00%</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Public</td><td></td><td>100,00%</td><td></td><td>0</td><td>58 100 000</td><td></td><td>0</td><td>0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>95 000 000</td></tr><tr><td>Partnerships</td><td></td><td>5,00%</td><td>4</td><td>18</td><td>1 500 000</td><td></td><td>0</td><td>8 083 333</td><td>8 083 333</td><td>8 083 333</td><td>8 083 333</td><td>8 083 333</td><td>8 083 333</td><td></td><td></td><td></td><td></td><td></td><td>50 000 000</td></tr><tr><td>Team</td><td></td><td>0%</td><td>6</td><td>20</td><td>0</td><td></td><td>0</td><td>0</td><td>10 000 000</td><td>15 000 000</td><td>15 000 000</td><td>15 000 000</td><td>15 000 000</td><td>15 000 000</td><td>15 000 000</td><td></td><td></td><td></td><td>100 000 000</td></tr><tr><td>Advisors</td><td></td><td>0%</td><td>6</td><td>20</td><td>0</td><td></td><td>0</td><td>0</td><td>4 500 000</td><td>4 500 000</td><td>4 500 000</td><td>4 500 000</td><td>4 500 000</td><td>4 500 000</td><td>3 000 000</td><td></td><td></td><td></td><td>30 000 000</td></tr><tr><td>Product Development + Content</td><td></td><td>0%</td><td>4</td><td>20</td><td>0</td><td></td><td>0</td><td>30 000 000</td><td>45 000 000</td><td>45 000 000</td><td>45 000 000</td><td>45 000 000</td><td>45 000 000</td><td>45 000 000</td><td></td><td></td><td></td><td></td><td>270 000 000</td></tr><tr><td>Liquidity</td><td>Unlock 20% after 48H</td><td>20,00%</td><td>0</td><td>0</td><td>0</td><td></td><td>0</td><td>8 000 000</td><td>8 000 000</td><td>8 000 000</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>30 000 000</td></tr><tr><td>Network Seeding</td><td></td><td>0%</td><td>4</td><td>12</td><td>0</td><td></td><td>0</td><td>31 412 500</td><td>31 412 500</td><td>31 412 500</td><td>31 412 500</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>125 650 000</td></tr><tr><td>Marketing</td><td></td><td>0%</td><td>1</td><td>18</td><td>0</td><td></td><td>20 041 111</td><td>27 468 333</td><td>27 468 333</td><td>27 468 333</td><td>27 468 333</td><td>27 468 333</td><td>9 156 111</td><td></td><td></td><td></td><td></td><td></td><td>160 000 000</td></tr><tr><td>Community + Airdrops</td><td></td><td>0%</td><td>6</td><td>12</td><td>0</td><td></td><td>0</td><td>0</td><td>22 916 667</td><td>22 916 667</td><td>22 916 667</td><td>22 916 667</td><td></td><td></td><td></td><td></td><td></td><td></td><td>100 000 000</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Circulating supply excl Liquidity</td><td></td><td>96 960 000</td><td></td><td></td><td></td><td></td><td>32 645 555</td><td>104 964 167</td><td>159 464 167</td><td>164 464 167</td><td>156 464 1125</td><td>125 051 667</td><td>81 739 444</td><td>64 500 000</td><td>18 000 000</td><td>0</td><td>0</td><td>0</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>105 415 555</td><td>210 379 722</td><td>369 843 889</td><td>534 308 055</td><td>690 772 222</td><td>815 823 889</td><td>897 563 333</td><td>962 063 333</td><td>980 063 333</td><td>980 063 333</td><td>980 063 333</td><td>1 000 000 000</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>10,54%</td><td>21,04%</td><td>36,98%</td><td>53,43%</td><td>69,08%</td><td>81,58%</td><td>89,76%</td><td>96,21%</td><td>98,01%</td><td>98,01%</td><td>98,01%</td><td>100,00%</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>


# SPAY

SPAY is the operational token of the Script.TV blockchain is used as “gas” and for rewards. SPAY tokens total circulation will be 5,000,000,000.

When the blockchain goes to mainnet, SPAY will launch. Unlike the SCPT token, the SPAY token can only be obtained by engaging in the Script Network ecosystem or by purchasing it on the public market (CEXs). Users can earn SPAY tokens through our ScriptGlass watch to earn reward mechanism which has an earning protocol for those who watch TV on the platform.&#x20;

SPAY token will be highly liquid; therefore, an annual increase in supply starting from the second year will be set at a rate of 9%. In order to avoid the devaluation of SPAY due to the annual token volume growth, about 25% of each transaction fee will be burned at the protocol level. This will become the cost of using the network and balance the price and volume of SPAY tokens.<br>

**SPAY Utility**

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


# SPAY Tokenomics

## Overview

The workflow of the protocol is that of a Watch to Earn. The user comes onto the protocol and can mint three types of glasses namely, a) Common, b) Rare, c) SuperScript. The three types of glasses currently have two base attributes i.e. a) Durability and b) Gem tier. The durability of the glass increases as it levels up and the gem tier increases as gems are integrated with the glass. SPAY tokens have to be burned to mint the glass, therefore glass mints are compulsory burnable events.

\
Initially, to onboard users on the platform, the protocol will follow a freemium model and 100,000 common glasses will be minted for free. These common glasses will have a fixed allowable watch time and will yield a fixed payout i.e., similar to a base common glass with no gems. However, the user will not be able to add gems or upgrade the free mint common glass beyond level 5.

\
The free mints phase will operate simultaneously with paid mints. To differentiate the free mint from the paid ones, there are certain milestones that are pegged to watch time which allows the user to modify their glasses and enhance their reward/unit energy. Users can watch content on the platform for as long as they want, however, there are limits to the daily watch time to earn SPAY tokens.

\
Glass levels up after a certain milestone (watch time) is achieved. As levels increase, the daily watch time limit increases which means that the user can earn more rewards each day. The durability of the glass also increases automatically as it levels up, this further increases the daily allowable watch time for the user for which SPAY tokens can be earned.

\
Users can also earn SPAY tokens by integrating gems with their glasses. Users can purchase these gems with SPAY tokens after they reach a certain level, the proceeds obtained from the purchase will be burned. Users with gems integrated into their glasses will be eligible for weekly/monthly SPAY reward pools.

\
Recharge vouchers add to the gamification element in the protocol and also serve as an incentivization mechanism for the users to upgrade their levels in order to avail of a discount on their recharge cost. To mint the recharge voucher, the user will have to burn their SPAY tokens. This is an optional burnable event as the user can choose not to purchase the recharge voucher after the eligibility criteria are met.\
\
Full tokenomics and vesting, here:  <https://docs.google.com/spreadsheets/d/1OQVOWCdUbZb1-MObbvocX3bpw9USUSnopVxC8PWVPec/edit?usp=sharing>\ <br>

| Allocation             | Allocation % | Cliff (in Months) | Vesting (in Months) | % Unlocked TGE |
| ---------------------- | ------------ | ----------------- | ------------------- | -------------- |
| ScriptGLASS Rewards    | 40.00%       | 0                 | 36                  | 10.00%         |
| Ecosystem              | 7.00%        | 3                 | 18                  | 0.00%          |
| Validator Node Rewards | 5.00%        | 3                 | 36                  | 0.00%          |
| Lightning Node Rewards | 20.00%       | 3                 | 36                  | 0.00%          |
| Edge Node Rewards\*    | 3.00%        | 3                 | 36                  | 0.00%          |
| Liquidity              | 10.00%       | 0                 | 0                   | 100.00%        |
| Airdrops               | 13.00%       | 0                 | 0                   | 100.00%        |
| Public\*               | 2.00%        | 0                 | 0                   | 100.00%        |


# Page

<table data-header-hidden><thead><tr><th width="258"></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Drivers</strong></td><td></td><td></td></tr><tr><td><strong>Total token supply</strong></td><td><strong>5 000 000 000</strong></td><td></td></tr><tr><td><strong>Token Metrics</strong></td><td>Inflationary (9-10% per year approx)</td><td></td></tr><tr><td><strong>Token holders</strong></td><td><strong>Distribution</strong></td><td><strong>Tokens</strong></td></tr><tr><td>ScriptGLASS Rewards </td><td>50,00%</td><td>2 500 000 000</td></tr><tr><td>Ecosystem </td><td>7,00%</td><td>500 000 000</td></tr><tr><td>Validator node rewards</td><td>5,00%</td><td>150 000 000</td></tr><tr><td>Lightning node rewards</td><td>20,00%</td><td>400 000 000</td></tr><tr><td>Edge node rewards</td><td>2,00%</td><td>100 000 000</td></tr><tr><td>Marketing Reserve</td><td>10,00%</td><td>500 000 000</td></tr><tr><td>Liquidity</td><td>5,00%</td><td>250 000 000</td></tr><tr><td>Airdrops</td><td>12,00%</td><td>600 000 000</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Total supply Cumulative</td><td>100,00%</td><td>5 000 000 000</td></tr></tbody></table>


# ScriptGLASS explained

ScriptGLASS is the NFT collection which is directly integrated to the watch-to-earn protocol within ScriptTV. At least 1 pair of ScriptGLASS must be equipped to watch and earn on a day to day basis. Beyond each glasses being aesthetically unique in color and design, each has a specific rarity which affects how much a users could possibly earn on a day to day basis. When watching content, users will need to re-charge their glasses, upgrade to higher levels (to earn more per day), buy a gem (for multiplier and raffle opportunities), and loot boxes (which is only available to glasses who reach an advanced level).&#x20;

To ensure a smooth experience for all new users, the first mint of ScriptGLASS will be free, and only require the account to accumulate 1,000 points to mint their first pair of glasses and begin collecting rewards.

ScriptGLASS, (beyond its utility and having upgradeable properties), is unique to each mint. This means users will have their own unique glasses in size, shape, material, color or even type - with some of those respective attributes having a bearing on the amount of rewards the user can accrue a day, and some of the on and off chain rewards that is available to them. Whilst users are encouraged to have an array of different glasses in their inventory for this very reason (amongst others), the reward mechanism is completely sustainable for the user when owning just one pair of glasses.

<figure><img src="/files/3LyHWCbJOXv2TDY1dGuV" alt=""><figcaption><p>how the ScriptGLASS experience works</p></figcaption></figure>

In this layout, it shows the simplified flow in claiming the first ScriptGLASS NFT, to earning $SPAY tokens for the first time. To accompany this, here is some further written steps.

1. The user signs up to an account with Script Network. Once signed up, the user verifies their email address.&#x20;
2. There is now an array of options on the dashboard of tasks that can be completed to yield what is known as 'Script Points'. Albeit frequently being updated, these tasks are largely straight forward, including signing in regularly, watching tv and referrals. Once some tasks are completed and the user has accumulated 1,000 points in their account, they now have enough points to mint their first ScriptGLASS
3. If 1,000 points has been accumulated, a green 'mint' button will become available towards the top of the dashboard, which the user can click and mint. The mint is randomized.&#x20;
4. Once the user has the glasses, they can now equip them, head to the tv player and watch content whilst earning $SPAY tokens.&#x20;
5. After some sessions, the glasses will need to be re-charged, alongside levelled up perhaps, so more can be earned per day. This, amongst other reasons, will cause the user to initiate a burn of some of the $SPAY tokens accrued.&#x20;
6. The tokens they keep hold of, will go into a 14 days vesting claim cycle. This is still 100% owned by the user, but not transferrable or tradeable until the 14 days are elasped.&#x20;
7. After 14 days, those respective $SPAY tokens are now released and users can trade those tokens, or, burn them to upgrade their glasses faster.
8. Users who want to skip the upgrading of their own minted glasses, can simply go to the marketplace and purchase an upgraded pair of glasses from another user, purchasable in $SPAY, $BNB or $ETH
9. Extra tokens accrued can be burned for other off chain rewards, to reward those who are still being active in the ecosystem throughout time.&#x20;
10. Stay active in the ecosystem and earn spontaneous rewards which can then be exchanged for real life events.&#x20;


# Economics

## Demand

The demand for the SPAY token has three compulsory drivers:

1\) Minting

2\) Recharging

3\) Buying gems

These three compulsory drivers are what the protocol calls mandatory burnable events, which will ensure that SPAY’s supply doesn’t inflate beyond control. One optional burnable event is purchasing recharge vouchers.

## Supply

The supply of SPAY tokens has one driver, i.e., payouts upon watching the content. These payouts are structured so that the user earns net positive SPAY each time they watch content, and at the same time, the protocol isn’t in a cumulative net loss. The supply is offset by burnable events, which are compulsory to execute if the user intends to earn by watching the content.


# Allowable/Earnable Watch Time

To control the overall emissions of the reward token, there are specific caps on the daily watch time, which vary across glass types. This means each glass holder, whether common, rare, or superscript, has a daily watch limit for which the payout can be earned. When a user reaches the limit for the day, he cannot make more in a payout. However, he can still keep watching content without any rewards. This allowable/earnable watch time is different for each glass type, and it can be seen in the following table:

| Type of Glass | Max Allowable/Earnable Watch Time (in mins at max level) |
| ------------- | -------------------------------------------------------- |
| Common        | 960                                                      |
| Rare          | 1020                                                     |
| Superscript   | 1080                                                     |

## Locking Amounts

To be a part of the ecosystem and watch content on the platform, the user has to lock a certain amount of SPAY in the protocol. This holds for both free and paid mints. However, the amounts will differ based on the mint's nature. The quantities required to lock in each glass type are shown in the table below (these numbers are here for example purposes only)\*:

| Type of Glass     | Minting Cost                                    |
| ----------------- | ----------------------------------------------- |
| Common (Freemium) | 50 SPAY or mintable for free with Script Points |
| Common            | 200 SPAY                                        |
| Rare              | 350 SPAY                                        |
| Superscript       | 700 SPAY                                        |

For the freemium model, the locking period will be 30 days, after which the user can claim the SPAY initially deposited. For the paid mints, the user will lock SPAY to be a part of the ecosystem. The deposited SPAY can only be unlocked when the user wishes to exit the ecosystem. To watch content on the platform and earn tokens, the user has to lock a certain amount of SPAY as an initial investment.

## Content Voting Rights&#x20;

To establish a feedback system for the user and improve the platform's services, a voting mechanism is introduced in the protocol. The voting mechanism allows users to vote on new content being added to the platform. The process is straightforward. Voting will occur after a specific time, and to be eligible to vote, the user has to burn a certain amount of SPAY tokens. The more tokens burnt, the more voting power the user holds. The burn cost will increase by a certain percentage each voting period. It is essential that 80% of the glass holders vote on adding new content to the platform at any point in time. If users don't vote and the threshold amount is not attained, the protocol will burn tokens to do the voting and select content on its own.

## Disincentivization Mechanism/ Potential Sybil Attacks

Since the token's value is directly related to the number of content people watch on the platform, it is essential to disincentivize users who hold glasses and do not consistently watch content on the platform. This problem not only halts network adoption but also reduces rewards for the existing users by lowering the demand factor. To cater to this issue, the protocol monitors users' watch time every week. If the cumulative watch time of a glass (user) is below a certain threshold, the protocol will auction the NFT on the secondary market.

The protocol will use a certain percentage of proceeds to burn the tokens, and the remaining proceeds will be returned to the user. The protocol will ensure that the time set for the auction factors in the exceptional circumstances or events when the user is not able to watch content on the platform.


# Mechanism Design of Glasses

This documentation elucidates the working mechanisms and functionalities of the following:

{% content-ref url="/pages/dduY66Ep0fF7blbXyFib" %}
[Glass Types](/script-tokens/spay/mechanism-design-of-glasses/glass-types)
{% endcontent-ref %}

{% content-ref url="/pages/i7AWXbXQlTpv1Ox6IzNf" %}
[Glass Payouts](/script-tokens/spay/mechanism-design-of-glasses/glass-payouts)
{% endcontent-ref %}

{% content-ref url="/pages/1VVDmD71eVph0C60OjRM" %}
[Gems](/script-tokens/spay/mechanism-design-of-glasses/gems)
{% endcontent-ref %}

{% content-ref url="/pages/M4ZJlCvm0fDWoJeI9I6L" %}
[Levels](/script-tokens/spay/mechanism-design-of-glasses/levels)
{% endcontent-ref %}

{% content-ref url="/pages/FVLm7JX2AEW8HBwGAsZM" %}
[Recharge Vouchers](/script-tokens/spay/mechanism-design-of-glasses/recharge-vouchers)
{% endcontent-ref %}

{% content-ref url="/pages/e4APowVOZyV8gUODPMBr" %}
[Glass Minting](/script-tokens/spay/mechanism-design-of-glasses/glass-minting)
{% endcontent-ref %}

{% content-ref url="/pages/CiWulozr00OI9ulVS3R9" %}
[Recharge Costs](/script-tokens/spay/mechanism-design-of-glasses/recharge-costs)
{% endcontent-ref %}


# Glass Types

There are three glass types, i.e., common, rare, and superscript. A summary of all glass types and relevant attributes is shown in the following table:

<table><thead><tr><th width="188">Type</th><th>Max Allowable Watchtime per day (in minutes)</th><th>Reward that can be earned by maxed out common glass per day (in SPAY)</th><th>Max Reward Rate Per Minute</th></tr></thead><tbody><tr><td>Common</td><td>960</td><td>39.60</td><td>0.0413</td></tr><tr><td>Rare</td><td>1020</td><td>52.80</td><td>0.0518</td></tr><tr><td>Superscript</td><td>1080</td><td>66.00</td><td>0.0611</td></tr></tbody></table>

Each glass type offers incremental benefits over the other, i.e., a rare glass provides more benefits in terms of a net payout than common glass, and a superscript provides better rewards than a rare one. The glass types are differentiated based on payouts, so the users are incentivized to hold a higher glass type.

**However, the composition of glasses is such that there are 70% common, 25% rare, and only 5% superscript glasses, which consequently makes superscript glasses more valuable than rare.**

Although superscript glasses offer a significantly larger payout as compared to the other ones, they represent only 5% of the total number of glasses minted.


# Glass Payouts

Each glass type has specific base attributes that differentiate them from each other.

**These attributes affect both the payout and daily allowable watch time of the user.**&#x20;

There are two attributes associated with each glass type, i.e., durability, and luck.  Durability and luck both increase automatically as glass levels and type increase, The payout equation is given as:<br>

<figure><img src="https://lh3.googleusercontent.com/WJDV8331z58Df3B27I1N4cassfnZkBhZ583x7Tzw0jed4CTTWMZQ1VYERzNp4IzT7nnTH_2Dib4Zhl91q2CecFfca5OmX87m7o3fjaIv_RiMa7MqF_I-5gR1s77g0wRE3KUMOZhcdc2mCCf-WjRjLR_B7VC2Y-efdhHhmWt_ny2mza35htAizufaSq_Z3g" alt=""><figcaption></figcaption></figure>

TOG = 1,2 or 3. Where 1 represents common glass and 3 represents Superscript

Level = The level the glass is currently at.\
K = Durability constant. The durability constant is the number of additional minutes a user can watch when they level up.

A = It is the constant number a user can fully charge their glasses in a day.&#x20;

The number 20 represents 20 mins which is essentially the base amount of minutes on a freshly minted glass.

<figure><img src="https://lh5.googleusercontent.com/Z1DaREiwdncCX-_zITN64RfEIMOEaouTLBtVc7_KMRzfRKyR5aX4Lg4uvycPjlS1aCfkYjRw1daaqDoSQZ3NuZminm45PQK4pkQLxVkxvWhUW7JSsuvjl8GP4nax0_mUe_uFKbijCoGOzADdZJW4t_OcE_BPZOJyJfcwJ_z4DIl202PuacxG81u3HQuLog" alt=""><figcaption></figcaption></figure>

Where Rmax is the max reward that can be earned by a maxed-out glass and Tmax is the max allowable watch time in a day for a maxed-out glass given a certain glass type.

<figure><img src="https://lh4.googleusercontent.com/O1wV0mkRY320Hs8ZLXcJBI67M-ng8sC-rDmEosdybXovEAkKlHskGM9CZUrKdsbuiIUxLZqQZFgM7w9MKICRLUzG57FGOM5hADhy7G9cHFQEUnEJf3rtV4G56-sjfUxj4rzgVBooyEUwPZlZTNg-gQuNF7mEJqPDi53v_KmESB7aqvFuAQp-jtHs-hEHcQ" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh6.googleusercontent.com/sT0S9GBBqoGXG8b54-tUpxGfpeHLdeczW8yuUyU0OVyOGLWWJMm_h1LaMGNSUz3DFwx0lxbJ6BWscZR45DesRXaZhv2_J6uQt6uDsKh-WVSHgk2-hfUC2dPHOAhC4UkOIb5NUvYrEzEh74Ujkf75gajGDYXitYYLBP83yVBvbRzycT5YjHXgnQkli0P3Ew" alt=""><figcaption></figcaption></figure>

Note that all the payouts will be vested for a period of 14 days. Users can view their rewards but cannot claim them until the grace period is completed.


# Durability

Glass durability refers to the amount of time a user is able to watch content in a single energy depletion. The durability of a glass increases with levels and across glass types.

This graph illustrates the difference in maximum watchable time/full depletion of glasses between each type of glass across levels 1-30. The difference is due to the base durability being higher for glasses on a higher level which leads to a longer watchable time.<br>

<figure><img src="https://lh3.googleusercontent.com/6fA7uK7-9CXYRUDX_2bKC7i9IRaULU1M5Q_nlXVFO1-3tarS0Bt6nE1iixBJgxfuJj26c54OSZ7xMwGvqf7K8OEWpJ5syXwGyiYxQEsuKBuh8fTlW9EkMwTejVNUpEGXXje1jzfJXqRl7NWni4FNpGnSjd79Hca9qofchPQUK9fQLorBXLmN5GNGcjqOcw" alt=""><figcaption></figcaption></figure>


# Gems

There will be three gems each being unlocked every 10 levels such that gem 1 unlocks at level 10, gem 2 at level 20 and gem 3 at level 30. Users will have to buy gems from SPAY tokens and the proceeds will be burned. Users with gems will be eligible for weekly rewards. The protocol will have three reward pools for each gem level. The amount of SPAY to be funded to each of the pools will be dynamic and initially determined by the protocol. Each user holding a gem will be eligible to obtain a share of the reward pool based on the watch time. The reward distribution formula is defined as:

<figure><img src="https://lh4.googleusercontent.com/uPxHQKUL38HLe-obEvKORMYZXTDf4UfS1szjckMxsBarrKoivbGms4eu4oKjXEwhZFfgGx8IY6XA1ks9LvUeCKyVAkmfqgln-bc6PAZUv5LoRTrUPDXeC0XpKKaQsxro1ioXkSD4WOa33bFmePZJ90GuOm05lFQC6DN0O94z8mydOOHFoYLDMPWXS6Cvuw" alt=""><figcaption></figcaption></figure>

The reward is for a defined time period. ‘Wu’ is the watch time of the user i.e. the number of minutes the user has watched over a given time period. ‘Wt’ is the total watch time on the protocol by all users holding the gem of that particular tier. ‘P’ is the amount of SPAY in the reward pool and ‘n’ represents the gem tier.


# Levels

One of the most crucial aspects of the protocol are the levels of the protocol upon which the user levels up. In the protocol the user can’t just buy their way to the top, instead, they have to actually watch the content to level up.

The below graph visualises the time required for each glass type to watch in order to increase their level

<figure><img src="https://lh4.googleusercontent.com/H0oT-uwePApG-EgMYJHOkRoB9h0KX3PFT51TW4vCB67J3HuWR-tAsN4fZwVCe3EU2YgGMT9eN-hODI-vuFXakSGlb5ieUs042GbX3dtXi5n_lEYnPzM07de59hm3WiR7VzbiltVVOuhz1Eu28SG7cOB3mYr-ZBKxF3FrWN9BR8-7SOJoPcbUzdvsV8QJ_Q" alt=""><figcaption></figcaption></figure>


# Recharge Vouchers

Recharge vouchers add to the gamification element in the protocol and also serve as an incentivization mechanism for the users to upgrade their levels in order to avail of discounts on their recharge costs. Users can integrate the voucher with their glasses and enjoy a certain percentage of discount each time they recharge their glasses.


# Recharge Voucher Mechanism

Upon reaching level 20, top users of the platform will be eligible to mint recharge vouchers. These vouchers can be used for a discount on the recharge cost. However, initially, there will only be a limited number of vouchers for each glass type so that only the true users of the platform are incentivized. Below is the number of recharge vouchers available for each glass type:

| Glass Type  | SPAY Amount to be Burned |
| ----------- | ------------------------ |
| Common      | 300                      |
| Rare        | 200                      |
| SuperScript | 100                      |

The discount percentage from the recharge voucher will vary based on the glass type. Common glass holders will receive less discount as compared to rare and superscript. The composition is given below:

| Glass Type  | Discount % |
| ----------- | ---------- |
| Common      | 10%        |
| Rare        | 20%        |
| SuperScript | 30%        |

Eligible users can mint recharge vouchers using SPAY tokens. The proceeds from the mint will be burned. Users can either integrate these vouchers with their glasses and earn a discount on their recharge cost or they can sell it at the marketplace for ETH/BNB. The mint costs for each glass type are shown:

| Glass Type  | Mint Cost (Amount in SPAY) |
| ----------- | -------------------------- |
| Common      | 250                        |
| Rare        | 500                        |
| SuperScript | 800                        |

The mint costs and the number of recharge vouchers are modifiable and can vary based on other protocol parameters.


# Recharge Costs

The recharge costs are set as a % of the payout for each glass. However, to avoid the problem of divergence between the recharge cost and the rewards and to increase the net profit margin upon leveling up, the initial recharge cost for the three types of glasses are in descending order. Recharge cost is in the order; Common>Rare>Superscript

<br>

<figure><img src="https://lh4.googleusercontent.com/n5syROb03OdMSqUv7rjLB-Q7GMOxyHVxVjRx8oraXvxkL2hqjlYRCmye3EnambaYnMTnL6kVx_cZ28TBEX96mEWoLl_AJw8niDdka0xANpivdWgOcvP8SCAOlFwfp_xC3-k7QwSybEeHRt7zYmeWI2cnVh5PLMH4rK5OheV7j6eLI0g1pXf5_BBmhXtVkA" alt=""><figcaption></figcaption></figure>


# Glass Minting

The mint costs of the glasses are designed to avoid the possibility of a user disposing of their glasses (By listing them at an NFT marketplace or just not using it). The mint cost is designed to be affordable for the users which consequently makes it easier to enter the system and earn rewards.

| Type of Glass | Minting Cost |
| ------------- | ------------ |
| Common        | 10 SPAY      |
| Rare          | 20 SPAY      |
| SuperScript   | 30 SPAY      |

The glasses can only be purchased using SPAY and the mint proceeds will be burned. However, the secondary marketplace trading of glasses will only be facilitated in BNB/ETH. The royalties will also be collected in BNB/ETH.

In the case of free mints, users have to accumulate a certain amount of points. These points can be obtained through different protocol activities such as referrals, watching content, etc. Upon collecting the required amount of points, the user gets a free common glass NFT.


# Game Theory

1. Free mints are the first aspect of game theory incorporated in the protocol. The free mints model allows 100,000 common glasses to be minted free of cost. These glasses will have a viewing time constraint like all other glasses but will not be able to level up beyond level 5. These glasses are solely made for network adoption and are essentially free rewards for the user. The glasses would need to be recharged like all other glasses and they will be minted out in different phases.
2. Since recharge cost is a percentage of the payout, it is specifically designed to decrease as the levels increase across different glass types. This is done to ensure that the net profit margin always increases for the user as he watches more content and the glass levels up.
3. As levels increase, the number of watch time required to level up increases which consequently increases the number of recharges executed by the user. This ensures that the amount of SPAY being burned increases as users level up and watch more content.
4. Gems are incorporated in the system to provide additional rewards to the user. To keep the SPAY emissions in control and sustain its value, gems are not a direct function of the payout equation.
5. The watch time required to level up differs across glass types such that a superscript glass has to watch more content than a common and rare glass in order to level up. However with more watch time comes more reward, if a superscript watches more content, its reward will be higher than the other two glass types. This is done to ensure two things:

a) Emissions are kept in check all the time.

b) Net margins keep increasing across glass types and through levels.


# For Users

This documentation is meticulously crafted for Script TV users, enabling them to understand the concept and navigate through the platform with ease and simplicity. Here are the topics to get started:

{% content-ref url="/pages/n4n0xoUy7glMwMSiZjM9" %}
[Basic Concept](/for-users/basic-concept)
{% endcontent-ref %}

{% content-ref url="/pages/zh7W6FP3cW5SPMRq3tT2" %}
[Tokens](/for-users/tokens)
{% endcontent-ref %}

{% content-ref url="/pages/3sBPjErM8Z77P3wZYnVN" %}
[Script NFTs](/for-users/script-nfts)
{% endcontent-ref %}

{% content-ref url="/pages/6Z6LyA9WKEPZnaJrjOAW" %}
[Transactions](/for-users/transactions)
{% endcontent-ref %}

{% content-ref url="/pages/v834f0jY8mPYRwFaod2H" %}
[Script Wallet](/for-users/script-wallet)
{% endcontent-ref %}

{% content-ref url="/pages/h3Upl242kfu5wIomMngg" %}
[Smart Contracts](/for-users/smart-contracts)
{% endcontent-ref %}


# Blockchain Integration

Find the steps for setup and installation in the sub sections.

{% content-ref url="/pages/EEkTfTS7xNSsf5hmyGto" %}
[Installation guide for Script Node setup for Win , Mac and Linux](/for-users/blockchain-integration/installation-guide-for-script-node-setup-for-win-mac-and-linux)
{% endcontent-ref %}

{% content-ref url="/pages/Q80b0UvYHMWw2lNbZPGL" %}
[Build and Install](/for-users/blockchain-integration/build-and-install)
{% endcontent-ref %}

{% content-ref url="/pages/Nsizm18nyapr5SJD5z0W" %}
[Run Unit Tests](/for-users/blockchain-integration/run-unit-tests)
{% endcontent-ref %}

{% content-ref url="/pages/DJoKfDONtpvELZQ2iDC3" %}
[Launch Script Node](/for-users/blockchain-integration/launch-script-node)
{% endcontent-ref %}

{% content-ref url="/pages/sTTkhjWv13qM3Gsw1NLF" %}
[Command Line Tool](/for-users/blockchain-integration/command-line-tool)
{% endcontent-ref %}

{% content-ref url="/pages/CYJhIQFV4KgmsROgveAs" %}
[Steps To Upgrade The Chain](/for-users/blockchain-integration/steps-to-upgrade-the-chain)
{% endcontent-ref %}

{% content-ref url="/pages/f9RqqvWExMc0M4uixkp6" %}
[Account/Wallet Management](/for-users/blockchain-integration/account-wallet-management)
{% endcontent-ref %}

{% content-ref url="/pages/AD1oP0zzTEnIT0ImBgVv" %}
[Call Smart Contract](/for-users/blockchain-integration/call-smart-contract)
{% endcontent-ref %}

{% content-ref url="/pages/eXFfAXKU8qNFK6pE7Vtm" %}
[Turing-Complete Smart Contract Support](/for-users/blockchain-integration/turing-complete-smart-contract-support)
{% endcontent-ref %}


# Installation guide for Script Node setup for Win , Mac and Linux

## **Step 1 - \[ Setup Go Environment ]**

&#x20;$ sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install build-essential

&#x20;$ wget <https://go.dev/dl/go1.17.4.linux-amd64.tar.gz&#x20>;

&#x20;$ rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.4.linux-amd64.tar.gz&#x20;

&#x20;$ echo 'export PATH=$PATH:/usr/local/go/bin' >> \~/.profile&#x20;

&#x20;$ echo 'export PATH=$PATH:/usr/local/go/bin' >> \~/.bashrc&#x20;

&#x20;$ echo 'export SCRIPT\_HOME=/usr/local/go/src/github.com/scripttoken/script' >> \~/.bashrc&#x20;

&#x20;$ echo 'export SCRIPT\_HOME=/usr/local/go/src/github.com/scripttoken/script' >> \~/.profile&#x20;

&#x20;$ source \~/.bashrc && source \~/.profile

## **Step 2 - \[ Setup Node ]**

$ mkdir -p /usr/local/go/src/github.com/scripttoken/ && cd /usr/local/go/src/github.com/scripttoken/ git clone <https://github.com/scriptnetwork/Node-Network-guide.git> script

{% hint style="info" %}
Note: Code is there on main branch so it can be clone directly without switching any branch using github&#x20;
{% endhint %}

$ cd $SCRIPT\_HOME


# Build and Install

**Launch Script Ledger node**

(A) This should build the binaries and copy them into your $GOPATH/bin. Two binaries script and scriptcli are generated. script can be regarded as the launcher of the Script Ledger node, and scriptcli is a wallet with command line tools to interact with the ledger.&#x20;

$ export GO111MODULE=on&#x20;

$ make install

{% hint style="info" %}
**\*Notes for Linux binary compilation**

The build and install process on Linux is similar, but note that Ubuntu 18.04.4 LTS / Centos 8 or higher version is required for the compilation.
{% endhint %}

{% hint style="info" %}
**\*Notes for Windows binary compilation**&#x20;

The Windows binary can be cross-compiled from macOS. To cross-compile a Windows binary, first make sure mingw64 is installed (brew install mingw-w64) on your macOS.&#x20;
{% endhint %}

Then you can cross-compile the Windows binary with the following command:&#x20;

&#x20;   $ make exe&#x20;

&#x20;You'll also need to place three .dll files libgcc\_s\_seh-1.dll, libstdc++-6.dll, libwinpthread-1.dll under the same folder as script.exe and scriptcli.exe.


# Run Unit Tests

Run unit tests with command line

`$ make test_unit`


# Launch Script Node

**Launch Private Net**

#### Open a terminal to launch the private net. For the first time, follow the setup steps below.

`$ cd $SCRIPT_HOME`

`$ cp -r ./integration/scriptnet ../scriptnet`

`$ mkdir ~/.scriptcli`

`$ chmod 700 ~/.scriptcli/`

`$` make install

And then, use the following command to launch a scriptnet . For this you can use tmux or any other tools to run your node service in the background.

/usr/local/go/bin/script start --config=../scriptnet/node

When the prompt asks for a password, enter your required password here.&#x20;

{% hint style="info" %}
Note – { Your binary directory path } denotes path where script and scriptcli binary exist or created while running after make install command.&#x20;
{% endhint %}

And then after run the following command to launch rpc of the node in another session.

/{ Your binary directory path }/scriptcli daemon start --port=16889


# Command Line Tool

Scriptcli: Command Line Wallet

The Script ledger software provides a command line wallet tool scriptcli for users to interact with the Script ledger. Below is an example of sending tokens between two addresses.

## **Send and Receive Tokens**

After building the Script ledger, two binaries script and scriptcli are generated. Script can be regarded as the launcher of the script Ledger node, and scriptcli is a wallet with command line tools to interact with the ledger. We can use the scriptcli command line tool to send Script tokens from one address to another by executing the following command. Open a terminal, and execute the following command. When the prompt asks for password, enter your password.

**$ scriptcli tx send --chain="scriptnet" --from= 98fd878cd2267577ea6ac47bcb5ff4dd97d2f9e5 --to=9F1233798E905E173560071255140b4A8aBd3Ec6 --script=0 --spay=20 --seq=1**

The balance of an address can be retrieved with the following query command, after the transaction has been included in the blockchain (may take a couple seconds).

**$ scriptcli query account --address=9F1233798E905E173560071255140b4A8aBd3Ec6**

Now let us send 20 more Script tokens. Note that we need to increment the seq parameter to 2. The seq parameter is a transaction counter for each account, similar to the nonce parameter for Ethereum transactions. Each time we send tokens from an account, we need to increment the seq by 1.

**$ scriptcli tx send --chain="scriptnet" --from=98fd878cd2267577ea6ac47bcb5ff4dd97d2f9e5 --to=9F1233798E905E173560071255140b4A8aBd3Ec6 --script=0 –spay=20 --seq=2**

We can query the recipient address again to verify the account balance changes.

**$ scriptcli query account --address=9F1233798E905E173560071255140b4A8aBd3Ec6**


# Steps To Upgrade The Chain

#### 1. Login and switch to the node directory.

* cd /usr/local/go/src/github.com/scripttoken/script

{% hint style="info" %}
\*Note: Copy the previous config file and save it some where and replace it after git pull with the previous one.
{% endhint %}

#### 2. Pull the latest code from repository and check the branch to be main only.

* git branch&#x20;
* git checkout main&#x20;
* git pull

#### 3. Compilation of the code&#x20;

* cd /usr/local/go/src/github.com/scripttoken/script&#x20;
* make install

#### 4. Run the code

* Terminate the running blockchain node in background process whether it is in tmux, nohup, sceen, pm2 or other.
* cd /usr/local/go/src/github.com/scripttoken/script
* Run, /usr/local/go/bin/script start --config=../scriptnet/node&#x20;
* Enter the password and start the node.


# Account/Wallet Management

The Script command line tool can be used as a wallet, which can manage multiple accounts with the keys encrypted. Below are the relevant commands:

1. Scriptcli key new Create a new account with a password. The newly created key is encrypted and stored under \~/.scriptcli/keys/encrypted/ by default
2. scriptcli key list List all the accounts managed by the wallet.
3. Scriptcli key password

Reset the password for the account. You will need the current password for the reset.

1. Scriptcli key delete

Delete the account. You will need the password for the account for the deletion.


# Call Smart Contract

This API simulates the smart contract execution locally without submitting the smart contract transaction to the blockchain. It is useful to evaluate the execution result, calculate the gas cost, etc.

**RPC Method:** script.CallSmartContract

**Query Parameters**

sctx\_bytes: the signed transaction bytes

**Returns**

vm\_return: the return of the virtual machine

contract\_address: the address of the corresponding smart contract

gas\_used: amount of gas used for the smart contract execution

vm\_error: error returned by the virtual machine if any


# Turing-Complete Smart Contract Support

Turing-complete smart contracts open the door to numerous use cases in video streaming and beyond, from token investments in streamers, to automated splits of SCPT rewards between platform/streamers/users, to non-fungible tokens (NFTs) representing top content creators.&#x20;

Since the Script Virtual Machine is compatible with Ethereum Virtual Machine (EVM), porting over existing Ethereum-based contracts is simple and thousands of smart contract developers can easily jump to building on Script. Between the Script Labs team and Script community, many projects are already in the works including decentralized exchanges (DEXs), staking pools, and more.

Since the Script Virtual Machine is compatible with EVM, a developer can compile the [Solidity](https://docs.soliditylang.org/en/v0.7.5) contract source code using his preferred compiler toolchain ([Remix](https://remix.ethereum.org/), [Truffle](https://www.trufflesuite.com/), or [solc](https://docs.soliditylang.org/en/v0.7.5/installing-solidity.html)) into bytecode and then deploy to the Script Blockchain.

A user can deploy and interact with the smart contract either manually through the Script Web Wallet or programmatically via the Script Blockchain SDK. Also note that on the Script Blockchain, SCPT takes the place of ETH in all contracts. Just as you need ETH to deploy or interact with smart contracts on Ethereum, you need SCPT to do so on Script blockchain. All SCPT used to deploy or interact with smart contracts is burned.


# Basic Concept

Script TV is built on the Script blockchain – a reliable, affordable, high-quality video publishing platform that utilizes purpose-built novel technology to operate efficiently and effectively—using decentralized infrastructure, Script.TV provides a video platform designed to radically improve the experience of using streaming platforms for users, content creators, and advertisers. Script.TV will be the first linear TV and film experience on the blockchain.

&#x20;

Using a decentralized blockchain for Script.TV, we solve the many shortcomings of the centralized media space, such as low CPMs as a consequence of intermediaries, sluggish payout times, launch delays, and a lack of analytical data for content partners. For users, there is no ability to get paid for what they watch and no opportunity to connect with community or content partners. The TV and film experience and their associated industries are disengaged and broken. Script.TV will mend this disconnection forever.

{% hint style="info" %}
In simple terms, Script.TV is a two-sided platform: one side for content partners whose shows and films will be streamed on the platform, and one side for the viewer who will be able to view this content from anywhere in the globe.
{% endhint %}

## **Film and TV on the Blockchain**

The Script.tv protocol can also help tv stations combat the decline in viewership by offering a convenient bridge for mainstream and independent news, sports, and entertainment tv stations to move into the blockchain. Large media companies can safely introduce their content and live programming onto the blockchain, reaching new audiences, reducing hosting costs, and creating new streams of revenue through crypto and NFTs.

Script.tv aims to modernize live television for users, enabling them to interact through a live chat, thus adding a social element to television and creating financial incentives for watching ads. In essence, Script is the blockchain built for media streaming.

**It is a decentralized solution that will help usher in the web 3.0 paradigm, providing the necessary infrastructure for the future of television, video hosting, and streaming.**

## **Interoperability & Scalability**

Script Network is focused on developing NFTs, rewards, and content that can live in multiple worlds – either on the Script.TV platform, in the metaverse or even offline in the physical world. Script TV platform focuses on a geographical and interest-targeted approach for its users, brands, and partners. NFTs can be bought and traded within the Script Platform.

**Metaverse**: With a range of incumbent metaverse apps, Script Network will connect and collaborate to create an experience that offers NFTs purchased to be used in the metaverse. This gamified option brings even more potential use cases to Script NFTs.

**Physical World**: Script Network was built with a vision to help educate and bring millions of current content viewers over to blockchain. Part of this process will include being able to trade and stake and convert specific Script NFTs for real-world cinema tickets, access to events, and more.


# Tokens

Script.TV will be a first-of-its-kind online TV platform in which both users and content publishers earn valuable tokens through video streaming. Script.TV will be a feature-rich application that provides users with round-the-clock entertainment through a range of exciting channels.

The network will use the blockchain-based Script token (SCPT) as a direct incentive for users to not only watch and discover great new content but also to contribute their computers’ bandwidth and memory to the network. Fundamentally this incentive mechanism is what powers the network and allows Script.TV to avoid the problems currently plaguing traditional streaming platforms.

{% hint style="info" %}
Content partners earn SPAY tokens for every minute their content is watched on Script.TV and users earn SPAY tokens every time they watch programs on Script.TV. By operating and utilizing the Script. TV web app, any device can become a Script node able to earn users additional rewards for caching and distributing video data.
{% endhint %}

## **$SCPT & $SPAY Storage**

SCPT & SPAY are the two tokens on the Script Blockchain. To begin with, to ensure instant liquidity, ease of trading, and a platform to perform swapping with popular pairs at scale, SCPT will launch as an BEP-20/ SCR-20 token. This means that SCPT (and SPAY in the future) can be stored in popular wallets such as Metamask and Trustwallet.

Further down the line in our roadmap, we will perform a 1:1 conversion for SCPT and SPAY to the Script Blockchain. Users and content partners will have further flexibility on where to store SCPT and SPAY. Users and content partners can store, send and receive their tokens securely within their wallets on the Script Network. And as SCPT and SPAY are listed on more exchanges (both CEX & DEX), these will provide further storage options for users. Should users or content partners wish to store their tokens away offline, they will eventually be able to hold their tokens on hardware wallets.


# Script NFTs

## About NFTs

Non-Fungible Tokens are digital proof of ownership connected to some content or asset. Each is unique and cannot be replaced by another or forged. Each NFT contains identifying information recorded within one or multiple smart contract/s. As NFTs are minted on blockchains, all information about them is publicly available and reliable. Popular objects for NFT tokenization include art objects (digital and real), items from virtual and game universes (characters, clothing, artifacts, weapons, equipment), collectibles, copyright, licensing, and certification.

## Script NFTs: How Will It Work?

For Script Network, NFTs will be used to create a piece of content that can be purchased, traded, and stored for value and will all be directly connected to the films and shows on Script.TV. Users will have an opportunity to claim and earn time-based rewards, stake valuable NFTs, earn off-chain rewards and gain access to events, screenings, and cinema tickets through the accumulation of SPAY tokens and Script NFTs.

For the development of most non-interchangeable tokens, several ERC standards are used on Ethereum. Script.TV will use Solidity smart contracts that allow users to mint Ethereum-based NFTs for heavily reduced fees via SPAY tokens. Later down the line, Script.TV will launch NFTs with cross-chain accessibility. A mechanism allowing content partners to create, trade, and use their own NFTs will be implemented into the Script.TV platform.

{% hint style="info" %}
Script TV will allow content partners to use these NFTs to interact with their audience. During the broadcast, competitions, quizzes or gift giveaways may be held among the audience. And after the launch of the NFT marketplace, users will be able to sell the received tokens and NFTs at will.
{% endhint %}

## Script NFTs For Content Partners And Advertisers

Content partners or advertisers may issue NFT-based virtual collectibles as gifts or prizes to content viewers. For example, they could be cards based on characters or actors from a particular show, digital copies of items or movie clips, or other possibilities. Rare or unique NFTs can become collectible items that can be kept or exchanged. These features further stimulate the platform's development and will provide a new, more deeply connected viewing experience for users, and a closer way to engage with fans for content producers.


# Transactions

Transactions and payments to both content partners and users will be executed automatically through smart contracts. These contracts will also be used for verification and on-chain monitoring.

Through this, the network will maintain a public record of information on our immutable blockchain. Information about all the transactional operations of Script.TV will be available in our block explorer, which will function similarly to EtherScan.

This explorer will allow users to conveniently find data on transactions and tokens, information about smart contracts and reports, and will be used to track the latest actions and changes in the blockchain.


# Script Wallet

If you create a new wallet, **we recommend you do so offline.** Once you reach the Script Wallet site, take your device offline / put it in airplane mode, then click “Create Wallet.” Next, you will download an encrypted keystore file and create a wallet password. This encrypted keystore file on your computer will be used to unlock your wallet any time you want to access it. You will then need to copy down the mnemonic/seed phrase (and private key, if you choose to) and store them in a safe place.

**Your mnemonic/seed phrase and private key are the only way to restore your Script wallet if you lose your keystore file and/or wallet password! Make sure you save them correctly and store them offline in a safe place (never online or in the cloud!)**.

Once your wallet has been created, you can re-connect your device and unlock your new Script Wallet.

If you are unlocking an existing wallet, we recommend you **take your device offline** while uploading your keystore or enter your mnemonic phrase or private key. Once the wallet has been unlocked, you’ll see a screen that says “you’re offline!” and will have the opportunity to connect to the internet before you continue to the wallet.

Once you’re in your Script wallet, you can check the balance of your Script Tokens. Detailed step by step instruction is below

### — Create a wallet: 1. Head here: [https://wallet.script.tv](https://wallet.script.tv/) <a href="#id-853b" id="id-853b"></a>

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/1*Eo-pi5waY5DBjEWm2I7wgQ.png" alt="" height="347" width="700"><figcaption></figcaption></figure>

2\. You can now choose whether to unlock an existing Script Wallet, or to create a new one (yellow writing at the bottom).

3\. Assuming you clicked ‘Create a Wallet’ you should see this.

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/1*7rlKJw2lh2GnGf0GliUFmA.png" alt="" height="312" width="700"><figcaption></figcaption></figure>

This requires you to set a password, tick the disclaimer, and then download keystone (keystore will automatically download locally on your device).

4\. You will then be presented with this page

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/1*Ocl_b9zPYiciL1cnnKf2Rw.png" alt="" height="349" width="700"><figcaption></figcaption></figure>

Press continue and you will see your 12 word phrase and your private key. Keep these safe and do not share them with ANYONE under any circumstance. No member of Script Networks’ team will EVER ask you for this information.

5\. All done! You now have a Script Wallet

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/1*cgKVUM3xPj_3rrVQsMAosg.png" alt="" height="330" width="700"><figcaption></figcaption></figure>

Now simply choose your preferred login method and continue.

### — Request funds from faucet (SPAY/SCPT) <a href="#f57f" id="f57f"></a>

Head to the ‘Recieve’ menu option, click it, and then click ‘Faucet’

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/1*DlczDXLDUCTEitIm6_CpJg.png" alt="" height="308" width="700"><figcaption></figcaption></figure>

After clicking Faucet you will shortly get test tokens delivered to your wallet. This may take up to 1 hour during busy times. If you’d like to run a lightning node, click the ‘Test tokens’ area and select ‘Lightning Node Tokens’, then click ‘Faucet’ at the bottom, you will then see the following.

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/1*jWnfpP7Oo5eZyWY_ej_F4A.png" alt="" height="316" width="700"><figcaption></figcaption></figure>

You can only complete the above area if you have set up a lightning node after June 21st @ 17:00 UTC. Any lightning nodes created before this, will be invalid. If the summary and node address is correct, you will then receive testnet tokens to run a lightning node. **Also to confirm, you do not need extra / any tokens to set up and run an edge node.**

SCPT is the governance token, and is the token required for staking. SPAY is the token for transactions and rewards. To request SCPT tokens, you need to put your wallet address (and nothing else), in the discord channel named #token-faucet

*This will then be credited within 24 hours*

### — Stake tokens <a href="#d786" id="d786"></a>

You can only stake tokens if you are running a test edge, lightning or validator node.

### Transfer tokens between wallets <a href="#id-2b28" id="id-2b28"></a>

1. Simply head to ‘send’. Click the token you wish to send, the wallet for it to go to, and the amount and click send. You can send to a fellow friend who owns an Script Wallet, yourself (if you have created more than one), or, one of your EVM wallets (so, one that is on Metamask for example)

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*po9jeYn_EAvOvjJD.png" alt="" height="291" width="700"><figcaption></figcaption></figure>

2\. You will then be given an extra window to confirm the transaction

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*RbDz4JnBOQHky48W.png" alt="" height="804" width="700"><figcaption></figcaption></figure>

You’ll be asked to type in your wallet password again and click send

3\. Congrats! You just made a transaction. You can check Metamask, or explorer to confirm your transaction also.

<figure><img src="https://miro.medium.com/v2/resize:fit:1400/0*QshujekWpeAODtZC.png" alt="" height="115" width="700"><figcaption></figcaption></figure>

\ <br>


# Faucet (Technical)

Obtain tokens from the Faucet<br>

If we run a testnet node we would use a `faucet` or token fountain, usually found in testnet nodes.

Every script node has a faucet service that would kindly transfer you funds on request. No questions. The objective of testnet is to give users the opportunity to test the system with ‘play money’

However if we run a mainnet node we would use an exchange and buy tokens instead.

Before asking the faucet let’s use an address we control.

If you wanted to fund *this-node* address, your node, such address can be obtained in the following way:

```
        stv:~$ scriptcli query status
                {
                    "address": "0x8d1F3236d790415d631d554091dE7A25913FB561",                       <=== address
                    "chain_id": "testnet",
                    "current_epoch": "1019",
                    "current_hash": "0x44d71c52e6ddc4a905dc1901e7cc1a5b9bceed11ab4ea4cd023bb3b82b8d9147",
                    "current_height": "1017",
                    "current_time": "1721812158",
                    "genesis_block_hash": "0x42a81f3f7ef0a5297997c8428ae945d5176f07082224b006f1979a5ebbe2744c",
                    "latest_finalized_block_epoch": "1017",
                    "latest_finalized_block_hash": "0x270bdf99bea4a90554ef13138721d33a4302f9c55925e0a14f8ca2ef8bda3359",
                    "latest_finalized_block_height": "1017",
                    "latest_finalized_block_time": "1721812142",
                    "peer_id": "0x8d1F3236d790415d631d554091dE7A25913FB561",
                    "snapshot_block_hash": "0x42a81f3f7ef0a5297997c8428ae945d5176f07082224b006f1979a5ebbe2744c",
                    "snapshot_block_height": "0",
                    "syncing": false,
                    "tip_hash": "0xc7134d79a766cef0bcd32f267c0662fa6cafb7e4a22c73620ad5baeff1238ff3"
                }
```

Our address can be found on the response, `0x8d1F3236d790415d631d554091dE7A25913FB561`.

Let’s then invoke stvtool to obtain funds for this aforementioned address, we do it with the command *query\_faucet*, passing the recipient address as argument:

```
        stv:~$ bin/stvtool query_faucet 0x8d1F3236d790415d631d554091dE7A25913FB561
```

The command can be repeated as many times as wished up to a balance limit of 1M. We can easy earn tokens this way.

By feeding with tokens your `node address` your faucet is automatically enabled using it as source of funds and making the faucet service available to other participants in the script network.

After a few seconds from ordering the transfer we can check our balance:

```
        stv:~$ scriptcli query account --address=0x8d1F3236d790415d631d554091dE7A25913FB561
                {
                    "code": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
                    "coins": {
                        "scptwei": "12000000000000000000000",
                        "spaywei": "1200000000000000000000"
                    },
                    "last_updated_block_height": "1180",
                    "reserved_funds": [],
                    "root": "0x0000000000000000000000000000000000000000000000000000000000000000",
                    "sequence": "0"
                }
```

Which effectively shows the expected amounts given to us by the remote faucet.

Removing 18 trailing zeroes we obtain our balance of tokens (provided you called the faucet 12 times)

```
    SCPT token: 12000;  SPAY token:1200
```

The command will use by default the Script Network reference Node at [https://backend-wallet-testnet.script.tv](https://backend-wallet-testnet.script.tv/)

Other nodes offer the same service on URsL:

```
    * Human: https://wallet-testnet.<your-domain>
            * API: https://backend-wallet-testnet.<your-domain>
```


# Smart Contracts

The lack of transparency and red tape has frustrated users and content partners for decades within the media industry. To solve this, our smart contracts can be adapted by Script.TV content creators to distribute royalties fairly, transparently, and without reliance on costly intermediaries.

Smart contracts for content partners and platforms also enable more payment-consumption models than traditional TV services can offer their users, such as per-use or pay-as-you-go models. Instead of paying for annual or monthly subscriptions, viewers can now earn for viewing content. Our Turing-complete smart contracts enable numerous usage scenarios not exclusive to video streaming.

For example, the distribution of rewards between the platform, content partners, and users can be automated, NFTs can be traded, various wallets can be integrated, and new tokens can be minted. The Script.TV Virtual Machine is fully compatible with the Ethereum Virtual Machine (EVM), making it simple to migrate existing Ethereum-based contracts, and smart contract developers can seamlessly migrate to Script.TV.

By merging linear TV programming with blockchain technology, Script TV can manage all its services and offerings using smart contracts. The smart contracts are self-executing, require no middlemen, and can be swiftly executed after stipulated conditions for performance are met by the contracting parties. Plus, smart contracts can be used for games, polls, airdrops, reward programs, community engagement initiatives, and content acquisition. Overall, using smart contracts streamlines the process of getting things done and is cost-effective.

&#x20;


# Script Network Explorer

The [Script Explorer](https://explorer.script.tv/) is a blockchain explorer which allows users look up, confirm and validate transactions on the Script blockchain. By entering an address into the search box, you can view the balance, value and all the transactions made through that address.

The **Script Explorer APIs** are provided by the Script Explorer Microservice Node. It is the REST interface via which a user can interact with the Script Explorer Microservice Node directly.

The explorer also allows a user to check the details of a transaction with the transaction hash. Once you’ve pasted the hash into the search bar, a series of transaction details will appear. These include the type of the transaction, the height of the block that includes the transaction, and the timestamp when the transaction was finalized on-chain.

With smart contract support enabled on the Script blockchain, the Script Explorer was redesigned to more easily inspect and monitor smart contracts. The Script Explorer allows developers to upload and verify the source code of their smart contracts, query the read-only interface of the smart contracts, and record the Script VM returns and emitted events for ease of debugging.

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

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


# Block APIs

## GetBlock

This API returns the details of the block being queried with height.

**REST Uri:** /block/{height}

**Returns**

epoch: epoch of the block

height: height of the block

parent: hash of the parent block

transactions\_hash: root hash of the transaction Merkle-Patricia trie

state\_hash: root hash of the state Merkle-Patricia trie

timestamp: timestamp when the block was proposed

proposer: address of the proposer validator

hash: the block hash

transactions: json representation of the transactions contained in the block

raw: transaction details

type: type of the transaction

hash: hash of the transaction

status: status of the block

**Request**

```
// curl 
https://explorer.script.tv
/api/block/1
// Result
{
 "type":"block",
 "body":{
 "epoch":"1",
 "status":5,
 "height":1,
 "timestamp":"1550089775",
 "hash":"0x705b74cde1ad4afefb8cae883327b216dd11c3a4b592b4487a40337e5e27a7bd",
 "parent_hash":"0x8ce72f57b6ef53c7d5d144a40d6faacc444e9cd60d79043ea5ab978f44c120c6",
 "proposer":"0x9f1233798e905e173560071255140b4a8abd3ec6",
 "state_hash":"0xcb9b1641ecb9f1fb372a9ac9184c811c07bda3d061ce63b2c2e2f1fafc42c789",
 "transactions_hash":"0x36449d6d0523379a6799843cea98c0a4d708a7c314d0536496a78dee57fcb672",
 "num_txs":1,
 "txs":[
 {
 "raw":{
 "proposer":{
 "address":"0x9f1233798e905e173560071255140b4a8abd3ec6",
 "coins":{
 "SCPTWei":"0",
 "SPAYWei":"0"
 },
 "sequence":"0",
 "signature":"0xe54784005c1c321092d24ba50a32228b7b7b6d4e5ad41aa968e96123f1996f623aa609ab7414995aaa25eb8897ca2bb3809695e31829d5de2ee94eead3907eda00"
 },
 "outputs":[
 {
 "address":"0x2e833968e5bb786ae419c4d13189fb081cc43bab",
 "coins":{
 " SCPTWei ":"0",
 " SPAYWei ":"0"
 }
 },
 {
 "address":"0x350ddef232565b32e66a9fb69780e85b686a9e1d",
 "coins":{
 " SCPTWei ":"0",
 " SPAYWei ":"0"
 }
 },
 {
 "address":"0x5f74e3d5cc77b66f0030c5501cfbd39dcb8ff5b6",
 "coins":{
 " SCPTWei ":"0",
 " SPAYWei ":"0"
 }
 },
 {
 "address":"0x7631958d57cf6a5605635a5f06aa2ae2e000820e",
 "coins":{
 " SCPTWei ":"0",
 " SPAYWei ":"0"
 }
 },
 {
 "address":"0x9f1233798e905e173560071255140b4a8abd3ec6",
 "coins":{
 " SCPTWei ":"0",
 " SPAYWei ":"0"
 }
 },
 {
 "address":"0xc15e24083152dd76ae6fc2aeb5269ff23d70330b",
 "coins":{
 " SCPTWei ":"0",
 " SPAYWei ":"0"
 }
 },
 {
 "address":"0xdfb095b990c98a96dd434fe45cd040ec2167c228",
 "coins":{
 " SCPTWei ":"0",
 " SPAYWei ":"0"
 }
 }
 ],
 "block_height":"0"
 },
 "type":0,
 "hash":"0x72738626b99c6942daea0a04eaaca4d83d1d72e1620a0c55d35a886dcb0f56b1"
 }
 ]
 },
 "totalBlocksNumber":17164
}
```

## GetBlocksByRange

This API returns a list of blocks given the page number and limit number.

**REST Uri:** /blocks/top\_blocks

**Query Parameters**

pageNumber: the page number, 1 stands for the latest

limit: the limit size of each page

**Returns**

currentPageNumber: the number of current page

For each block it is similar to the returns of the GetBlock API.&#x20;

```
// Request
curl 
https://explorer.script.tv
/api/blocks/top_blocks?pageNumber=1&limit=10
// Result
{
 "type":"block_list",
 "body":[
 {
 "epoch":"17475",
 "status":4,
 "height":17449,
 "timestamp":"1550199501",
 "hash":"0x4756f30fa538769e4dcaae9fcbd19f6612b05abc843aa9c07a28983121fb3b1d",
 "parent_hash":"0xdd3fde69f68d8b9522adab25f04459f84072a160c2ab3ceeb086777550378e7f",
 "proposer":"0xc15e24083152dd76ae6fc2aeb5269ff23d70330b",
 "state_hash":"0x9711aadb58db9b33ac2f8e29584d772184b01b8406bc2c7cda52a024eeabba8a",
 "transactions_hash":"0xa90c99ab4a3861cfd2a71280a2f74f4aadda5727b72f046687681adfe31c3b5e",
 "num_txs":7,
 "txs":[...]
 },
 {
 "epoch":"17476",
 "status":4,
 "height":17450,
 "timestamp":"1550199507",
 "hash":"0xb5997adcd3daf6c249b2e4ae79945d36fc1aa262fc344a5c665193460c4c2fec",
 "parent_hash":"0x4756f30fa538769e4dcaae9fcbd19f6612b05abc843aa9c07a28983121fb3b1d",
 "proposer":"0x9f1233798e905e173560071255140b4a8abd3ec6",
 "state_hash":"0x69407583b370cbc8c27c63f975e0a3145f05068f8a488d7411ed634f1544fefc",
 "transactions_hash":"0x1ff24e55b5c2e1a9e01ced5d7f92fe2dde90511e7b5cb28e93ed8751df721bda",
 "num_txs":5,
 "txs":[...]
 },
 {
 "epoch":"17477",
 "status":4,
 "height":17451,
 "timestamp":"1550199513",
 "hash":"0x082b3653ccc74b26612da4a7666b2c3e9c2ce2222dd90c6083884892a0e3f1c6",
 "parent_hash":"0xb5997adcd3daf6c249b2e4ae79945d36fc1aa262fc344a5c665193460c4c2fec",
 "proposer":"0x7631958d57cf6a5605635a5f06aa2ae2e000820e",
 "state_hash":"0x10931619d1986b4b62f816c11643dbe66aeccbb48e2995b81fbf0786ceb312d1",
 "transactions_hash":"0x0cabb62272efeac14a06eb323c5b7e8b87271a948a619e5ead4a4fd284c094cf",
 "num_txs":7,
 "txs":[...]
 },
 {
 "epoch":"17478",
 "status":4,
 "height":17452,
 "timestamp":"1550199520",
 "hash":"0x2ff868bf9c8aab3c2482a91b090530f430c8afb94fd66c60b9c8fd845899a00a",
 "parent_hash":"0x082b3653ccc74b26612da4a7666b2c3e9c2ce2222dd90c6083884892a0e3f1c6",
 "proposer":"0x9f1233798e905e173560071255140b4a8abd3ec6",
 "state_hash":"0x4d78020673af830a92ff5fc78a9d1859ecee3b07bf7cbda8d3ae74d61e0fee50",
 "transactions_hash":"0x1d77c10d77a8380f07ade4474816332d347f8739913aee03ae81f1f02391d3ae",
 "num_txs":3,
 "txs":[...]
 },
 {
 "epoch":"17479",
 "status":4,
 "height":17453,
 "timestamp":"1550199526",
 "hash":"0x7953f10d559405dad20db498947148a73781546209485a803e414574e3439255",
 "parent_hash":"0x2ff868bf9c8aab3c2482a91b090530f430c8afb94fd66c60b9c8fd845899a00a",
 "proposer":"0x2e833968e5bb786ae419c4d13189fb081cc43bab",
 "state_hash":"0x62e34301225525c3dd44ee951e45a97a1590303aa9ba3586cf0c1791b1f8ebc4",
 "transactions_hash":"0x404e4a202f4e621ccf0abe824c318edf012b5a52b5c52d3509e050b996185f53",
 "num_txs":6,
 "txs":[...]
 },
 {
 "epoch":"17480",
 "status":4,
 "height":17454,
 "timestamp":"1550199532",
 "hash":"0xe752c9e9dd0b5bca6aefe31c5d84845ba7e3d469eb56f1a91300b316ffc5ce4c",
 "parent_hash":"0x7953f10d559405dad20db498947148a73781546209485a803e414574e3439255",
 "proposer":"0xdfb095b990c98a96dd434fe45cd040ec2167c228",
 "state_hash":"0x2a2b68e13f0bb27b3adbef5ab54d1a8ef07a6e16afa8172684c5f5e8771f43ba",
 "transactions_hash":"0x679095a23b223847c197005d0b6e1995012bb381f49fc3c36bda40af6143149d",
 "num_txs":5,
 "txs":[...]
 },
 {
 "epoch":"17481",
 "status":4,
 "height":17455,
 "timestamp":"1550199539",
 "hash":"0x05b6b8bd715f600242208710081395a050e37d6af0fa9789f74b50d37c696ca6",
 "parent_hash":"0xe752c9e9dd0b5bca6aefe31c5d84845ba7e3d469eb56f1a91300b316ffc5ce4c",
 "proposer":"0x2e833968e5bb786ae419c4d13189fb081cc43bab",
 "state_hash":"0xa6ad424d8d3d02c52f8f4aefa8c7d92a746e9b1368bb723e56805827d4b757f4",
 "transactions_hash":"0x016e5c9a7e43cb5d869d3a65a03da6e87e91fe5da3bb2bc9319b262532cfab42",
 "num_txs":5,
 "txs":[...]
 },
 {
 "epoch":"17482",
 "status":4,
 "height":17456,
 "timestamp":"1550199545",
 "hash":"0x16b6d178380af8fb580f6d055919744f8dbee0c850d685f7f9dc34507db8f716",
 "parent_hash":"0x05b6b8bd715f600242208710081395a050e37d6af0fa9789f74b50d37c696ca6",
 "proposer":"0xc15e24083152dd76ae6fc2aeb5269ff23d70330b",
 "state_hash":"0xd97a3238cd3f97c2e3db9f4c825a6bb59ba2bb02112029c83f53b9495ef282ac",
 "transactions_hash":"0xbbd09b8bd634d59b44f810a72c2adb836eef3c4f83ef01033281c556bbe35342",
 "num_txs":3,
 "txs":[...]
 },
 {
 "epoch":"17483",
 "status":4,
 "height":17457,
 "timestamp":"1550199551",
 "hash":"0x9b9cd1306346a692258f9b2c1ee2a0cdb66956efbf41e9c43658cf078fc2c229",
 "parent_hash":"0x16b6d178380af8fb580f6d055919744f8dbee0c850d685f7f9dc34507db8f716",
 "proposer":"0x9f1233798e905e173560071255140b4a8abd3ec6",
 "state_hash":"0xbb018c8e3b6c7d94bc8d1e547fe748296df5ef8f5734a9abfd5faaa54d11c858",
 "transactions_hash":"0x06d08fc4e13b021868f1394af440d53f4eca60e55015eb3dea7e8fcdf5d595ea",
 "num_txs":4,
 "txs":[...]
 },
 {
 "epoch":"17484",
 "status":4,
 "height":17458,
 "timestamp":"1550199557",
 "hash":"0x70e1102013273079484dff737c36850765eb9794e2fde402fa3c4c2ddb45fc7b",
 "parent_hash":"0x9b9cd1306346a692258f9b2c1ee2a0cdb66956efbf41e9c43658cf078fc2c229",
 "proposer":"0x7631958d57cf6a5605635a5f06aa2ae2e000820e",
 "state_hash":"0xd3915c55728a568c6272de77dbea60aa20a1c1fb6c096a7fd4eecdb0bdde005d",
 "transactions_hash":"0xe51b8bea2fa6e9ff2c28bf488913c66d081647dbcf0c85311099b84fcc3769be",
 "num_txs":4,
 "txs":[...]
 }
 ],
 "totalPageNumber":1746,
 "currentPageNumber":"1"
}
```


# Transaction APIs

## GetTransaction

This API returns the details of the transaction being queried with hash.

**REST Uri:** /transaction/{hash}

**Query Parameters**

hash: the transaction hash

**Returns**

block\_height: height of the block that contains the transaction

hash: the hash of the transaction itself

data: the details of the transaction

type: transaction type

totalTxsNumber: total number of transactions in database

timestamp: the time stamp of the block contains this block

number: the sequence number of the transaction in database

```
// {
 "type":"transaction",
 "body":{
 "hash":"0XF16402022FFFADA96C4BA9A78F79730903F8D99EF44D221FC5869EC4191260EC",
 "type":5,
 "data":{
 "fee":{
 "SCPTWei":"0",
 "SPAYWei":"1000000000000"
 },
 "source":{
 "address":"0x02990c3f7f75865bcd2fb28450f01065754f9372",
 "coins":{
 " SCPTWei ":"0",
 " SPAYWei ":"1150000000000000"
 },
 "sequence":"0",
 "signature":"0x66cb200ad7def6a0b4e9d377fd6a54cf19f952d089772b2dda8bd0f0927434825acec09e5c2c7aaaf9c4d18a2730786ee619a593fd49395913785aa4255e164001"
 },
 "target":{
 "address":"0x49e2268b8962a7b5680512173f2b320418003082",
 "coins":{
 " SCPTWei ":"0",
 " SPAYWei ":"0"
 },
 "sequence":"126",
 "signature":"0xdd6aecdf642a001b9ae299cf44aa5c142dac45dd58666d326870dc53670dc204548951880ebce343afb27c968bb99488c23bc9af43a60c4de6299c6242cf07ac00"
 },
 "payment_sequence":"1550282279177",
 "reserve_sequence":"178",
 "resource_id":"vidivz187ttu9eck65d"
 },
 "number":196771,
 "block_height":"30615",
 "timestamp":"1550282330"
 },
 "totalTxsNumber":196771
```

## GetTransactionsByRange

This API returns a list of blocks given the page number and limit number.

**REST Uri:** /transactions/range

**Query Parameters**

pageNumber: the page number, 0 stands for the latest

limit: the limit size of each page

**`Returns`**

`currentPageNumber: the number of current page`

`totalPageNumber: the total number of pages`

`For each transaction it is similar to the returns of the GetTransaction API.`

```
// Request
curl 
https://explorer.script.tv
/api/transactions/range?pageNumber=1&limit=10
// Result
{
 "type":"transaction_list",
 "body":[
 {...},
 {...},
 {...},
 {...},
 {...},
 {...},
 {...},
 {...},
 {...},
 {...}
 ],
 "totalPageNumber":20354,
 "currentPageNumber":"1"
}
```


# Account APIs

## GetAccount

This API returns the details of the account being queried with address.

**REST Uri:** /account/{address}

**Query Parameters**

address: the address of the account

**Returns**

address: the account address

balance: the native token balance

reserved\_funds: fund reserved for micropayment through the off-chain resource-oriented payment pool

sequence: the current sequence number of the account

txs\_counter: the counter map contains how many transactions of each transaction type include this account

```
// Request
curl https://explorer.script.tv/api/account/0x3c6D5ED0353c22c31c5F91688A9D10E7Af2DF636
// Result
{
 "type": "account",
 "body": {
 "address": "0x3c6d5ed0353c22c31c5f91688a9d10e7af2df636",
 "balance": {
 "SCPTWei": "0",
 "SPAYWei": "1540957523000000000000"
 },
 "sequence": "0",
 "reserved_funds": [],
 "txs_counter": {
 "2": 2,
 "5": 973
 }
 }
}
```

## GetAccountTxHistory

This API returns the details of the account being queried with address.

**REST Uri:** /accountTx/:address

**Query Parameters**

address: the address of the account

type: type of the transaction

isEqualType: true returns a transaction list only include the type above, false returns a transaction list exclude the type above.

pageNumber: the number of page

limitNumber: the size of each page

**Returns**

currentPageNumber: the number of current page

totalPageNumber: the total number of page

For each transaction it is similar to the returns of the GetTransaction API.

```
// Request
curl " https://explorer.script.tv//api/accounttx/0x3c6D5ED0353c22c31c5F91688A9D10E7Af2DF636?type=2&pageNumber=1&limitNumber=50&isEqualType=true"
// Result
{
 "type": "account_tx_list",
 "body": [
 {...},
 {...}
 ],
 "totalPageNumber": 1,
 "currentPageNumber": 1
}
```

## GetTopTokenHolders

This API returns the list of top token holders.

**REST Uri:** /account/top/:tokenType/:limit

**Query Parameters**

tokenType: type of the token(SPAY)

limit: the size of returns

**Returns**

For each account it is similar to the returns of the GetAccount API.

```
// // Request
curl " https://explorer.script.tv//api/account/top/SPAY/5"
// Result
{
"type": "account_list",
"body": [
 {...},
 {...},
 {...},
 {...},
 {...}
 ]
}
```


# Stake APIs

## GetAllStakes

This API returns all stake records.

**REST Uri:** /stake/all

**Returns**

stakes: json representation of the stakes

\_id: the ID for the stake record

type: this stake is in the Validator candidate pool or the Lightning candidate pool

holder: the holder account's address

source: the source account's address

amount: the staked SPAYWei amount

withdrawn: true returns the stake is withdrawn, false returns the stake is not withdrawn

return\_height: the expected height the tokens return to the staking wallet if a node withdraws its stake.

```
// Request
curl https://explorer.script.tv/api/stake/all
// Result
{
 "type": "stake",
 "body": [{
 "_id": "5eb9f45d38696f556cc3334d",
 "type": "vcp",
 "holder": "0x80eab22e27d4b94511f5906484369b868d6552d2",
 "source": "0x4aefa39caeadd662ae31ab0ce7c8c2c9c0a013e8",
 "amount": "20000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 },{
 "_id": "5eb9f45d38696f556cc3334e",
 "type": "vcp",
 "holder": "0x80eab22e27d4b94511f5906484369b868d6552d2",
 "source": "0x747f15cac97b973290e106ef32d1b6fe65fef5a1",
 "amount": "40000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 },{
 "_id": "5eb9f45d38696f556cc33351",
 "type": "vcp",
 "holder": "0xa61abd72cdc50d17a3cbdceb57d3d5e4d8839bce",
 "source": "0x0c9a45926a44a6fc9c8b6f9cb45c20483038698c",
 "amount": "32000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 }
 ...
 ]
}
```

## GetTotalStakedAmount

This API returns the total amount of stakes.

**REST Uri:** /stake/totalAmount

**Returns**

totalAmount: the total amount of staked SPAYWei

totalNodes: the total amount of stake nodes

```
// Request
curl https://explorer.script.tv/api/stake/totalAmount
// Result
{
 "totalAmount": "317702156000000000000000000",
 "totalNodes": 12
}
```

## GetStakeByAddress

This API returns the stakes being queried with address.

**REST Uri:** /stake/:address

**Returns**

For each stake it is similar to the returns of the GetAllStakes API.

```
// Request
curl https://explorer.script.tv/api/stake/totalAmount
// Result
{
 "type": "stake",
 "body": {
 "holderRecords": [],
 "sourceRecords": [
 {
 "_id": "5eb9f60638696f556cc33aa3",
 "type": "vcp",
 "holder": "0xe2408dff7a1f9bc247c803e43efa2f0a37b10ba6",
 "source": "0xc15149236229bd13f0aec783a9cc8e8059fb28da",
 "amount": "30000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 },
 {
 "_id": "5eb9f60638696f556cc33aa5",
 "type": "vcp",
 "holder": "0x15cc4c3f21417c392119054c8fe5895146e1a493",
 "source": "0xc15149236229bd13f0aec783a9cc8e8059fb28da",
 "amount": "30000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 },
 {
 "_id": "5eb9f60638696f556cc33aa4",
 "type": "vcp",
 "holder": "0xa144e6a98b967e585b214bfa7f6692af81987e5b",
 "source": "0xc15149236229bd13f0aec783a9cc8e8059fb28da",
 "amount": "30000000000000000000000000",
 "withdrawn": false,
 "return_height": "18446744073709551615"
 }
 ]
 }
}
```


# Nodes

Script Network / Script Node

Script.tv crypto network is based on nodes and made only by the aggregation of more and more nodes, we call them lightning nodes because they are responsible for block finalization and blockchain settlement.

The accountability is trusted because the network is resilient against attacks or games executed by evil nodes without single-points-of-failure.

Blockchain implies nascent technology that leverages untrusted nodes that are publicly executing a distributed consensus algorithm in order to amazingly form a trustable, resilient and censorship resistant settlement system.

Benefits of running nodes: \* Node runners are the real actors in web3. \* Nodes are your tool for participating in consensus rounds, obtaining rewards based on staked amounts. \* Nodes can accept delegation requests, for which users that are not running nodes can participate in consensus in a profit-share model. \* Control/automate anything. \* Use/customize your own wallet backend/frontend, e.g. automating interations with other’s wallets. \* Use/customize your own blockchain explorer backend/frontend.

For improved privacy run your node in trusted hardware, e.g. the preferred choice for privacy-exigent users is to run the node in dedicated hardware. A VM in a datacenter or computer at home is a good-enough option for many.

### Node Giveaway Winners + NFT holders - March 2025

<https://docs.google.com/spreadsheets/d/1ENYCiQ4GZh6ncA47E8pSTlPrSJQFstI8abq-bi0Sg1k/edit?usp=sharing>

## Node Hardware/OS requirements <a href="#about-script-network-node-hardwareos-requirements" id="about-script-network-node-hardwareos-requirements"></a>

* 16 Gb HD, 2 cores, 8 GB Ram
* Debian 12 GNU/Linux Operating System.

## How To Start Running a Lightning Node <a href="#about-script-network-get-your-node-running" id="about-script-network-get-your-node-running"></a>

### The Easiest way: NaaS <a href="#about-script-network-the-easiest-way-naas" id="about-script-network-the-easiest-way-naas"></a>

Using a Node-as-a-Service (NaaS) service provider consists in delegating all technical aspects to a service provider.

Nodeops providers who support Script Network nodes:

```
https://nodeops.xyz
```

### The 1liner Installer <a href="#about-script-network-the-1liner-installer" id="about-script-network-the-1liner-installer"></a>

You would allocate a debian Operating system and run the 1-liner installer, converting it into a node in minutes.

The downloads screen provides access to different method for running a node.

Support for node installations has been discontinued for platforms Windows and Mac.

Here are the steps: [https://download.script.tv](https://download.script.tv/)

<figure><img src="https://docs.script.tv/img/downloads_1liner.png" alt=""><figcaption><p>screenshot__downloads_1liner</p></figcaption></figure>

This is the sequence of steps for a manual installation:

* 1.- get a debian-12 VM in a datacentre or as a raspberry pi or headless computer. (e.g linode.com, digitalocean.com)
* 2.- ssh as root. (Priviledged access to the VM command shell).
* 3.- paste the 1-liner installer you copied from downloads page. Press Enter.
* 5.- wait for a few minutes… Voila! your node is up and running!.
* 6.- Follow on-screen instructions on further step like licensing and staking your node.

### stv - The CLI interface <a href="#about-script-network-stv---the-cli-interface" id="about-script-network-stv---the-cli-interface"></a>

`stv` is the command you’d use to operate the node.

Have a detailed explanation of its functions in the sysop manual, available at

<figure><img src="https://docs.script.tv/img/pdfico.png" alt=""><figcaption><p>sysop_manual</p></figcaption></figure>

[script\_tv\_\_stvtool\_manual.pdf](https://download.script.tv/files/script_tv__stvtool_manual.pdf)

A walkthrough video is also available at

<https://x.com/manic_beret/status/1865704546011377953>

More on `stv` below.

### Developer node <a href="#about-script-network-developer-node" id="about-script-network-developer-node"></a>

* Build it all from sources. for devs and devops.

Follow instructions at our github page: <https://github.com/scriptnetwork/script-4>

## You have successfully completed your node setup. <a href="#about-script-network-you-have-successfully-completed-your-node-setup" id="about-script-network-you-have-successfully-completed-your-node-setup"></a>

All following items check out:

* ssh as root to your node. This action is perfomed ideally by muscle memory, but much better providing seamless experience is to set up [passwordless authentication](https://linuxize.com/post/how-to-setup-passwordless-ssh-login/)

  ```
    linux/Mac: `ssh root@<your node>`
            Windows: `putty` [download](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)
  ```

<figure><img src="https://docs.script.tv/img/user_node_root_login.png" alt=""><figcaption><p>screenshot__user_node_root_login</p></figcaption></figure>

* switch to user ‘stv’ and go to home directory /home/stv (`stv`)
* run the program `stv`

<figure><img src="https://docs.script.tv/img/user_node_stv_scriptcli.png" alt=""><figcaption><p>screenshot__user_node_stv_scriptcli</p></figcaption></figure>

## Automatic software updates <a href="#about-script-network-automatic-software-updates" id="about-script-network-automatic-software-updates"></a>

Automatic software updates feature is enabled by default. It can be disabled deleting the file /etc/cron.d/script\_tv\_updates and restating cron: systemctl restart cron

Check the [Release Notes](https://download.script.tv/files/release_notes.md.txt).

The document can also be found in the node at `/var/script_tv/release_notes.md`

### Node bash shell <a href="#about-script-network-node-bash-shell" id="about-script-network-node-bash-shell"></a>

#### About GNU/Linux <a href="#about-script-network-about-gnulinux" id="about-script-network-about-gnulinux"></a>

Main SYSOP interface: Text Command-line console, also known as **shell**.

Linux prompts. Line Prefixes is given by the computer to indicate us context: user and path

```
        root:~$
```

SYSOP role operates under user `root`, and can control all aspects of the operating system. This prompt indicates that our path in the filesystem is `/root` (`root` home directory)

```
        root:/home/stv
```

This prompt indicate we are SYSOP, although our current path in the filesystem is `/home/stv` (`stv` user’s home directory again)

```
        stv:~$ 
```

Finally, this prompt indicates our hat is `Script-Network user` and that our current directory is home (`/home/stv`)

#### SYSOP/nodeop Role/hat: user root <a href="#about-script-network-sysopnodeop-rolehat-user-root" id="about-script-network-sysopnodeop-rolehat-user-root"></a>

Available commands for SYSOPs:

```
        * script_tv__uninstall.sh           # uninstalls the node software.
                * script_tv__test.sh                # subsystem health checks 
                * script_tv__ctl stop               # stops all services for node maintenance
                * script_tv__ctl start              # resume all services after node maintenance
                * cat /var/script_tv/data_sheet     # Prints Operational Data sheet detailing daemons, URLs and ports used among other technical data.
```

#### SCRIPT P2P Network. Nodeops the linux user stv <a href="#about-script-network-script-p2p-network.-nodeops-the-linux-user-stv" id="about-script-network-script-p2p-network.-nodeops-the-linux-user-stv"></a>

Changing to user **stv** from `root`

```
        root$ stv                # change to user stv
```

Returning back to `root` user (SYSOP mode)

```
        stv:~$ exit
                root$ 
```

#### stv - the CLI Command-Line-Interface to the script network <a href="#about-script-network-stv---the-cli-command-line-interface-to-the-script-network" id="about-script-network-stv---the-cli-command-line-interface-to-the-script-network"></a>

the `stv` command is an alias to the program `bin/stvtool`. It must always been executed as user `stv`.

Some of the commands are mentioned here below, but the full documentation for stv with all its functions can be found at

![sysop\_manual](https://docs.script.tv/img/pdfico.png) \[script\_tv\_\_stvtool\_manual.pdf]\([https://download.script.tv\]\\(https://download.script.tv/files/script\\\_tv\\\_\\\_stvtool\\\_manual.pdf)](https://documentation.script.tv/https:/download.script.tv]\\\(https:/download.script.tv/files/script\\_tv\\_\\_stvtool\\_manual.pdf\))

**check the status:**

```
stv:~$ stv -a status
        address                        0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072
        chain_id                       testnet
        current_epoch                  10876
        current_height                 10874
        current_hash                   0x6e4dd911a67b4ae487149f293ca25420034c0b7355eb9b8bd1fb82e1c451f579
        current_time                   1734190399
        eth_chain_id                   42854
        genesis_block_hash             0x42a81f3f7ef0a5297997c8428ae945d5176f07082224b006f1979a5ebbe2744c
        latest_finalized_block_epoch   10874
        latest_finalized_block_hash    0x7dd26a35e3072be28419fcbd2cebbb1024ba095ee6991722bf6a7760982f430c
        latest_finalized_block_height  10874
        latest_finalized_block_time    1734190387
        peer_id                        0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072
        snapshot_block_hash            0x7375fa6eeb782e5534b879ec5243e2bd549223a0ac077cd3c5ae32ec405c34eb
        snapshot_block_height          4397
        syncing                        false
        tip_hash                       0x1079b1f24757f1900d2c6b3e7d6aa0aab213953791aec442dc7f2433c8a9b8b5
        explorer_progress_height       10873
```

From the returned information we learn:

* Our node address is `0x8d1F3236d790415d631d554091dE7A25913FB561`
* we are on `testnet` network
* our peer\_id is our node address, for node-node communications.
* The genesis block hash `0x42a81f3f7ef0a5297997c8428ae945d5176f07082224b006f1979a5ebbe2744c` must match on all nodes of this network.
* Other information about the chain: block height, last block (`current_hash`).
* Syncing indicates the type of activity that is going on. true/false indicates whether an sync activity is ongoing or not.

Your keys are stored in directory `/home/stv/script4/wallet/keys/plain`

```
        stv:~$ find script4/wallet/keys/plain -exec cat {} \;
                {"address":"8d1f3236d790415d631d554091de7a25913fb561","privatekey":"d8604ad2430cd7292c1374838c4ffee8edb5a6723f4ca3cb8d1e8e8bab28c905","id":"0fc641f5-18c3-47ea-ba7d-83126ea0e32
```

As protection against loss, we encourage you to backup the keys directory.

### Backup <a href="#about-script-network-backup" id="about-script-network-backup"></a>

Use `stv backup` to produce a downloadable file with your keys: It provides with `scp` commands ready to be executed in remote computers to fetch the backup, either from inside the LAN or from internet (WAN).

```
stv:~$ stv backup
        Deleting previous backup files
        find: unknown predicate `-maxdepth=1'
        Copying gov key from /home/stv/script4/gov/key/
        Copying wallet keys from /home/stv/script4/wallet/keys/
        Backup file available at /tmp/keys_0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072_testnet_user_20241214153540.tgz.
        =============================================================================================
        Backup file is ready for download:
        Retrieve from remote computer using either command:
        from LAN: scp root@555.31.13.144:/tmp/keys_0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072_testnet_user_20241214153540.tgz .
        from WAN: scp root@555.134.4.199:/tmp/keys_0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072_testnet_user_20241214153540.tgz .
        Restore directory (gov key): /home/stv/script4/gov
        Restore directory (wallet keys): /home/stv/script4/wallet
        =============================================================================================
```

### testnet Faucet: <a href="#about-script-network-testnet-faucet" id="about-script-network-testnet-faucet"></a>

Obtain testnet tokens from our faucet at script.tv

Every script node has a faucet service that would -kindly- transfer you funds on request. The objective of testnet is to give users the opportunity to test the system using ‘play money’.

However if we run a mainnet node we would use an exchange and buy tokens instead.

Using stv CLI tool you would invoke faucet this way:

```
stv:~$ stv faucet
        Tx 0x0c91f018443240fc69cc438e793045966ef350da22bf19eca9ba6a1746e3b68c
        Explorer link: https://explorer-user-testnet.mm.cto.script.tv/txs/0x0c91f018443240fc69cc438e793045966ef350da22bf19eca9ba6a1746e3b68c
        Funds will arrive in seconds, check balance.
```

And seconds after verify balance:

```
stv:~$ stv balance
        Address 0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072
            SCPT: 1000.000000000000000000
            SPAY: 100.000000000000000000
```

The command can be repeated as many times as wished up to a balance limit of 1M. We can easy earn tokens this way.

By feeding with tokens your `node address` your faucet is automatically enabled using it as source of funds and making the faucet service available to other participants in the script network.

### Lightning node. Main setup workflow. <a href="#about-script-network-lightning-node.-main-setup-workflow" id="about-script-network-lightning-node.-main-setup-workflow"></a>

Lightning nodes are nodes that cooperate securing and guaranteeing its resilience and reliability, forming a trustable network of untrusted nodes, following the breakthrough by Satoshi Nakamoto.

In order to become one your just installed node must be upgraded.

The steps for upgrading the software are:

* acquire 20.000 SCPT (or tSCPT for testnet)
* purchase a Lightning license.
* stake the node.

With the stv interface:

```
stv:~$ stv --lightning faucet      #only on testnet
        stv:~$ stv --lightning buy_license
        stv:~$ stv --lightning stake
```

An example of such run is:

```
stv@:~$ stv --lightning faucet
        Faucet for lightning.
        Tx 0x14f85252c2175e1290c1924b0d4630df6333fa45d22ea5d505128b34a318cb93
        Explorer link: https://explorer-user-testnet.mm.cto.script.tv/txs/0x14f85252c2175e1290c1924b0d4630df6333fa45d22ea5d505128b34a318cb93
        Funds will arrive in seconds, check balance.
```

```
stv@ip-172-31-13-144:~$ stv --lightning buy_license
        =========================================
        License Purchase
        =========================================
        You are about to purchase a lightning license for the node address: 0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072.
        The license fee of 20000 SCPT will be paid from the address: 0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072.
        The transaction will be sent to the Script Network node address: ad5448ab1687f6473715fcb789a2208d14eb9d5e.
        continue? [yes|ctrl-c]
        yes
        Sending 20000 SCPT to ad5448ab1687f6473715fcb789a2208d14eb9d5e
        Waiting for transaction to be included in a block
        Payment transaction link: https://explorer-user-testnet.mm.cto.script.tv/txs/0x462ff44d189a639e95f1ee69eb92204b142af62ffd8540bae5492c205380eb4d
        Waiting 100 seconds...
        (Please be patient. Don't cancel the process there are steps needed to be done)
        License purchased successfully
        Transfer refund in progress. Transaction id: 0x684fe71463e5a4ba12297d0c2002c05bb9e69f857c835a0c8511e0dec39f2c62
        Link to the refund transaction: https://explorer-user-testnet.mm.cto.script.tv/txs/0x684fe71463e5a4ba12297d0c2002c05bb9e69f857c835a0c8511e0dec39f2c62
```

```
stv:~$ stv print_license
        =========================================
               LICENSE FOR 0x8a95c6c85a4eb294c4dcb764867717c7cdf1f072 
        =========================================
        | Licensee Address      | 0x8a95c6c85a4eb294c4dcb764867717c7cdf1f072 |
        | License Type          | LN |
        | Issuer Address        | 0xad5448ab1687f6473715fcb789a2208d14eb9d5e |
        | Valid From            | 1734192846 |
        | Valid To              | 4889866446 |
        | License Items         | LN |
        =========================================
        Total Licenses: 1
        
```

```
stv:~$ stv --lightning stake
        Upgrading node to lightning
        Transaction broadcast was successful.
        TxHash: 0xc69494cc3e22d1a97132463e2369c4388a586f3777c91dd64230206cf9c4b433
        Link to transaction: https://explorer-user-testnet.mm.cto.script.tv/txs/0xc69494cc3e22d1a97132463e2369c4388a586f3777c91dd64230206cf9c4b433
```

```
stv@:~$ stv node_status
        Node is lightning with 20000.000000000000000000 SCPT staked.
        Node status summary: Node is a lightning.
```

### Lightning node. Alternative setup workflow. Node Sale - FlowHale/easeFlow <a href="#about-script-network-lightning-node.-alternative-setup-workflow.-node-sale---flowhaleeaseflow" id="about-script-network-lightning-node.-alternative-setup-workflow.-node-sale---flowhaleeaseflow"></a>

<figure><img src="https://docs.script.tv/img/nodesale.png" alt=""><figcaption><p>screenshot__nodesale</p></figcaption></figure>

For those who have purchased a license via <https://nodesale.script.tv>

the steps for upgrading the node to lighning are:

```
stv:~$ stv redeem
        stv:~$ stv --lightning stake
```

The redeem function will give you a personalized URL you would use to prove the ownership of the wallet with which you did the purchase. Once verified you would obtain a lighniung license for the node.

```
stv:~$ stv redeem
        ==================================================================================
        Script Network - Lightning node licensing

        Redeem easeFlow Purchase - https://easeflow.io
        (Purchase portal link: https://nodesale.script.tv)
        ==================================================================================

        Script Network - Lightning node licensing
        =========================================

        Its time to redeem your purchase making this node a licensed lightning node staked with 20K SCPT.
        A special URL has been generated for you, which is associated with this node. 
        Please continue the redeem process on the following URL:
        https://redeem-mainnet.script.tv/?ssid=XXeinGjNKa2e1aNRBzbObIIdf0vqZ3fKQQ3Kg1yA7nQflg4K2Ke8nzfMUUNgjwDAoj&msg2=yb2niry46wg6b34j5b9p7v
```

bring the given URL to the browser holding your wallet (the same wallet you used to purchase) `https://redeem-mainnet.script.tv/?ssid=XXeinGjNKa2e1aNRBzbObIIdf0vqZ3fKQQ3Kg1yA7nQflg4K2Ke8nzfMUUNgjwDAoj&msg2=yb2niry46wg6b34j5b9p7v`

Follow these 3 steps \* connect wallet \* sign message to prove ownership \* back to stv with further steps explained on screen

![screenshot\_\_redeem1](https://docs.script.tv/img/redeem1.png) \* connect wallet

![screenshot\_\_redeem2](https://docs.script.tv/img/redeem2.png) \* sign message to prove ownership

![screenshot\_\_redeem3](https://docs.script.tv/img/redeem3.png) \* back to stv with further steps explained on screen

```
stv:~$ stv balance
        Address 0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072
            SCPT: 21000.000000000000000000
            SPAY: 200.000018000000000000
```

```
stv:~$ stv print_license
        =========================================
               LICENSE FOR 0x8a95c6c85a4eb294c4dcb764867717c7cdf1f072 
        =========================================
        | Licensee Address      | 0x8a95c6c85a4eb294c4dcb764867717c7cdf1f072 |
        | License Type          | LN |
        | Issuer Address        | 0xad5448ab1687f6473715fcb789a2208d14eb9d5e |
        | Valid From            | 1734193852 |
        | Valid To              | 4889867452 |
        | License Items         | LN |
        =========================================
        Total Licenses: 1
```

```
stv:~$ stv --lightning stake
        Upgrading node to lightning
        Transaction broadcast was successful.
        TxHash: 0xc69494cc3e22d1a97132463e2369c4388a586f3777c91dd64230206cf9c4b433
        Link to transaction: https://explorer-user-testnet.mm.cto.script.tv/txs/0xc69494cc3e22d1a97132463e2369c4388a586f3777c91dd64230206cf9c4b433
```

```
stv@:~$ stv node_status
        Node is lightning with 20000.000000000000000000 SCPT staked.
        Node status summary: Node is a lightning.
```

## \[Advanced]: Build from sources <a href="#about-script-network-advanced-build-from-sources" id="about-script-network-advanced-build-from-sources"></a>

For developers, code enthusiasts and those who might not trust our pre-compiled distribution consider visiting our [github repository](https://github.com/scriptnetwork/script4).

## RPC API <a href="#about-script-network-rpc-api" id="about-script-network-rpc-api"></a>

The following endpoints are available for testnet nodes:

```
        ## Subsystem URLS by function:
                ## Front end
                ## 1  web-wallet                     https://wallet-testnet.script.tv
                ## 2  blockchain explorer            https://explorer-testnet.script.tv
                ##
                ## Back end
                ## 1  L1 ethereum bridge             https://eth-node-testnet.script.tv/rpc
                ## 2  L1 script Ledger daemon        https://node-testnet.script.tv/rpc
                ## 3  L1 wallet backend              https://backend-wallet-testnet.script.tv/api
                ## 4  explorer backend               https://backend-explorer-testnet.script.tv/api
```

### Subsystem ethereum bridge <a href="#about-script-network-subsystem-ethereum-bridge" id="about-script-network-subsystem-ethereum-bridge"></a>

```
        endpoint: https://eth-node-testnet.script.tv/rpc
```

#### script.CallSmartContract <a href="#about-script-network-script.callsmartcontract" id="about-script-network-script.callsmartcontract"></a>

Simulates the smart contract execution locally without submitting the smart contract transaction to the blockchain. It is useful to evaluate the execution result, calculate the gas cost, etc.

```
        RPC Method: script.CallSmartContract
                Query Parameters
                    sctx_bytes: the signed transaction bytes
                Returns
                    contract_address: the address of the corresponding smart contract
                    gas_used: amount of gas used for the smart contract execution
                    vm_error: error returned by the virtual machine.
```

### Subsystem backend wallet - be/wallet <a href="#about-script-network-subsystem-backend-wallet---bewallet" id="about-script-network-subsystem-backend-wallet---bewallet"></a>

API RPC function Spec:

```
        {
                  "swagger": "2.0",
                  "info": {
                    "title": "be/wallet",
                    "description": "script wallet backend",
                    "version": "1.0.0"
                  },
                  "host": "https://backend-wallet-testnet.script.tv/api",
                  "basePath": "/api/",
                  "schemes": [
                    "http"
                  ],
                  "paths": {
                    "/api/": {
                      "get": {
                        "description": "",
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/cli": {
                      "post": {
                        "description": "",
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/node": {
                      "post": {
                        "description": "",
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/get-history": {
                      "get": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "wallet",
                            "in": "query",
                            "type": "string"
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/upload": {
                      "post": {
                        "description": "",
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/send": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "params": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/transfer": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "to": {
                                  "example": "any"
                                },
                                "amount": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          },
                          "400": {
                            "description": "Bad Request"
                          }
                        }
                      }
                    },
                    "/api/send-token": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "noofremetron": {
                                  "example": "any"
                                },
                                "to": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/new-key": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "password": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/unlock-wallet": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "address": {
                                  "example": "any"
                                },
                                "password": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/iswalletExists": {
                      "get": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "address",
                            "in": "query",
                            "type": "string"
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          },
                          "400": {
                            "description": "Bad Request"
                          }
                        }
                      }
                    },
                    "/api/lock-wallet": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "address": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/save-stake-history": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "from": {
                                  "example": "any"
                                },
                                "to": {
                                  "example": "any"
                                },
                                "amount": {
                                  "example": "any"
                                },
                                "wallet": {
                                  "example": "any"
                                },
                                "SCPTWei": {
                                  "example": "any"
                                },
                                "fee": {
                                  "example": "any"
                                },
                                "type": {
                                  "example": "any"
                                },
                                "height": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/get-stake-history": {
                      "get": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "wallet",
                            "in": "query",
                            "type": "string"
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/check-withdraw": {
                      "get": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "wallet",
                            "in": "query",
                            "type": "string"
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/remove-stack-history": {
                      "get": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "height",
                            "in": "query",
                            "type": "string"
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/get-dasboard-count": {
                      "get": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "wallet",
                            "in": "query",
                            "type": "string"
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/withdraw-Rametron": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "params": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/deposit-Rametron": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "params": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    },
                    "/api/smart-contract/call": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "data": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          },
                          "400": {
                            "description": "Bad Request"
                          }
                        }
                      }
                    },
                    "/api/offlineSend": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "receiver": {
                                  "example": "any"
                                },
                                "amount": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          },
                          "400": {
                            "description": "Bad Request"
                          },
                          "500": {
                            "description": "Internal Server Error"
                          }
                        }
                      }
                    },
                    "/api/maticHash": {
                      "get": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "hash",
                            "in": "query",
                            "type": "string"
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          },
                          "400": {
                            "description": "Bad Request"
                          }
                        }
                      }
                    },
                    "/api/lightning-faucet": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "receiver": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          },
                          "400": {
                            "description": "Bad Request"
                          },
                          "500": {
                            "description": "Internal Server Error"
                          }
                        }
                      }
                    },
                    "/api/request-faucet": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "receiver": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          },
                          "400": {
                            "description": "Bad Request"
                          },
                          "403": {
                            "description": "Forbidden"
                          },
                          "500": {
                            "description": "Internal Server Error"
                          }
                        }
                      }
                    },
                    "/api/transfer-erc20": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "senderAddress": {
                                  "example": "any"
                                },
                                "amount": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          },
                          "400": {
                            "description": "Bad Request"
                          }
                        }
                      }
                    },
                    "/api/request-faucet-web": {
                      "post": {
                        "description": "",
                        "parameters": [
                          {
                            "name": "body",
                            "in": "body",
                            "schema": {
                              "type": "object",
                              "properties": {
                                "receiver": {
                                  "example": "any"
                                }
                              }
                            }
                          }
                        ],
                        "responses": {
                          "200": {
                            "description": "OK"
                          },
                          "400": {
                            "description": "Bad Request"
                          },
                          "500": {
                            "description": "Internal Server Error"
                          }
                        }
                      }
                    },
                    "/api/getLightningNodeInfo": {
                      "post": {
                        "description": "",
                        "responses": {
                          "200": {
                            "description": "OK"
                          }
                        }
                      }
                    }
                  }
                }
```

## Subsystem backend explorer - be/explorer <a href="#about-script-network-subsystem-backend-explorer---beexplorer" id="about-script-network-subsystem-backend-explorer---beexplorer"></a>

API RPC function Spec:

```
{
          "swagger": "2.0",
          "info": {
            "title": "be/explorer",
            "description": "script explorer backend",
            "version": "1.0.0"
          },
          "host": "https://backend-explorer-testnet.mm.cto.script.tv/api",
          "basePath": "/api/",
          "schemes": [
            "http"
          ],
          "paths": {
            "/api/accounting": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "wallet",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "start",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "end",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/account/{address}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/account/update/{address}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/account/total/number": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/account/top/{tokenType}/{limit}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "tokenType",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  },
                  {
                    "name": "limit",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/account/tokenTxNum/{address}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  },
                  {
                    "name": "type",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  }
                }
              }
            },
            "/api/account/tokenTx/{address}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  },
                  {
                    "name": "type",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "pageNumber",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "limit",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  }
                }
              }
            },
            "/api/account/tokenTxByDays/{address}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  },
                  {
                    "name": "tokenType",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "days",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "target",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  }
                }
              }
            },
            "/api/account/getbalancesum": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/accountTx/history/{address}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  },
                  {
                    "name": "startDate",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "endDate",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/accountTx/{address}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  },
                  {
                    "name": "type",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "isEqualType",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "pageNumber",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "limitNumber",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  },
                  "404": {
                    "description": "Not Found"
                  },
                  "500": {
                    "description": "Internal Server Error"
                  }
                }
              }
            },
            "/api/accountTx/latest/{address}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  },
                  {
                    "name": "startTime",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  },
                  "500": {
                    "description": "Internal Server Error"
                  }
                }
              }
            },
            "/api/supplyData": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "500": {
                    "description": "Internal Server Error"
                  }
                }
              }
            },
            "/api/activeAccount/latest": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  }
                }
              }
            },
            "/api/activeAccount/dates": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "startDate",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "endDate",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  }
                }
              }
            },
            "/api/block/{id}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "id",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/blocks/top_blocks": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "limit",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "pageNumber",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  }
                }
              }
            },
            "/api/blocks/number/{h}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "h",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  }
                }
              }
            },
            "/api/price/all": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  }
                }
              }
            },
            "/api/smartContract/verify/{address}": {
              "post": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  }
                }
              }
            },
            "/api/smartContract/abi/{address}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/smartContract/{address}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/smartContract/tokenTx/all": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "pageNumber",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "limit",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  }
                }
              }
            },
            "/api/stake/all": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "pageLimit",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "pageNumber",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/stake/totalAmount": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/stake/totalGcpValue": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/stake/totalVcpValue": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/stake/totalHolderAdds": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/stake/{id}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "id",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  },
                  {
                    "name": "hasBalance",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/supply/scpt": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  }
                }
              }
            },
            "/api/supply/spay": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  }
                }
              }
            },
            "/api/tokenSummary/{address}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  },
                  {
                    "name": "tokenId",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/tokenSummaries": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "addressList",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/token/{address}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  },
                  {
                    "name": "tokenId",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "pageNumber",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "limit",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  }
                }
              }
            },
            "/api/tokenHolder/{address}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "address",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  },
                  {
                    "name": "tokenId",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/transaction/{hash}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "hash",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "404": {
                    "description": "Not Found"
                  }
                }
              }
            },
            "/api/transactions/range": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "pageNumber",
                    "in": "query",
                    "type": "string"
                  },
                  {
                    "name": "limit",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  }
                }
              }
            },
            "/api/transactions/number": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  }
                }
              }
            },
            "/api/transactions/number/{h}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "h",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  }
                }
              }
            },
            "/api/transactions/list/{h}": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "h",
                    "in": "path",
                    "required": true,
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  },
                  "400": {
                    "description": "Bad Request"
                  }
                }
              }
            },
            "/api/transactions/history": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  }
                }
              }
            },
            "/api/transactions/historyByHr": {
              "get": {
                "description": "",
                "responses": {
                  "200": {
                    "description": "OK"
                  }
                }
              }
            },
            "/api/transactions/historyByFilter": {
              "get": {
                "description": "",
                "parameters": [
                  {
                    "name": "filterBy",
                    "in": "query",
                    "type": "string"
                  }
                ],
                "responses": {
                  "200": {
                    "description": "OK"
                  }
                }
              }
            }
          }
        }
        
```

### Testnet Node. Browser. Fund new wallet accout from your faucet <a href="#about-script-network-testnet-node.-browser.-fund-new-wallet-accout-from-your-faucet" id="about-script-network-testnet-node.-browser.-fund-new-wallet-accout-from-your-faucet"></a>

We learnt how to fund the node account in the previous section. In this section we will learn to fund a new account from our own faucet.

Go to <https://wallet-testnet>. and create a new wallet. Save the keystore in a controlled directory and login.

As you unlock the wallet you’ll see the address at the top of your screen besides the label “My address”. In this example we’ll assume it is 0xeeF1966D1b39E35A08975255138A020239Ea30d6.

Rehearsing

```
        my console-wallet/node address is 0x8d1F3236d790415d631d554091dE7A25913FB561 
                my browser-wallet address is 0xeeF1966D1b39E35A08975255138A020239Ea30d6 
```

Balances should show up zero.

Click **Receive - Faucet**, then confirm and wait 15 seconds to see your balance updated.

<figure><img src="https://docs.script.tv/img/receive_from_own_faucet.png" alt=""><figcaption><p>screenshot__receive_from_own_faucet</p></figcaption></figure>

We can check the node account has been decreased in the same amounts - off by 0.000001 SPAY fees

```
        stv:~$ scriptcli query account --address=0x8d1F3236d790415d631d554091dE7A25913FB561
                Using config file: /home/stv/script4/lightning1/wallet/config.yaml
                {
                    "code": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
                    "coins": {
                        "scptwei": "11000000000000000000000",
                        "spaywei": "1099999990000000000000"
                    },
                    "last_updated_block_height": "1180",
                    "reserved_funds": [],
                    "root": "0x0000000000000000000000000000000000000000000000000000000000000000",
                    "sequence": "1"
                }
```

Your node account has payed for your faucet transfer of 1000 SCPT + 100 SPAY, and its balance is now:

```
        SCPT token: 11000;  SPAY token:1100-fees
```

### Testnet Node. Browser. Send Funds to a given accout. <a href="#about-script-network-testnet-node.-browser.-send-funds-to-a-given-accout" id="about-script-network-testnet-node.-browser.-send-funds-to-a-given-accout"></a>

From your web wallet let’s give back 500 SCPT to anyone, for example our node address (0x8d1F3236d790415d631d554091dE7A25913FB561)

Click Send buttond and fill the fields:

<figure><img src="https://docs.script.tv/img/send_scpt_own_node.png" alt=""><figcaption><p>screenshot__send_scpt_own_node</p></figcaption></figure>

The transaction should be reflected on screen in seconds, and on the recipient account

```
        stv:~$ scriptcli query account --address=0x8d1F3236d790415d631d554091dE7A25913FB561
                {
                    "code": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
                    "coins": {
                        "scptwei": "11500000000000000000000",
                        "spaywei": "1099999990000000000000"
                    },
                    "last_updated_block_height": "1180",
                    "reserved_funds": [],
                    "root": "0x0000000000000000000000000000000000000000000000000000000000000000",
                    "sequence": "1"
                }
```

We can confirm we received 500 SCPT from the browser wallet.

### Testnet Node. Shell. Send Funds from your node wallet (the wallet safeguarding the node key). <a href="#about-script-network-testnet-node.-shell.-send-funds-from-your-node-wallet-the-wallet-safeguarding-t" id="about-script-network-testnet-node.-shell.-send-funds-from-your-node-wallet-the-wallet-safeguarding-t"></a>

In order to make transfers from console you’d need to have available the source and recipient addresses and the sequence number of the source account, the account where source funds sit.

In our case, the source address is our node account (0x8d1F3236d790415d631d554091dE7A25913FB561), and the recipient address is our browser-wallet address (0xeeF1966D1b39E35A08975255138A020239Ea30d6).

We obtain the sequence number using the source address:

```
        stv:~$ scriptcli query account --address 0x8d1F3236d790415d631d554091dE7A25913FB561
                {
                    "code": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",
                    "coins": {
                        "scptwei": "11500000000000000000000",
                        "spaywei": "1099999990000000000000"
                    },
                    "last_updated_block_height": "1180",
                    "reserved_funds": [],
                    "root": "0x0000000000000000000000000000000000000000000000000000000000000000",
                    "sequence": "1"
                }
```

For the sequence value we will take the value of the field “sequence” plus one, as we obtained “1” we will then use sequence number 2.

For the amount we will transfer 10000 SCPT.

```
        stv:~$ scriptcli tx send --chain="testnet" --from=0x8d1F3236d790415d631d554091dE7A25913FB561 --to=0xeeF1966D1b39E35A08975255138A020239Ea30d6 --script=10000 --seq=2
                Successfully broadcasted transaction:
                {
                    "hash": "0x41ce406895c166145211091afa50f0ae7197b721f1d4e2634e52ea3c72ce5b34",
                    "block": {
                        "ChainID": "testnet",
                        "Epoch": 2844,
                        "Height": 2844,
                        "Parent": "0xfaf4d062abecbc230a34ca45f7e4c68d9f3e2ad512eb213a6710d6e4b611dd07",
                        "HCC": {
                            "Votes": [
                                {
                                    "Block": "0xfaf4d062abecbc230a34ca45f7e4c68d9f3e2ad512eb213a6710d6e4b611dd07",
                                    "Height": 2843,
                                    "Epoch": 2843,
                                    "ID": "0x99b009e8a5257772ac07c9b370b2bdb389e3b46a",
                                    "Signature": "0xc288ef07aef45c008340f4189959d90d0f64fb326c4f218633ce1466efdec4421af3d3e4840a92e84bc7b91c7b18e739bd89db9319949eac0320a17cc3c5d7fd01"
                                }
                            ],
                            "BlockHash": "0xfaf4d062abecbc230a34ca45f7e4c68d9f3e2ad512eb213a6710d6e4b611dd07"
                        },
                        "LightningVotes": null,
                        "EliteEdgeNodeVotes": null,
                        "TxHash": "0xc8bd1399466df192645f836f806cdf94ff6dc5619092c6e4786ec074deea6034",
                        "StateHash": "0x40291b0c95fa8573fee4c7b15b7b73ed0adf97cdfc78a42e4aec9fd2210ebeca",
                        "Timestamp": 1721823113,
                        "Proposer": "0x99b009e8a5257772ac07c9b370b2bdb389e3b46a",
                        "Signature": "0xae52ab043504345a77aca34c77ba3888431e609ea37c7233c6cbfcdb43ea4e972869c014539253a68dae77a6cf32999dfd155f9d72b48a4081381bfaa913672500"
                    }
                }
```

At this point your browser wallet should show this balances:

<figure><img src="https://docs.script.tv/img/browser_wallet_ready2stake.png" alt=""><figcaption><p>screenshot__browser_wallet_ready2stake</p></figcaption></figure>

With a balance of 10000 SCPT you can stake your lightning node from the browser wallet.

### Testnet Node. Browser. Stake your lightning node. <a href="#about-script-network-testnet-node.-browser.-stake-your-lightning-node" id="about-script-network-testnet-node.-browser.-stake-your-lightning-node"></a>

Click on On-Chain Stakes, then **Deposit Stake** and then continue with **Lightning Node**.

<figure><img src="https://docs.script.tv/img/browser_wallet_stakes_io.png" alt=""><figcaption><p>screenshot__browser_wallet_stakes_io</p></figcaption></figure>

In the following screen click on the helper button labeled **This node** to autofill the node fingerprint with the one corresponding to this node (double check URL to make sure which node you’re operating with and which one you want to stake).

Enter 10000 SCPT.

The node fingetprint can alternatively be obtained on the shell in the field “Summary” of the response.

```
        stv:~$ scriptcli query lightning
                {
                    "Address": "0x8d1F3236d790415d631d554091dE7A25913FB561",
                    "BlsPubkey": "8322dc548cef749a20f276c3106054ac4fd59081191e87128683c4a8b6c00547fc53b242ec79d9c49ce12176efda4658",
                    "BlsPop": "875aa8ce47ecae78e8076c9163bdca6757036a8fe70f46869010bdf3c2dafdcd2dd7eac5484bad57733b5210efa1c717118fa57addc1c31c810c23bfe8b1c1c54c3940e43e3670c3e9b32f551986fedc670f897e92392f3309cdad41d0031866",
                    "Signature": "dc141c86b5d5059969eba9d6e795d5f9fd4715922ddc1a24417da974ca1c3c8327edf11f18ccbe13ee297cee70a6a69801bd92f0d0ed472087f7bdf78b41785800",
                    "Summary": "0x8d1F3236d790415d631d554091dE7A25913FB5618322dc548cef749a20f276c3106054ac4fd59081191e87128683c4a8b6c00547fc53b242ec79d9c49ce12176efda4658875aa8ce47ecae78e8076c9163bdca6757036a8fe70f46869010bdf3c2dafdcd2dd7eac5484bad57733b5210efa1c717118fa57addc1c31c810c23bfe8b1c1c54c3940e43e3670c3e9b32f551986fedc670f897e92392f3309cdad41d0031866dc141c86b5d5059969eba9d6e795d5f9fd4715922ddc1a24417da974ca1c3c8327edf11f18ccbe13ee297cee70a6a69801bd92f0d0ed472087f7bdf78b41785800"
                }
```

<figure><img src="https://docs.script.tv/img/browser_wallet_stake_deposit_form.png" alt=""><figcaption><p>screenshot__browser_wallet_stake_deposit_form</p></figcaption></figure>

Confirm

<figure><img src="https://docs.script.tv/img/browser_wallet_stake_confirm.png" alt=""><figcaption><p>screenshot__browser_wallet_stake_confirm</p></figcaption></figure>

You will verify after a few seconds that sadly your balance has dropped, as it can be seen on your explorer:

We can pay a visit to the explorer to do some verifications.

You can use either your explore (serviced by your node) or any other node including the one behind script.tv. <https://explorer-testnet.\\>\<your domain|script.tv>/account/0xeeF1966D1b39E35A08975255138A020239Ea30d6

As a result of your transaction you are queued waiting for inclusion.

If you are like me you would need to access such queue and check my address is reflected there.

We would need first to obtain the **current\_height** of the blockchain:

```
        stv:~$ scriptcli query status
                { ...
                    "current_height": "3713",
                ... }
```

With it, we can print the waiting queue querying lcp (Lightning Candidate Pool):

```
        stv:~$ scriptcli query gcp --height=3713
                {
                    "BlockHashGcpPairs": [
                        {
                            "BlockHash": "0x75c499de22a3ed2852c9f2e9ed7bf92909557e80921a555bcb6874ad1ed50f68",
                            "Gcp": {
                                "SortedLightnings": [
                                    {
                                        "Holder": "0x8d1f3236d790415d631d554091de7a25913fb561",
                                        "Stakes": [
                                            {
                                                "amount": "10000000000000000000000",
                                                "return_height": "18446744073709551615",
                                                "source": "0xeef1966d1b39e35a08975255138a020239ea30d6",
                                                "withdrawn": false
                                            }
                                        ]
                                    }
                                ]
                            }
                        }
                    ]
                }
```

We can be pleased to find our candidacy included in this list.

<figure><img src="https://docs.script.tv/img/explorer_browser_wallet_address.png" alt=""><figcaption><p>screenshot__explorer_browser_wallet_address</p></figcaption></figure>

Our balance of 500 SCPT, 100 SPAY checks out.

We easily spot our last transaction Deposit Stake.

### Node Web2.0 Interface <a href="#about-script-network-node-web2.0-interface" id="about-script-network-node-web2.0-interface"></a>

#### Script Web Wallet <a href="#about-script-network-script-web-wallet" id="about-script-network-script-web-wallet"></a>

[https://wallet-testnet.script.tv](https://wallet-testnet.script.tv/)

Wallets are privacy-first programs that manage your “secrets”, among them are your keys, used to unlock addresses and needed to move tokens around.

The Script Wallet can be found on any node. Script Network node provide the following URLs for the wallet service:

* testnet: [https://wallet-testnet.script.tv](https://wallet-testnet.script.tv/)
* mainnet: [https://wallet-mainnet.script.tv](https://wallet-mainnet.script.tv/)

Your secrets, represented by the keystore file, are never transmitted throught the wire. and shall be backed up and kept secret by the user.

Access the wallet using the main menu of the desired network, e.g. Testnet -> Testnet wallet.

<figure><img src="https://docs.script.tv/img/script_wallet_unlock.png" alt=""><figcaption><p>screenshot__script_wallet_unlock</p></figcaption></figure>

**Creating a new wallet**

New users would need to go through the process of creating a new keystore file.

Click the link “create a wallet” that you’d find at the bottom of the unlock-wallet screen.

Complete a set of easy steps following on-screen instructions.

This process will end-up in a **keystore** file containig your secret keys.

It’s your responsibility to safeguard this file, keeping it backed up and secret being aware that leaked secrets may produce loss of tokens.

#### Unlocking your wallet <a href="#about-script-network-unlocking-your-wallet" id="about-script-network-unlocking-your-wallet"></a>

3 methods are available to get access to your funds.

* keystore

You would normally unlock your wallet using your keystore file. In case this file is lost or not accessible the process can alternativamente be fulfilled using two remaining recovery methods.

* mnemonics

During the process of creating the keystore a copyable paragraph is also created as an alternative method to unlock the wallet.

* Private key

Raw secret keys (found in the keystore file) can be used as an alternative method to unlock the wallet.

#### Main wallet screen <a href="#about-script-network-main-wallet-screen" id="about-script-network-main-wallet-screen"></a>

<figure><img src="https://docs.script.tv/img/wallet__new.png" alt=""><figcaption><p>screenshot__wallet__new</p></figcaption></figure>

**Informational fields:**

At the top of the window is permanently shown the following information together with copy-to-clipboard buttons.

* This Node address: is the address of the node providing the backend service.
* My address: is your address unlocked from your private keystore

**Balances**

This screen shows your SCPT and SPAY balances and the history of transactions.

<figure><img src="https://docs.script.tv/img/faucet_transfer.png" alt=""><figcaption><p>screenshot__faucet_transfer</p></figcaption></figure>

**Receive (faucet). (Only Testnet).**

<figure><img src="https://docs.script.tv/img/receive_faucet.png" alt=""><figcaption><p>screenshot__receive_faucet</p></figcaption></figure>

Faucet is a testnet-only feature that allows testing applications and mature monet-handling algorithms using play money, instead of risking real-money in the mainnet. Only if your current balance is under 100000 SCP every time to click on Receive button 1000 SCPT and 100 SPAY are transferred to your balances. # 15 seconds after clicling the receive button you balance screen would reflect your new balances and a new entry in the transaction history list.

**On-Chain Stakes**

Invest in the network. The network will reward you.

**Deposit**

<figure><img src="https://docs.script.tv/img/deposit_stake_menu.png" alt=""><figcaption><p>screenshot__deposit_stake_menu</p></figcaption></figure>

Select lightning node and continue.

#### Explorer <a href="#about-script-network-explorer" id="about-script-network-explorer"></a>

<figure><img src="https://docs.script.tv/img/explorer_home.png" alt=""><figcaption><p>screenshot__explorer_home</p></figcaption></figure>


# Script Network Node Migration & Support FAQ

> **Last Updated: July 2025**\
> This FAQ includes **all known issues** reported by node runners, Glasspass holders, and NodeOps users. It addresses the **Script Chain migration**, SPAY-to-SF conversions, refunds, reward claims, wallet changes, and infrastructure problems.

***

### 🧩 A. TOKEN MIGRATION & WALLET ISSUES

#### What’s happening to $SPAY rewards?

All node rewards will be paid in **$SF** on Script Chain. $SPAY can be migrated via the **official migration portal**

***

#### Can I still claim $SPAY?

Yes, claims are active until the end of the migration window. SPAY rewards are sent to your **Script Chain wallet**. Use console.nodeops.xyz or the Script Wallet to view them.

***

#### I claimed SPAY but nothing shows up in my wallet. Where did it go?

SPAY is now bridged to **Script Chain**, not Ethereum or BNB. Use:

* **Script Wallet**
* **Console.nodeops.xyz**\
  to see your rewards.

***

#### I pressed “Claim Rewards” on NodeOps and my SPAY disappeared.

This usually means:

* The claim succeeded but you’re looking at the wrong chain.
* Contact support with your wallet address to confirm.

***

#### How can I access the Script Wallet version of my wallet?

* We recommend importing your wallet into the **Script Wallet** or contacting support.

***

#### Can I migrate my node license to another wallet? (e.g., wallet hacked)

Yes. Open a discord ticket and provide:

* Original wallet address
* TX hash for the node purchase
* New wallet address\
  We'll manually reassign it if verified.\
  \
  *\*We cannnot guarantee we can migrate your node license*

***

#### I want rewards to go to a new wallet — is that possible?

Yes. Submit a support request with:

* Old and new wallet addresses
* Proof of node ownership

***

### 🎁 B. FREE NODES, GLASSPASS, AND GIFTS

#### I haven’t received my free node. What should I do?

Free nodes are given for:

* Glasspass ownership
* Competitions or giveaways\
  Submit your wallet address and proof (e.g., Glasspass ID or screenshot of win).

***

#### I was gifted 2 nodes. Can I get the transaction hash?

Yes. Send your **wallet address** to support, and we’ll send you the TX hashes.

***

#### I’m a Glasspass holder. Do I get a free node?

Yes. If not already delivered, send:

* Your wallet
* Glasspass ID\
  We’ll assign your free node.

***

#### I claimed SPAY and I’m also owed a free node (contest winner).

Send both:

* Wallet address
* Proof of contest win (screenshot or announcement)\
  We'll verify and deliver.

***

### 💸 C. REFUNDS, INSTALLATION FAILURES & BUYBACKS

#### I bought a node and didn’t receive it. I want a refund.

We need:

* Your TX hash
* Wallet address\
  If verified and unassigned, we’ll issue a refund or node delivery.

***

#### I couldn’t install the node. Can I get a refund?

Yes, if:

* Node was not activated
* You contacted us within the refund period\
  Provide wallet + TX hash to support.

***

#### I tried to run a Lightning Node, failed, and want a refund.

If you never activated or used the node, you're likely eligible. Provide your TX hash and wallet.

***

#### I bought 5 nodes but never ran them. Can I get a buyback?

Buybacks are offered **only during special campaigns**. If you're outside that window, refunds are not guaranteed.

***

### ⚙️ D. NODEOPS, CLAIMS & INFRASTRUCTURE

#### Where do my SPAY tokens go when I click “Claim” on NodeOps?

They go to your **Script Chain wallet**. Use:

* Script Wallet
* console.nodeops.xyz

***

#### I claimed from NodeOps but don’t see the rewards.

Common reasons:

* Viewing the wrong chain
* Wrong wallet connected\
  Submit your wallet to support to confirm.

***

#### There’s no option to “Start Node” on NodeOps.

Check:

* If infrastructure fee is unpaid
* If node is expired or uninitialized\
  Use the **My Nodes** tab on console.nodeops.xyz.

***

#### If I bought a node on NodeOps, can I run it myself?

Yes. You can:

* Export the license
* Install it yourself\
  Or, keep it hosted by NodeOps (monthly fee applies).

***

#### Does NodeOps offer node delegation?

Currently, **delegation is not available**. All NodeOps purchases are hosted or self-run only. Delegation may launch in future.

***

### 🛠️ E. TECHNICAL INSTALLATION ISSUES

#### I changed servers and now my node says “No holder records found.”

Ensure:

* You're using the same wallet
* Node metadata matches\
  If still broken, submit a support ticket with logs.

***

#### The software needs MongoDB but Debian doesn’t have it.

Debian dropped MongoDB from default repos. Use:

* Our **official install script**, or
* Docker container with pre-installed MongoDB\
  Ask in #node-support for updated links.

***

#### My software is missing or won’t start.

Check:

* Node logs
* Dependency installs (MongoDB, Docker, etc.)\
  Submit OS version and errors for assistance.

***

### ✅ F. OTHER COMMON QUESTIONS

#### Is there a log for past SPAY claims?

Not yet. Full claim logs will be integrated into the dashboard. For now:

* Use Script Wallet or console
* Check balances via console.nodeops.xyz

***

#### Is there some sort of dashboard where i can view my node rewards?

Not yet. Similar to the above, this will be rolled out when the chain goes fully live and will support intuitive live data for all node runners and developers. We want to make it possible to utilise this data alongside streaming for the first time ever.

***

I want a simple explanation of NodeOps or another providers flow if i wanted to buy.

* You buy the node on NodeOps.
* They host it (optional monthly fee).
* Rewards go to your wallet.
* You can export and run it yourself any time.

***

### 📬 Need Help?

> When contacting support, always include:
>
> * Wallet address
> * Transaction hash (TX)
> * Node ID (if applicable)
> * Any screenshots or error logs

**Support Channels:**

* 💬 Discord
* 📧 Email: <support@script.tv>


# Node Token Emissions

Node Token Emissions \
<https://docs.google.com/spreadsheets/d/1Wz7vtKJ1IpDWTCzF31xSMEyUqiSZoGubE7jdEiI_xjs/edit?usp=sharing>


# Lightning Node Overview

In the Script blockchain, Lightning nodes play essential roles in protecting the security of the Script blockchain as they form a second layer defense against potential malicious attackers. Validator Nodes propose and produce new blocks in the chain, while Lightning Nodes seal blocks and act as a check on malicious or non-functional Validator Nodes. Install and stake to your Lightning nodes to help secure the Script blockchain!

This guide provides the instructions to launch and stake to a Lightning Node for the Script Network.

To run a validator, lightning or edge node, you will need a respective node license key, which is a non transferrable license which gives the holder the ability to run a node which yields rewards daily. For more on this, head [here](https://node.script.tv)

Please note that virtual machines, Windows or Mac OS are not supported at this point.

## **Aggregated Signature Gossip**

Each Lightning node must actively combine the partially aggregated signatures from its neighbors and then gossip this newly aggregated signature out to other nodes. In doing so, the signature share of each node can reach other nodes at exponential speed by using the gossip protocol. In addition, the signature aggregation keeps the size of the messages small and thus reduces communicative overheads.


# Validator / Lightning Node Setup

## &#x20;Hardware/OS requirements <a href="#about-script-network-node-hardwareos-requirements" id="about-script-network-node-hardwareos-requirements"></a>

* 16 Gb HD, 2 cores, 8 GB Ram
* Debian 12 GNU/Linux Operating System.

## How to set up your Lightning node <a href="#about-script-network-get-your-node-running" id="about-script-network-get-your-node-running"></a>

### The Easiest way: NaaS <a href="#about-script-network-the-easiest-way-naas" id="about-script-network-the-easiest-way-naas"></a>

Using a Node-as-a-Service (NaaS) service provider consists in delegating all technical aspects to a service provider.

Nodeops providers who support Script Network nodes:

```
    * [https://nodeops.xyz](https://nodeops.xyz)
```

### The 1liner Installer <a href="#about-script-network-the-1liner-installer" id="about-script-network-the-1liner-installer"></a>

You would allocate a debian Operating system and run the 1-liner installer, converting it into a node in minutes.

The downloads screen provides access to different method for running a node.

Support for node installations has been discontinued for platforms Windows and Mac.

Here are the steps: [https://download.script.tv](https://download.script.tv/)

<figure><img src="https://docs.script.tv/img/downloads_1liner.png" alt=""><figcaption><p>screenshot__downloads_1liner</p></figcaption></figure>

This is the sequence of steps for a manual installation:

* 1.- get a debian-12 VM in a datacentre or as a raspberry pi or headless computer. (e.g linode.com, digitalocean.com)
* 2.- ssh as root. (Priviledged access to the VM command shell).
* 3.- paste the 1-liner installer you copied from downloads page. Press Enter.
* 5.- wait for a few minutes… Voila! your node is up and running!.
* 6.- Follow on-screen instructions on further step like licensing and staking your node.

### stv - The CLI interface <a href="#about-script-network-stv---the-cli-interface" id="about-script-network-stv---the-cli-interface"></a>

`stv` is the command you’d use to operate the node.

Have a detailed explanation of its functions in the sysop manual, available at

<figure><img src="https://docs.script.tv/img/pdfico.png" alt=""><figcaption><p>sysop_manual</p></figcaption></figure>

[script\_tv\_\_stvtool\_manual.pdf](https://download.script.tv/files/script_tv__stvtool_manual.pdf)

A walkthrough video is also available at

<https://x.com/manic_beret/status/1865704546011377953>

More on `stv` below.

### Developer node <a href="#about-script-network-developer-node" id="about-script-network-developer-node"></a>

* Build it all from sources. for devs and devops.

Follow instructions at our github page: <https://github.com/scriptnetwork/script-4>

## You have successfully completed your node setup. <a href="#about-script-network-you-have-successfully-completed-your-node-setup" id="about-script-network-you-have-successfully-completed-your-node-setup"></a>

All following items check out:

* ssh as root to your node. This action is perfomed ideally by muscle memory, but much better providing seamless experience is to set up [passwordless authentication](https://linuxize.com/post/how-to-setup-passwordless-ssh-login/)

  ```
    linux/Mac: `ssh root@<your node>`
            Windows: `putty` [download](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)
  ```

<figure><img src="https://docs.script.tv/img/user_node_root_login.png" alt=""><figcaption><p>screenshot__user_node_root_login</p></figcaption></figure>

* switch to user ‘stv’ and go to home directory /home/stv (`stv`)
* run the program `stv`

<figure><img src="https://docs.script.tv/img/user_node_stv_scriptcli.png" alt=""><figcaption><p>screenshot__user_node_stv_scriptcli</p></figcaption></figure>

## Automatic software updates <a href="#about-script-network-automatic-software-updates" id="about-script-network-automatic-software-updates"></a>

Automatic software updates feature is enabled by default. It can be disabled deleting the file /etc/cron.d/script\_tv\_updates and restating cron: systemctl restart cron

Check the [Release Notes](https://download.script.tv/files/release_notes.md.txt).

The document can also be found in the node at `/var/script_tv/release_notes.md`

### Node bash shell <a href="#about-script-network-node-bash-shell" id="about-script-network-node-bash-shell"></a>

#### About GNU/Linux <a href="#about-script-network-about-gnulinux" id="about-script-network-about-gnulinux"></a>

Main SYSOP interface: Text Command-line console, also known as **shell**.

Linux prompts. Line Prefixes is given by the computer to indicate us context: user and path

```
        root:~$
```

SYSOP role operates under user `root`, and can control all aspects of the operating system. This prompt indicates that our path in the filesystem is `/root` (`root` home directory)

```
        root:/home/stv
```

This prompt indicate we are SYSOP, although our current path in the filesystem is `/home/stv` (`stv` user’s home directory again)

```
        stv:~$ 
```

Finally, this prompt indicates our hat is `Script-Network user` and that our current directory is home (`/home/stv`)

#### SYSOP/nodeop Role/hat: user root <a href="#about-script-network-sysopnodeop-rolehat-user-root" id="about-script-network-sysopnodeop-rolehat-user-root"></a>

Available commands for SYSOPs:

```
        * script_tv__uninstall.sh           # uninstalls the node software.
                * script_tv__test.sh                # subsystem health checks 
                * script_tv__ctl stop               # stops all services for node maintenance
                * script_tv__ctl start              # resume all services after node maintenance
                * cat /var/script_tv/data_sheet     # Prints Operational Data sheet detailing daemons, URLs and ports used among other technical data.
```

#### SCRIPT P2P Network. Nodeops the linux user stv <a href="#about-script-network-script-p2p-network.-nodeops-the-linux-user-stv" id="about-script-network-script-p2p-network.-nodeops-the-linux-user-stv"></a>

Changing to user **stv** from `root`

```
        root$ stv                # change to user stv
```

Returning back to `root` user (SYSOP mode)

```
        stv:~$ exit
                root$ 
```

#### stv - the CLI Command-Line-Interface to the script network <a href="#about-script-network-stv---the-cli-command-line-interface-to-the-script-network" id="about-script-network-stv---the-cli-command-line-interface-to-the-script-network"></a>

the `stv` command is an alias to the program `bin/stvtool`. It must always been executed as user `stv`.

Some of the commands are mentioned here below, but the full documentation for stv with all its functions can be found at

![sysop\_manual](https://docs.script.tv/img/pdfico.png) \[script\_tv\_\_stvtool\_manual.pdf]\([https://download.script.tv\]\\(https://download.script.tv/files/script\\\_tv\\\_\\\_stvtool\\\_manual.pdf)](https://documentation.script.tv/nodes/lightning-node-overview/https:/download.script.tv]\\\(https:/download.script.tv/files/script\\_tv\\_\\_stvtool\\_manual.pdf\))

**check the status:**

```
stv:~$ stv -a status
        address                        0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072
        chain_id                       testnet
        current_epoch                  10876
        current_height                 10874
        current_hash                   0x6e4dd911a67b4ae487149f293ca25420034c0b7355eb9b8bd1fb82e1c451f579
        current_time                   1734190399
        eth_chain_id                   42854
        genesis_block_hash             0x42a81f3f7ef0a5297997c8428ae945d5176f07082224b006f1979a5ebbe2744c
        latest_finalized_block_epoch   10874
        latest_finalized_block_hash    0x7dd26a35e3072be28419fcbd2cebbb1024ba095ee6991722bf6a7760982f430c
        latest_finalized_block_height  10874
        latest_finalized_block_time    1734190387
        peer_id                        0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072
        snapshot_block_hash            0x7375fa6eeb782e5534b879ec5243e2bd549223a0ac077cd3c5ae32ec405c34eb
        snapshot_block_height          4397
        syncing                        false
        tip_hash                       0x1079b1f24757f1900d2c6b3e7d6aa0aab213953791aec442dc7f2433c8a9b8b5
        explorer_progress_height       10873
```

From the returned information we learn:

* Our node address is `0x8d1F3236d790415d631d554091dE7A25913FB561`
* we are on `testnet` network
* our peer\_id is our node address, for node-node communications.
* The genesis block hash `0x42a81f3f7ef0a5297997c8428ae945d5176f07082224b006f1979a5ebbe2744c` must match on all nodes of this network.
* Other information about the chain: block height, last block (`current_hash`).
* Syncing indicates the type of activity that is going on. true/false indicates whether an sync activity is ongoing or not.

Your keys are stored in directory `/home/stv/script4/wallet/keys/plain`

```
        stv:~$ find script4/wallet/keys/plain -exec cat {} \;
                {"address":"8d1f3236d790415d631d554091de7a25913fb561","privatekey":"d8604ad2430cd7292c1374838c4ffee8edb5a6723f4ca3cb8d1e8e8bab28c905","id":"0fc641f5-18c3-47ea-ba7d-83126ea0e32
```

As protection against loss, we encourage you to backup the keys directory.

### Backup <a href="#about-script-network-backup" id="about-script-network-backup"></a>

Use `stv backup` to produce a downloadable file with your keys: It provides with `scp` commands ready to be executed in remote computers to fetch the backup, either from inside the LAN or from internet (WAN).

```
stv:~$ stv backup
        Deleting previous backup files
        find: unknown predicate `-maxdepth=1'
        Copying gov key from /home/stv/script4/gov/key/
        Copying wallet keys from /home/stv/script4/wallet/keys/
        Backup file available at /tmp/keys_0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072_testnet_user_20241214153540.tgz.
        =============================================================================================
        Backup file is ready for download:
        Retrieve from remote computer using either command:
        from LAN: scp root@555.31.13.144:/tmp/keys_0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072_testnet_user_20241214153540.tgz .
        from WAN: scp root@555.134.4.199:/tmp/keys_0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072_testnet_user_20241214153540.tgz .
        Restore directory (gov key): /home/stv/script4/gov
        Restore directory (wallet keys): /home/stv/script4/wallet
        =============================================================================================
```

### testnet Faucet: <a href="#about-script-network-testnet-faucet" id="about-script-network-testnet-faucet"></a>

Obtain testnet tokens from our faucet at script.tv

Every script node has a faucet service that would -kindly- transfer you funds on request. The objective of testnet is to give users the opportunity to test the system using ‘play money’.

However if we run a mainnet node we would use an exchange and buy tokens instead.

Using stv CLI tool you would invoke faucet this way:

```
stv:~$ stv faucet
        Tx 0x0c91f018443240fc69cc438e793045966ef350da22bf19eca9ba6a1746e3b68c
        Explorer link: https://explorer-user-testnet.mm.cto.script.tv/txs/0x0c91f018443240fc69cc438e793045966ef350da22bf19eca9ba6a1746e3b68c
        Funds will arrive in seconds, check balance.
```

And seconds after verify balance:

```
stv:~$ stv balance
        Address 0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072
            SCPT: 1000.000000000000000000
            SPAY: 100.000000000000000000
```

The command can be repeated as many times as wished up to a balance limit of 1M. We can easy earn tokens this way.

By feeding with tokens your `node address` your faucet is automatically enabled using it as source of funds and making the faucet service available to other participants in the script network.

### Lightning node. Main setup workflow. <a href="#about-script-network-lightning-node.-main-setup-workflow" id="about-script-network-lightning-node.-main-setup-workflow"></a>

Lightning nodes are nodes that cooperate securing and guaranteeing its resilience and reliability, forming a trustable network of untrusted nodes, following the breakthrough by Satoshi Nakamoto.

In order to become one your just installed node must be upgraded.

The steps for upgrading the software are:

* acquire 20.000 SCPT (or tSCPT for testnet)
* purchase a Lightning license.
* stake the node.

With the stv interface:

```
stv:~$ stv --lightning faucet      #only on testnet
        stv:~$ stv --lightning buy_license
        stv:~$ stv --lightning stake
```

An example of such run is:

```
stv@:~$ stv --lightning faucet
        Faucet for lightning.
        Tx 0x14f85252c2175e1290c1924b0d4630df6333fa45d22ea5d505128b34a318cb93
        Explorer link: https://explorer-user-testnet.mm.cto.script.tv/txs/0x14f85252c2175e1290c1924b0d4630df6333fa45d22ea5d505128b34a318cb93
        Funds will arrive in seconds, check balance.
```

```
stv@ip-172-31-13-144:~$ stv --lightning buy_license
        =========================================
        License Purchase
        =========================================
        You are about to purchase a lightning license for the node address: 0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072.
        The license fee of 20000 SCPT will be paid from the address: 0x8a95c6C85A4eB294c4dCB764867717C7CDf1f072.
        The transaction will be sent to the Script Network node address: ad5448ab1687f6473715fcb789a2208d14eb9d5e.
        continue? [yes|ctrl-c]
        yes
        Sending 20000 SCPT to ad5448ab1687f6473715fcb789a2208d14eb9d5e
        Waiting for transaction to be included in a block
        Payment transaction link: https://explorer-user-testnet.mm.cto.script.tv/txs/0x462ff44d189a639e95f1ee69eb92204b142af62ffd8540bae5492c205380eb4d
        Waiting 100 seconds...
        (Please be patient. Don't cancel the process there are steps needed to be done)
        License purchased successfully
        Transfer refund in progress. Transaction id: 0x684fe71463e5a4ba12297d0c2002c05bb9e69f857c835a0c8511e0dec39f2c62
        Link to the refund transaction: https://explorer-user-testnet.mm.cto.script.tv/txs/0x684fe71463e5a4ba12297d0c2002c05bb9e69f857c835a0c8511e0dec39f2c62
```

```
stv:~$ stv print_license
        =========================================
               LICENSE FOR 0x8a95c6c85a4eb294c4dcb764867717c7cdf1f072 
        =========================================
        | Licensee Address      | 0x8a95c6c85a4eb294c4dcb764867717c7cdf1f072 |
        | License Type          | LN |
        | Issuer Address        | 0xad5448ab1687f6473715fcb789a2208d14eb9d5e |
        | Valid From            | 1734192846 |
        | Valid To              | 4889866446 |
        | License Items         | LN |
        =========================================
        Total Licenses: 1
        
```

```
stv:~$ stv --lightning stake
        Upgrading node to lightning
        Transaction broadcast was successful.
        TxHash: 0xc69494cc3e22d1a97132463e2369c4388a586f3777c91dd64230206cf9c4b433
        Link to transaction: https://explorer-user-testnet.mm.cto.script.tv/txs/0xc69494cc3e22d1a97132463e2369c4388a586f3777c91dd64230206cf9c4b433
```

```
stv@:~$ stv node_status
        Node is lightning with 20000.000000000000000000 SCPT staked.
        Node status summary: Node is a lightning.
```

### Lightning node. Alternative setup workflow. Node Sale - FlowHale/easeFlow <a href="#about-script-network-lightning-node.-alternative-setup-workflow.-node-sale---flowhaleeaseflow" id="about-script-network-lightning-node.-alternative-setup-workflow.-node-sale---flowhaleeaseflow"></a>

<figure><img src="https://docs.script.tv/img/nodesale.png" alt=""><figcaption><p>screenshot__nodesale</p></figcaption></figure>

For those who have purchased a license via <https://nodesale.script.tv>

the steps for upgrading the node to lighning are:

```
stv:~$ stv redeem
        stv:~$ stv --lightning stake
```

The redeem function will give you a personalized URL you would use to prove the ownership of the wallet with which you did the purchase. Once verified you would obtain a lighniung license for the node.

```
stv:~$ stv redeem
        ==================================================================================
        Script Network - Lightning node licensing

        Redeem easeFlow Purchase - https://easeflow.io
        (Purchase portal link: https://nodesale.script.tv)
        ==================================================================================

        Script Network - Lightning node licensing
        =========================================

        Its time to redeem your purchase making this node a licensed lightning node staked with 20K SCPT.
        A special URL has been generated for you, which is associated with this node. 
        Please continue the redeem process on the following URL:
        https://redeem-mainnet.script.tv/?ssid=XXeinGjNKa2e1aNRBzbObIIdf0vqZ3fKQQ3Kg1yA7nQflg4K2Ke8nzfMUUNgjwDAoj&msg2=yb2niry46wg6b34j5b9p7v
```

bring the given URL to the browser holding your wallet (the same wallet you used to purchase) `https://redeem-mainnet.script.tv/?ssid=XXeinGjNKa2e1aNRBzbObIIdf0vqZ3fKQQ3Kg1yA7nQflg4K2Ke8nzfMUUNgjwDAoj&msg2=yb2niry46wg6b34j5b9p7v`

Follow these 3 steps \* connect wallet \* sign message to prove ownership \* back to stv with further steps explained on screen


# Steps To Change Node Password

#### 1. Switch to the below directory.

* `cd/usr/local/go/src/github.com/scripttoken/scriptnet/node/key/encrypted`

#### 2. Download the key which is in the above directory on your local.

#### 3. Then, login to the wallet application.

* `(https://wallet.script.tv/unlock/keystore-file) with the same key and node password.`

#### 4. After logged in to the wallet application , switch to the setting tab and reset your password.

#### 5. Then, upload the new key generated from the wallet application to the same server directory and replace it with the new key and run the below mentioned command.

* `mv {key}.keystore {key}`

#### 6. Now, switch to the directory and run the following command.

* `cd /usr/local/go/src/github.com/scripttoken/script`
* `make install`

#### 7. After successful compilation of code, you need to go to background process where node is running. Terminate the process and run the command with new password.


# Stake to the Lightning node

After the node is synced (i.e. syncing is false), we can proceed with staking to make it a full **Lightning Node**. First we'd need the "fingerprint" of this node. In another console, execute the following command

`$ ./scriptcli query lightning`

The output should look something like this:

`{`

&#x20;`"Address": "0x8f3B...E819",`

&#x20;`"BlsPubkey": "a1225b...16ebe",`

&#x20;`"BlsPop": "b49fd2a...d025c",`

&#x20;`"Signature": "14deb5e...52500",`

&#x20;`"Summary": "0x8f3Bc...952500"`

`}`

The summary part is the "fingerprint" we need for staking.  Each Lightning staking transaction requires at least 10,000 (SCPT) Script tokens.


# Edge Node Overview

The Edge Node allows you to relay video streams over the Script Network and earn SPAY, providing support to SCRIPT.tv and other upcoming video platforms using the Script Network. With the latest update, you can now also broadcast your own video streams and have them distributed over the Script Edge Network! This allows you to stream entirely peer-to-peer without any centralized CDN involved.

Here are the articles in this section:

{% content-ref url="/pages/2h4X5dvFoon21cfi7fGs" %}
[Setting up the Edge Node](/nodes/edge-node-overview/setting-up-the-edge-node)
{% endcontent-ref %}

{% content-ref url="/pages/gyRTk6lccJDBWITVfBQk" %}
[Edge Node Staking Process](/nodes/edge-node-overview/edge-node-staking-process)
{% endcontent-ref %}

{% content-ref url="/pages/WqVYn83zPiTVyrnHZrrR" %}
[Uninstallation Of Edge From Different Environment](/nodes/edge-node-overview/uninstallation-of-edge-from-different-environment)
{% endcontent-ref %}


# Setting up the Edge Node

### Windows

{% embed url="<https://youtu.be/A82wzF6v3kU>" %}

1. You need to install GitBash” and “go” for windows. If you do already have it, start GitBash as an administrator and proceed to step 3. To download GitBash navigate to [gti.scm.com/download/win](https://gti.scm.com/download/win) to download the latest version.

2. Head over to [go.dev/doc/install](https://go.dev/doc/install) and download the latest version of go. Once finished, start GitBash as an administrator.

3. We need to add a software package manager chocolatey-&#x20;

&#x20;(a)  Please enter the following commands.&#x20;

&#x20;       $ git config --global user.name "Linus Torvalds"&#x20;

&#x20;       $ git config --global user.email "<Linus@tux.com>"

&#x20;       Replace the username as well as email-id with your own.

(b) Press start and type in PowerShell, right-click, and select run as an administrator.&#x20;

With PowerShell, you must first ensure that Get-ExecutionPolicy is not Restricted. We suggest using Bypass to bypass the policy to get things installed or AllSigned for quite a bit more security.&#x20;

Run Get-ExecutionPolicy. If it returns Restricted, then run Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process.

(c) Now run the following command:&#x20;

Set-ExecutionPolicy Bypass -Scope Process -Force \[System.Net.ServicePointManager]::SecurityProtocol = \[System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('<https://community.chocolatey.org/install.ps1>'))

(d) Once finished proceeding with the commands below.&#x20;

&#x20;     $ choco install make&#x20;

&#x20;     $ choco install mingw

If you get prompted to run the Script type in A + enter (needs to be a capital letter).&#x20;

4. &#x20;Close both PowerShell as well as GitBash and then reopen GitBash again by right-clicking the icon and selecting run as an administrator, then execute the below command.

&#x20;       git clone <https://github.com/scriptnetwork/Node-Network-guide.git>                             &#x20;

&#x20;       $GOPATH/src/github.com/scripttoken/script &#x20;

5. Navigate to the very same folder in which you cloned the files. The normal path should be “$GOPATH/src/github.com/scripttoken/script”. Run the following command.&#x20;

&#x20;      cp -r ./integration/scriptnet ../scriptnet

6. If you are encountering any issues with this next command, please close and reopen GitBash again as an administrator.&#x20;

&#x20;      make install (It will generate two binaries i.e., script.exe and scriptcli.exe)

7. Switch to "bin" directory i.e $GOPATH/bin/ where your binary has been generated using the above command. Navigate to the bin folder by typing “cd $GOPATH/bin”.
8. This step requires you to start 3 separate GitBash sessions. Do so by pressing ALT + F2 or by pressing the logo in the top left corner and selecting a new window. In each window execute the respective commands to start node and cli in the background session. If windows defender pops up it is OK to allow traffic from Script.

&#x20;      First window

&#x20;      script.exe start --config=../src/github.com/scripttoken/scriptnet/node --password={ENTER\_PWD}

&#x20;      Delete the brackets and ENTER\_PWD, select a strong password and press enter to start the node.

&#x20;      Second window&#x20;

&#x20;      scriptcli.exe daemon start --port=16889

&#x20;      Third window&#x20;

&#x20;      scriptcli.exe query Lightning

&#x20;      The output in the last window shows the node address and summary address that you are going to use in the following steps.

9. Now, navigate to [wallet.script.tv/](https://wallet.script.tv) and create a new wallet if you don’t already have one already. To be able to stake you would need to have at least 10001 SCPT in your wallet.

&#x20;      (a) Enter the wallet application by using the Keystore file that is stored on your computer locally and the password you have set.&#x20;

&#x20;      (b) Once signed in press stake on the left-hand side and then click on the deposit stake option. Select lightning stake.&#x20;

&#x20;      (c) Now enter the node address which you have got from the previous command in step 8 and enter 10000 SCPT.&#x20;

&#x20;      (d) Enter the wallet password to confirm the transaction.

Now open another tab in your browser, navigate to [token.script.tv/download](https://token.script.tv/download), and select Windows to download the Edge Node application. Follow the setup guide instructions and open the application once installed. Click activate wallet on the left-hand side and enter the required node address as well as summary details that you have got from step 4, check the T\&C box and proceed, toggle the button to on in order to activate the Edge node. The transcoding jobs will start and you will be earning rewards.

### Linux

{% embed url="<https://youtu.be/KMgmHAasrE0>" %}

1. Start by heading over to the terminal and running the respective commands.

&#x20;      sudo apt-get update&#x20;

&#x20;      sudo apt-get upgrade -y&#x20;

&#x20;      sudo apt-get install build-essential -y&#x20;

&#x20;      sudo apt-get install git

&#x20;      sudo apt install tmux

2. Install Go

&#x20;      wget <https://go.dev/dl/go1.19.2.linux-amd64.tar.gz&#x20>;

&#x20;      sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.19.2.linux-amd64.tar.gz

&#x20;3\.  Adding the PATH variable

&#x20;     Add /usr/local/go/bin to the PATH environment variable. You can do so by adding the following line to your $HOME/.profile or /etc/profile (for a system-wide installation):

&#x20;     sudo vim .profile

&#x20;     export PATH=$PATH:/usr/local/go/bin

Please note: Changes made to a profile file may not apply until the next time you sign in your computer. To apply the changes immediately, run the shell commands directly or execute them from the profile using a command such as source $HOME/.profile.

Verify that you've installed Go by typing in the following command in terminal: go version

4. Build and Install

Next, clone this repo into your $GOPATH. The path should look like this:

&#x20;      $GOPATH/src/github.com/scripttoken/script

&#x20;      sudo git clone <https://github.com/scriptnetwork/Node-Network-guide.git> &#x20;

&#x20;      $GOPATH/src/github.com/scripttoken/script&#x20;

&#x20;      export SCRIPT\_HOME=$GOPATH/src/github.com/scripttoken/script&#x20;

&#x20;      cd $SCRIPT\_HOME

Now, execute the following commands to build the Script binaries under $GOPATH/bin. Two binaries script and scriptcli are generated.

&#x20;      sudo cp -r ./integration/scriptnet ../scriptnet&#x20;

&#x20;      sudo chmod -R 777 /usr/local/go&#x20;

&#x20;      git config --global --add safe.directory /usr/local/go/src/github.com/scripttoken/script&#x20;

&#x20;      make install

5. This step requires you to start 3 separate terminal sessions or run all three commands from the same terminal by creating a session using a background service called tmux.

First terminal or tmux session

&#x20;       tmux new -s node&#x20;

&#x20;       /usr/local/go/bin/script start --config=../scriptnet/node

Second terminal or tmux session

&#x20;       tmux new -s cli&#x20;

&#x20;       /usr/local/go/bin/scriptcli daemon start --port=16889

Third terminal or tmux session

&#x20;       tmux new -s detail&#x20;

&#x20;      /usr/local/go/bin/scriptcli query Lightning

Please note - The output in the last session, shows the node address and summary address which you are going to use in the following steps. To exit any of the tmux session press ctrl+b and d. To enter any created tmux session press "tmux a -t SESSION\_NAME"

6. Now open your browser, navigate to [wallet.script.tv/](https://wallet.script.tv), and create a new wallet if you haven't done so already. To be able to stake you would need to have at least 10001 SCPT in your wallet. Please open a ticket in our discord to receive tokens.

(a) Enter the wallet application by using the Keystore file that is stored on your computer locally and the password you have set.&#x20;

(b) Once signed in press stake on the left-hand side and then select the deposit stake option. Click on lightning stake.&#x20;

(c) Now enter the node address which you have got from the previous command in step 4 and enter 10000 SCPT.&#x20;

(d) Enter the wallet password to confirm the transaction.

Now open another tab in your browser, navigate to [token.script.tv/download](https://token.script.tv/download), and select linux to download the Edge Node application. Follow the setup guide instructions and open the application once installed. Click activate wallet on the left-hand side and enter the required node address as well as summary details that you have got from step 4, check the T\&C box and proceed, toggle the button to on in order to activate the Edge node. The transcoding jobs will start and you will be earning rewards.

### MacOS

{% embed url="<https://youtu.be/29_xNI9xKgw>" %}

1. Go to [go.dev/doc/install](https://go.dev/doc/install) and download the latest version of go.

Open the package file you downloaded and follow the prompts to install Go. The package installs the Go distribution to /usr/local/go. The package should put the /usr/local/go/bin directory in your PATH environment variable. You may need to restart any open Terminal sessions for the change to take effect.

Verify that you've installed Go by opening a command prompt and typing the following command: go version

2. Install brew package by typing in the following command:

&#x20;/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh>)"

Note - To continue and finish the installation execute the two echo commands which will be printed on the terminal while executing the above command.

Continue by typing respective commands

brew install make&#x20;

brew install mingw-w64

3. Build and Install

Next, clone this repo into your $GOPATH. The path should look like this: $GOPATH/src/github.com/scripttoken/script

git clone <https://github.com/scriptnetwork/Node-Network-guide.git> $GOPATH/src/github.com/scripttoken/script&#x20;

export SCRIPT\_HOME=$GOPATH/src/github.com/scripttoken/script&#x20;

cd $SCRIPT\_HOME

Now, execute the following commands to build the Script binaries under $GOPATH/bin. Two binaries script and scriptcli are generated.

cp -r ./integration/scriptnet ../scriptnet&#x20;

chmod -R 777 /usr/local/go&#x20;

git config --global --add safe.directory /usr/local/go/src/github.com/scripttoken/script&#x20;

make install

4. Now for this step, you are going to have to start 3 terminal sessions. In each terminal execute respective commands to start node and cli in the background session.

First Terminal&#x20;

/usr/local/go/bin/script start --config=../scriptnet/node

Second Terminal&#x20;

/usr/local/go/bin/scriptcli daemon start --port=16889

Third Terminal&#x20;

/usr/local/go/bin/scriptcli query Lightning

\*Note - The output in the last terminal or session shows the node address and summary address in which you are going to use in the following steps.

5. Now open your browser, navigate to [wallet.script.tv/](https://wallet.script.tv), and create a new wallet if you haven't done so already. To be able to stake you would need to have at least 10001 SCPT in your wallet.

(a) Enter the wallet application by using the Keystore file that is stored on your computer locally and the password you have set.&#x20;

(b) Once signed in press stake on the left-hand side and then select the deposit stake option. Click on lightning stake.&#x20;

(c) Now enter the node address which you have got from the previous command in step 5 and enter 10000 SCPT.&#x20;

(d) Enter the wallet password to confirm the transaction.

Now open another tab in your browser, navigate to [token.script.tv/download](https://token.script.tv/download), and select Mac to download the Edge Node application. Follow the setup guide instructions and open the application once installed. Click activate wallet on the left-hand side and enter the required node address as well as summary details that you have got from step 4, check the T\&C box and proceed, toggle the button to on in order to activate the Edge node. The transcoding jobs will start and you will be earning rewards.&#x20;


# Edge Node Staking Process

If you’re already running a Lightning Node and staking your Script tokens, the process will be familiar to you. In the Stakes section of your Script Wallet, click Deposit Stake and you’ll see the Edge.

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


# Uninstallation Of Edge From Different Environment

**What's inside-**

**1.**&#x4C;inux/Ubuntu desktop version

**2.**&#x57;indows desktop version

**3.**&#x4D;ac destop version


# Linux/Ubuntu desktop version

**Uninstallation of Edge from Linux/Ubuntu Desktop Version**

**Step 1**:`sudo apt-get remove --purge edge* -y`

**Step 2**:`sudo apt-get autoremove`

**Step 3**:`sudo apt-get autoclean -y`

**Step 4**:`rm -rf ~/.ipf*`


# Windows desktop version

**Uninstallation of Edge from Windows Desktop Version**

**Step 1**: Switch to your root directory.

**Step 2**: Remove .ipfs file manually.

**Step 3**: Taskkill /IM ipfs.exe /F

**Step 4**: Now, from here you will start your new Edge installation from the doc available previously.


# Mac desktop version

**Uninstallation of Edge from Mac Desktop Version**

**Step 1**: Switch to your root directory.

**Step 2**: rm .ipfs

**Step 3**: Then, remove Edge folder also.

**Step 4**: sudo lsof -i :{PORT} (5001,5080,6011,1935,5443)

**Step 5**: sudo kill {PORT-PID}

**Step 6**: Now, from here you will start your new Edge installation from the doc available previously.


# Lightning Staking Process

<details>

<summary><a href="/pages/qM5zVOgX8kqNiarzHaOP">Staking through Web Wallet</a></summary>

</details>

{% content-ref url="/pages/fB29wqGRwatPr9g0ddVS" %}
[Lightning Stake Withdrawal Process](/nodes/lightning-staking-process/lightning-stake-withdrawal-process)
{% endcontent-ref %}


# Lightning Stake Withdrawal Process

To withdraw your staked tokens from the Lightning Node using either the Script Web Wallet, click the "Stakes" tab, then the "Withdraw Stake" button.

![](/files/l6CJRzcD3umyhDGmONXS)

Enter the Lightning Node address you want to the withdraw the stake from and click "Withdraw Stake". On the next screen, review the transaction information, enter your wallet password, and click "Confirm & Withdraw Stake".


# Staking through Web Wallet

Access the Script Web Wallet from your desktop/laptop. Under the “Script Wallet” logo, unlock your Script wallet using your typical access method (keystore, seed phrase, private key, etc.).

![](/files/kcLU1wTtkDft9swuAqTB)

Once your wallet is unlocked, click the “**Stakes**” tab of the menu and click “**Deposit Stake**”, then click "**Lightning Node**".

![](/files/8EdupK2SZadag50KAqfZ)

In the **Lightning Node Holder (Summary)** field, enter the text string from your Lightning Cli Service. Enter the Amount of SCRIPT you want to stake to this node and click **“Deposit Stake"**. Note that you need to stake **at least 5,000 SCPT**.

![](/files/uLmWORlXz6MjVVE0WvsS)

After reviewing your stake deposit info on the next screen, enter your wallet password, then click "**Confirm & Deposit Stake**". After the stake deposit transaction is confirmed, you can switch back to the Lightning node to verify that it is working as expected.


# Validators

## About Script Validators

Script TV runs on a Proof-of-Stake (PoS) consensus mechanism known as Multi-Level Byzantine Fault Tolerance (BFT) which allows thousands of nodes to participate in the consensus process.

A two-level structure is architected with a small number of first-level Validators (10-20) and a wide range of second-level Validators (1000 or more). First-level Validators (Validators) produce blocks at high-speed using a process similar to what PBFT uses. The second-level Validators (Lightnings) then complete the chain created by the Validators and confirm among themselves that they all see the same chain. A pool of Validators from a small number of participants can quickly reach a consensus. At the same time, a more significant collection of Lightnings provide a high level of reliability and network integrity.

## How Are Validators Selected?&#x20;

The Validators will be selected from the holders who bought SCPT during the first-stage private sale, who then deployed their nodes and were screened on the Testnet. To protect the network, Validators must KYC. To join the Validator pool, a node needs to lock up a certain amount of stake for a period. The amount of SCPT required to be staked to become a Validator can vary, and the updated figure can be found at <https://token.script.tv>. This stake can be slashed as a penalty for malicious behavior. A limited set of 10-20 Validator nodes constitute the Validator Pool.


# Block Settlement

Block settlement is the process in which the Validators reach an agreement and produce a chain of blocks for the Lightning Pool to finalize. The block settlement algorithm is similar to a new other chain but is built to scale. The SCRIPT blockchain uses a rotating proposer scheme wherein Validators take turns to propose new blocks for validation. To enable such rotation, each proposer maintains a local logical clock called an epoch. Assuming there are m Validators, during epoch t, the validator with index (t mod m) is elected as the proposer for that epoch. The key conditions for such a scheme are that the epoch t should not be stopped, and the epoch t of different Validators should be mostly in sync, i.e., optimally, all Validators have the same t value, so they can agree on which node should produce the next block.

## How It Works?

The proposed block settlement process is based on a PBFT voting procedure. The header of each block contains a hash pointer to its parent block (the previous block in the chain), similar to the Bitcoin and Ethereum chains. Suppose neither block is an ancestor of the other, these blocks conflict. An honest Validator is required to keep all conflicting block proposals for the same epoch until one becomes settled, and all contradictory blocks are subsequently discarded.

The block settlement protocol operates from epoch to epoch. The proposer for the current epoch sends a block proposal to all Validators. A Validator reacts by broadcasting a vote for the block. All messages are signed by their senders. The header of the proposed block might carry a commit certificate, which consists of at least (2m/3+1) signed votes for its parent block. Provided that no more than m/3 Validators are faulty, at most one block per height can obtain a commit certificate, which verifies a block and its predecessors will be committed. The proposed block might carry no commit certificate if its parent block did not get ≥ 2m/3+1 signed votes.

The Validators not actively engaged in block proposals are tasked with voting upon proposed blocks. Once a Validator receives the new block, it broadcasts a signed vote to all Validators to be collected by the proposer of the next epoch to form the commit certificate. If two consecutive blocks A and B both receive a committed certificate, then the parent block A and all its predecessors are considered settled. This ensures safety, and those honest nodes never vote for a block that conflicts with a settled block.

In the case of forks (consequential to a faulty proposer or asynchrony), honest nodes are expected to vote for the blocks on the longest fork.

{% hint style="info" %}
**It’s important to note that although these are complex, they are completed automatically through our protocol.**
{% endhint %}


# Steps To Migrate Lightning/Validator

{% hint style="info" %}
\*Note - New server must have all pre-requisites installed and directory to be created in a way as suggested in doc. Also go env must be configured.
{% endhint %}

#### 1. Login and switch to the directory

* `cd /usr/local/go/src/github.com/`

\*Here, You will get to see the directory on the name of scripttoken.

#### 2. Create .zip or .tar file of scripttoken

#### 3. Download the zip file from previous server and upload or move it to new server.

#### 4. Unzip the folder but make sure directory architecture will be same as previous one or suggested according to the document  provided.

* `i.e, cd /usr/local/go/src/github.com/`
* Move zip or tar file to this directory and unzip here.

#### 5. Compilation of the code

* `cd /usr/local/go/src/github.com/scripttoken/script`&#x20;
* `make install`

#### 6. Run the code

* Run blockchain node in background process whether it is in tmux, nohup, sceen, pm2 or other.
* `cd /usr/local/go/src/github.com/scripttoken/script`
* `Run, /usr/local/go/bin/script start --config=../scriptnet/node`
* Enter the password and start the node.


# Edge Documentation

{% content-ref url="/pages/IGaCLpJmm6TpMvvmUTvp" %}
[Introduction](/nodes/edge-documentation/introduction)
{% endcontent-ref %}

{% content-ref url="/pages/x2rBcBk3tkiQmXvZf5EO" %}
[What is Edge](/nodes/edge-documentation/what-is-edge)
{% endcontent-ref %}

{% content-ref url="/pages/mxi8ohcvHlL6L7CfKjlj" %}
[How it works](/nodes/edge-documentation/how-it-works)
{% endcontent-ref %}

{% content-ref url="/pages/FaW2rg3uRag5S9kGF0iz" %}
[Edge Uses](/nodes/edge-documentation/edge-uses)
{% endcontent-ref %}

{% content-ref url="/pages/YQMko1ubKIfKpxx86mmB" %}
[Possibilities with Edge](/nodes/edge-documentation/possibilities-with-edge)
{% endcontent-ref %}

{% content-ref url="/pages/LghkvqpdJKFC0Ys4Xtxs" %}
[Edge Features](/nodes/edge-documentation/edge-features)
{% endcontent-ref %}

{% content-ref url="/pages/mrhX9xWQaSjjb3brYmlB" %}
[Benefits](/nodes/edge-documentation/benefits)
{% endcontent-ref %}

{% content-ref url="/pages/GGwkksJ5TxsoqaapiJNB" %}
[Use Cases](/nodes/edge-documentation/use-cases)
{% endcontent-ref %}


# Introduction

The Edge Node allows you to relay video streams over the Script Network and earn SPAY. It provides support to script.tv and other upcoming video platforms using the Script Network. With the latest update, you can also broadcast your own video streams and have them distributed over the Script Edge Network! It shapes your stream entirely peer-to-peer without any centralized CDN involved.


# What is Edge

Edge nodes are instances of the cluster between the user and cluster's machines. Users can run their jobs on the Edge node instead of doing it directly on the master nodes, which are critical for the overall functioning. This way you can prevent capacity losses on these nodes.

Edge Nodes are a critical infrastructure component of the Script Network and Protocol. They are responsible for retrieving content from other Edge Nodes and distributing it to end users. Initially, Scriptlab will retain a centralized core platform CDN which will serve as the master storage for all uploaded content. Edge Nodes will pull copies from the core CDN based on the directions given from the node software. As the network becomes more decentralized and distributed, uploads from content producers may be transferred directly to nearby Edge Nodes and propagated throughout the network. Edge Nodes may initially pull entire content files, but as the network develops, they may only need to retain specific shards of a large content block to increase efficiency of the network.


# How it works

The Edge Node allows you to relay video streams over the Script Network and earn SPAY. It provides support to SCRIPT.tv and other upcoming video platforms using the Script Network. With the latest update, you can also broadcast your own video streams and have them distributed over the Script Edge Network! It shapes your stream entirely peer-to-peer without any centralized CDN involved.

To start using the Script Edge Node, download the app for Windows or macOS. If you want to run the command line version (e.g. on Linux), please refer (<https://stage.script.tv/download>) to this to run the Script Edge Node.

If you have an existing version of the Script Edge Node, your software will automatically update to this newest version. This also means that for the first time, macOS users can natively relay video over the Script Network, which should boost the number of Script Network nodes making a more robust Edge network.


# Edge Uses

**.Data Delivery -** Initially focused on video delivery, and implemented on script.tv But the scope of decentralized data delivery goes beyond video into file updates, game patches, OS and app updates, web content, and any other form of data delivery.

**.Data Storage** - As Script expands from livestreaming applications to Video-on-Demand (VoD), app updates, and game patches, it becomes necessary to have a decentralized solution to data storage. Script nodes can cache the most in-demand live and static content and files to ensure they are able to contribute to the network and earn SPAY.

**.Data Encoding** - By allowing Script nodes to perform ingest/encoding of raw video and data as close to the source as possible, particularly for live events (professional sports, concerts, conferences, for example), the Script Network will truly become an end-to-end solution for video and data.

Earn SPAY token through staking and via the above processes.


# Possibilities with Edge

**.Dapps -** A decentralized app (also known as a dApp or dapp) operates on a blockchain or peer-to-peer network of computers. It enables users to engage in transactions directly with one another as opposed to relying on a central authority.

**.Minting** - Mint is a popular free online personal finance application from Intuit that offers a variety of easy-to-use financial planning and tracking tools. To use Mint, you must sync all of your financial accounts, or at least the ones you want to utilize via Mint. Mint allows us to track, spending and credit score, and once can sign-up to receive notifications on a daily, weekly, or monthly basis.

**.Video transcoding** - Transcoding is a key task in an adaptive streaming workflow for video. It converts an encoded digital file or set of files into an altered set of digital files that better meet the needs of your hardware or your audience. It is particularly important for ensuring your content can be viewed on the widest possible range of devices.


# Edge Features

Amongst the several tech rivals, Script network brings the best possible way to earn the SPAY just by becoming the Edge node that includes the following features:

**.Proof of network**: Under this feature, every Edge node behaves as a decentralized sever that allows the node to earn and with raw SPAY by withdrawing it via the wallet. Based on the activity of the Edge node, if any user fulfills the criteria of being online for 40 hours a week, as a reward the user will be awarded about the 10% of the total stake.

**.My referral :**-Users can also earn just by referring their referral code to other users. Once the referred user will install and activate the Edge, the current user will get quantity of SPAY to earn more.

**.Recovery key :**-With Edge, You do not have to worry about your data, if you want to change the system/machine on which the Edge is installed. Here, recovery key comes into the picture, that allows you to secure your earnings if your system got lost/damaged. Note: To make this possible, user must need to keep the recovery key safe and hidden because once the key will be hidden the action will never be undone.

**.Proof of Engagement**:- Another great feature is around the corner, proof of engagement (POE) is something that contributes in earning some attractive amount of SPAY. Here Edge will be responsible for the transcoding based on the duration of the video uploaded on the Script.tv


# Benefits

\*A side benefit to the emergence of a strong Edge Network of devices is that more user data can be controlled by individual users, rather than massive centralized data silos. This is a growing demand from users, and a reaction against the user data gathering and monetization of the largest tech companies.

\*When each device can act as an independent node in the Edge Network, whether it’s a phone, TV, or other device, it can provide only the information it chooses to when participating.

\*Script is just a protocol for interaction between devices — there’s no User Agreement to sign allowing all of your personal identifying information to be shared with the highest bidder.

\*The Edge Network means more of your data stays on your device, making it safer for user data, harder to attack and less vulnerable to single points of failure.


# Use Cases

**.Activate Edge:** The minimum number of SPAY needed to activate a Edge is 1000. So, to jump in the journey of earning via the Edge a user must have at least 1000 SPAY in the wallet.

**.Cooling-off Period:** Edge provides the earning of SPAY on weekly basis along with the cooling-off period. This time duration exists for 4 hours at the start of the every Monday. During this duration, no user can withdraw their SPAY because this slash of time confirms and verify the amount of SPAY earned by the users.

**.Heartbeat Status For the Proof of Network**: Heartbeat status plays an important role. The colour of the heartbeat keeps on switching, based on the activity of the user. As a result, if the user remains online, it switched to green from the red colour. Based on the activity status of this icon, it provides the consolidated PON rewards.

**.Check for Updates:** This feature helps the user to keep up the Edge updated as per the latest released version in the market.

**.What’s Coming Up**: A section that makes user familiar of what’s next is about to come in the coming versions

**.Data Backup**: When it comes to data loss, Edge is the best match that saves our earned SPAY in case of system damage. Just with the help of recovery key, we can transfer the data from one system to another.

<br>


# Smart Contract Development

The lack of transparency and red tape has frustrated users and content partners for decades within the media industry. To solve this, our smart contracts can be adapted by Script.TV content creators to distribute royalties fairly, transparently, and without reliance on costly intermediaries.

Smart contracts for content partners and platforms also enable more payment-consumption models than traditional TV services can offer their users, such as per-use or pay-as-you-go models. Instead of paying for annual or monthly subscriptions, viewers can now earn for viewing content. Our Turing-complete smart contracts enable numerous usage scenarios not exclusive to video streaming.

For example, the distribution of rewards between the platform, content partners, and users can be automated, NFTs can be traded, various wallets can be integrated, and new tokens can be minted. The Script.TV Virtual Machine is fully compatible with the Ethereum Virtual Machine (EVM), making it simple to migrate existing Ethereum-based contracts, and smart contract developers can seamlessly migrate to Script.TV.

By merging linear TV programming with blockchain technology, Script TV can manage all its services and offerings using smart contracts. The smart contracts are self-executing, require no middlemen, and can be swiftly executed after stipulated conditions for performance are met by the contracting parties. Plus, smart contracts can be used for games, polls, airdrops, reward programs, community engagement initiatives, and content acquisition. Overall, using smart contracts streamlines the process of getting things done and is cost-effective.

Turing-complete smart contracts open the door to numerous use cases in video streaming and beyond, from token investments in streamers, to automated splits of SCPT rewards between platform/streamers/users, to non-fungible tokens (NFTs) representing top content creators.

The Script Virtual Machine is compatible with Ethereum Virtual Machine (EVM).

Porting over existing Ethereum-based contracts is simple and thousands of smart contract developers can easily jump to building on Script.

Between the Script Labs team and Script community, many projects are already in the works including decentralized exchanges (DEXs), staking pools, and more.

Developers can deploy Smart Contracts to the Script Blockchain by compiling `Solidity` code (using favourite compiler toolchain) into bytecode and using then to call node’s RPC function. .

Users can deploy and interact with the smart contracts through the Script Web Wallet or programmatically via the Script Blockchain SDK.

On the Script Blockchain, SCPT token regulates execution of smart contracts. This will go live in November 2024 expected.


# 💻 How to quickly deploy a smart contract on Script Blockchain

Below we show a quick Solidity smart contract example, compiled using Remix and deployed through the Metamask web wallet.

(A) Pre-requisites :

1. Install [Metamask](https://metamask.io/download/) in your browser
2. Guide to add a [Custom Network](https://metamask.zendesk.com/hc/en-us/articles/360043227612-How-to-add-custom-Network-RPC-and-or-Block-Explorer) with the parameters

Network Name: Script Testnet&#x20;

New RPC URL: <https://testeth-rpc-api.script.tv/rpc&#x20>;

Chain ID: 742&#x20;

Currency Symbol (optional): SPAY&#x20;

Block Explorer URL (optional): <https://explorer.script.tv/>

Now, We’ll walk through this process step by step.

1. Open [Remix IDE](< https://remix.ethereum.org>) in your browser
2. Next, Create a new file in Remix of your choice and copy/paste the code from the source you want or write the code their itself. Once the code is entered, click the Solidity Compiler button on the far left.
3. Next, You’ll need to set the Compiler to the version you have used to write the code, and in the Contract field respective contract is selected. Then click the blue button that says “Compile {FILE\_NAME}.sol”.

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

4. Next, You'll need to switch to deployment button on the far left and configure or select few parameters

* Select "Injected - Provider Metamask" from Environment dropdown which will help to connect with metamask.(Make sure to switch to script network before proceed for deployment and also make sure to have SPAY token on connected address to pay gas fees)

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

* Select the main contract of your compiled contract where all the function were called or inherited into it from Contract dropdown.

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

* Click the Deploy button to execute the process.
* Click confirm button to process the contract transaction in the metamask pop-up enabled.

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

* After few seconds you will get the confirmation pop up for the successful transaction and contract creation in metamask transaction activity area as well as a section enabled on remix with contract address and their respective functions.

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

6. Verification of smartcontract on script explorer

* Copy the contract address from remix and search it on explorer.
* Switch to contract section which is next to transaction table.

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

* Copy & paste the contract code and ABI compiled from remix

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

* Click verify and Publish to confirm for verification

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

7. After verification you will get to see the functions enabled on explorer corresponding to deployed contract with contract details.

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


# How to run a node without any syncing issue ?

1\. Install and configure the blockchain node as per system OS i.e linux, windows or MAC described in previous sections of whitepaper. Refer to <https://whitepaper.script.tv/nodes/lightning-node-overview/lightning-node-setup#windows>

2. Now switch to nodepath where seed peer is configured i.e

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

3. Open config file and edit the seeds ip with whom you want to connect and sync .
4. File will appears like shown below :

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

5. Save the file after changing the seed peers.

Note : Make sure to configure only those ip as a seedpeer who is already synced with current block height of the blockchain and is running on any server then only that ip will allow you to connect. We need to follow the same if we want to run multiple of nodes i.e one to many and many to others.

6. Also change the seed ip on below path as well

<div align="left"><figure><img src="/files/IwOerINSJm7mzDRfNXPH" alt=""><figcaption></figcaption></figure></div>

7. Thereafter switch to script path i.e

<div align="left"><figure><img src="/files/552H6jZThbMjwRyQnBmM" alt=""><figcaption></figcaption></figure></div>

8. Execute the below command

   make install
9. Start the node and cli service similar to previous instructions.


# Smart Contract & App Development


# Turing-Complete Smart Contract

Turing-complete smart contracts open the door to numerous use cases in video streaming and beyond, from token investments in streamers, to automated splits of SPAY rewards between platform/streamers/users, to non-fungible tokens (NFTs) representing top content creators. The Script Virtual Machine is compatible with the Ethereum Virtual Machine. Thus, porting over existing Ethereum-based contracts is simple and thousands of smart contract developers can easily jump to building on Script.

Script's release, along with the Script/Ethereum RPC adaptor project, provides support for the Ethereum RPC API similar to Binance Smart Chain and Polygon. The Script/Ethereum RPC adapter software translates the Script RPC endpoints into the Ethereum RPC APIs. With it, Script now supports the entire Etherum DApp dev stack including Metamask, Hardhat, Remix, Ethers.js, Web3.js, and Truffle Suite. Ethereum DApps that are ported over to Script can use the same API calls to interact with Script blockchain. This means Ethereum DApps can be deployed to Script with no or minor modifications and tap into the growing Script user and capital base.

Before diving into more detail, we note that on the Script Blockchain, SPAY takes the place of ETH in all contracts. Just as you need ETH to deploy or interact with smart contracts on Ethereum, you need SPAY to do so on Script blockchain. All SPAY used to deploy or interact with smart contracts would be completely burned.

In this guide, we will walk you through the following topics:

* Script support for the Ethereum RPC API suite.&#x20;
* Use Metamask with Script.&#x20;
* Support for smart contract development tools, including Truffle, Hardhat, and Remix.&#x20;
* Support for libraries such as Web3.js, and ethers.js (checkout our Hardhat demo with ethers.js).


# Ethereum RPC API support

Script blockchain supports the Ethereum RPC APIs through the Script ETH RPC Adpator(<https://github.com/scriptnetwork/script-eth-rpc-adaptor>), which translates the Script RPC interface into the Ethereum RPC interface.

(I) Ethereum RPC APIs for the Script Testnet

We are hosting the Ethereum RPC adaptor for the Script Testnet at the URL below. The Chain ID for the Script Testnet(<https://chainlist.org/>) is 742.

\***Important note**: This hosted RPC service is only meant for lightweight usages. We highly recommend DApp developers to set up their in-house Ethereum RPC adaptors, especially those that use indexers like the Graph to crawl the chain data.

{% embed url="<https://testeth-rpc-api.script.tv/rpc>" %}

The following examples demonstrate how to interact with the Script Testnet through the above RPC endpoint with the curl command:

## Query Chain ID

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth\_chainId","params":\[],"id":67}' <https://testeth-rpc-api.script.tv/rpc>

## Query synchronization status

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth\_syncing","params":\[],"id":1}' <https://testeth-rpc-api.script.tv/rpc>

## Query block number

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth\_blockNumber","params":\[],"id":83}' <https://testeth-rpc-api.script.tv/rpc>

## Query account SPAY balance (should return an integer which represents the current SPAY balance in wei)

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth\_getBalance","params":\["0xc15149236229bd13f0aec783a9cc8e8059fb28da", "latest"],"id":1}' <https://testeth-rpc-api.script.tv/rpc>

We currently support the following Ethereum RPC methods(<https://ethereum.org/en/developers/docs/apis/json-rpc>):

eth\_chainId&#x20;

eth\_syncing&#x20;

eth\_accounts&#x20;

eth\_protocolVersion&#x20;

eth\_getBlockByHash&#x20;

eth\_getBlockByNumber&#x20;

eth\_blockNumber&#x20;

eth\_getUncleByBlockHashAndIndex&#x20;

eth\_getTransactionByHash&#x20;

eth\_getTransactionByBlockNumberAndIndex&#x20;

eth\_getTransactionByBlockHashAndIndex&#x20;

eth\_getBlockTransactionCountByHash&#x20;

eth\_getTransactionReceipt&#x20;

eth\_getBalance&#x20;

eth\_getStorageAt&#x20;

eth\_getCode&#x20;

eth\_getTransactionCount&#x20;

eth\_getLogs&#x20;

eth\_getBlockTransactionCountByNumber&#x20;

eth\_call&#x20;

eth\_gasPrice&#x20;

eth\_estimateGas&#x20;

eth\_sendRawTransaction&#x20;

eth\_sendTransaction&#x20;

eth\_sign&#x20;

eth\_signTypedData&#x20;

net\_version&#x20;

web3\_clientVersion

**Note 1:** Currently the RPC Adaptor does NOT support non-standard methods (<https://npmmirror.com/package/ganache-core/v/2.3.3>) like evm\_snapshot, evm\_revert, and evm\_mine. Thus, test cases using Fixtures (<https://ethereum-waffle.readthedocs.io/en/latest/fixtures.html>) (e.g. waffle.loadFixture()) are expected to fail when running against the Script blockchain.

**Note 2:** Currently the RPC Adaptor returns a generic "evm: execution reverted" messages in most case when the Script EVM execution fails. Some test cases may check the EVM errors with code like this:

await expect(this.bar.leave("200")).to.be.revertedWith("ERC20: burn amount exceeds balance")

To make these test pass, for now we need to replace the expected error message with "evm: execution reverted" as shown below:

await expect(this.bar.leave("200")).to.be.revertedWith("evm: execution reverted")

If you need testnet SCPT/SPAY for DApp development purpose, please contact us at <https://discord.com/invite/scriptnetwork>.


# Setup the ETH RPC Adaptor for the Script Testnet

This page provides the instructions to setup the ETH RPC Adaptor for the Script Testnet on a virtual machine. The adaptor is a middleware which translates the Script RPC interface to the Ethereum RPC interface. To enable the Script ETH RPC API service, you’d need to run

1. the Script Node, and
2. the Script/ETH RPC adaptor on the same VM.

Below is the recommended VM spec:

OS: Ubuntu (18.04.4 LTS or higher version)&#x20;

CPU: 4 cores or more&#x20;

Memory: 32 GB or more&#x20;

Hardrive: 1 TB+ SSD drive

(I) Install and Launch the Script Testnet Node (<https://whitepaper.script.tv/validators/validator-node-setup>)

(II) Install and Launch the ETH RPC adaptor

> Install the adaptor

You'd need to compile the adaptor from the source code. First, install Go 1.14.2 and set environment variables GOPATH , GOBIN, and PATH. Next, clone the Script blockchain repo and install Script following the steps below:

mkdir -p $GOPATH/src/github.com/scripttoken

cd $GOPATH/src/github.com/scripttoken

git clone <https://github.com/scriptnetwork/Node-Network-guide.git> $GOPATH/src/github.com/scripttoken/script&#x20;

cd script&#x20;

git checkout release&#x20;

export GO111MODULE=on&#x20;

make install

Next, clone the script-eth-rpc-adaptor repo:

cd $GOPATH/src/github.com/scripttoken

git clone <https://github.com/scriptnetwork/script-eth-rpc-adaptor.git>

Following the steps below to build the script-eth-rpc-adaptor binary and copy it into your $GOPATH/bin.

export SCRIPT\_ETH\_RPC\_ADAPTOR\_HOME=$GOPATH/src/github.com/scripttoken/script-eth-rpc-adaptor&#x20;

cd $SCRIPT\_ETH\_RPC\_ADAPTOR\_HOME&#x20;

export GO111MODULE=on&#x20;

make install

> Start the Adaptor

Now, create the config folder for the RPC adaptor

export SCRIPT\_ETH\_RPC\_ADAPTOR\_HOME=$GOPATH/src/github.com/scripttoken/script-eth-rpc-adaptor&#x20;

cd $SCRIPT\_ETH\_RPC\_ADAPTOR\_HOME&#x20;

mkdir -p ../scriptnet/eth-rpc-adaptor

Use your favorite editor to open file ../scriptnet/eth-rpc-adaptor/config.yaml, paste in the follow content, save and close the file:

script:

rpcEndpoint: "<http://127.0.0.1:16888/rpc>"

node:

skipInitializeTestWallets: true

rpc:

enabled: true&#x20;

httpAddress: "0.0.0.0"&#x20;

httpPort: 18888&#x20;

wsAddress: "0.0.0.0"&#x20;

wsPort: 18889&#x20;

timeoutSecs: 600&#x20;

maxConnections: 2048

log:&#x20;

levels: "\*:info"

Then, launch the adaptor binary with the following command:

screen -S rpc\_adaptor # if you run the node on a Linux server

cd $SCRIPT\_ETH\_RPC\_ADAPTOR\_HOME

script-eth-rpc-adaptor start --config=../scriptnet/eth-rpc-adaptor

The ETH RPC server should now be started at port 18888.

> Sanity checks

After the adaptor is started, you can issue the following curl commands to make sure the ETH RPC APIs service is up and running. Note that in the config.yaml file, rpc.httpAddress is set to "0.0.0.0", which enables the RPC APIs to be accessible from a remote machine. Of course, you'd also need to setup proper firewall rules to allow remote access.

## Query Chain ID

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth\_chainId","params":\[],"id":67}' <http://127.0.0.1:18888/rpc>

## Query synchronization status

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth\_syncing","params":\[],"id":1}' <http://127.0.0.1:18888/rpc>

## Query block number

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth\_blockNumber","params":\[],"id":83}' <http://127.0.0.1:18888/rpc>

## Query account SPAY balance (should return an integer which represents the current SPAY balance in wei)

curl -X POST -H 'Content-Type: application/json' --data '{"jsonrpc":"2.0","method":"eth\_getBalance","params":\["0xc15149236229bd13f0aec783a9cc8e8059fb28da", "latest"],"id":1}' <http://127.0.0.1:18888/rpc>


# Metamask

> Connect Metamask to the Script Testnet

Script blockchain is fully interoperable with Metamask. To connect Metamask to the Script Testnet, follow this guide to add a custom Network with the parameters shown in the screenshot:

{% embed url="<https://metamask.zendesk.com/hc/en-us/articles/360043227612-How-to-add-custom-Network-RPC-and-or-Block-Explorer>" %}

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

Network Name: Script Testnet&#x20;

New RPC URL: <https://testeth-rpc-api.script.tv/rpc&#x20>;

Chain ID: 742&#x20;

Currency Symbol (optional): SPAY&#x20;

Block Explorer URL (optional): <https://explorer.script.tv/>

In the Script blockchain, SPAY is the gas token which powers the smart contracts. The users can use Metamask to send and receive SPAY, similar to Ether in the Ethereum blockchain. The users can also send and receive SRC20 tokens (the ERC20 token counterpart in the script blockchain). Note that currently Metamask does not support the SCPT token yet.

**NOTE:** At this time some exchanges, such as Binance, do not support receiving SCPT blockchain tokens from a smart contract address, which is how they are sent via the Metamask plug-in. If you send tokens to an exchange address via Metamask, they may be lost.


# Truffle

Using Truffle for DApp development on Script is pretty much the same as on Ethereum. This page will take you through the basics of testing a smart contract and deploying it to the Script Testnet through truffle. In particular, we will use the following simple "coin-like" smart contract project for the demo:

{% embed url="<https://github.com/truffle-box/metacoin-box>" %}

> Install Truffle

If you haven't done so, please follow the instructions below (<https://trufflesuite.com/docs/truffle/how-to/install/>) to install the Truffle suite. NodeJS v8.9.4 or later is required. For readers that are not yet familiar with Truffle, please click here (<https://trufflesuite.com/docs/truffle/overview>) to learn more.

npm install -g truffle

> Setup the MetaCoin Demo Project

Next, clone the MetaCoin demo project, and install the dependencies:

git clone <https://github.com/truffle-box/metacoin-box>

cd metacoin-box

npm install @truffle/hdwallet-provider

Use your favorite editor to edit the truffle-config.js file. Replace its content with the following code snippet, which configures the Script Tesnet.

const HDWalletProvider = require('@truffle/hdwallet-provider');

module.exports = {

&#x20;         mocha: {

&#x20;               enableTimeouts: false,

&#x20;               before\_timeout: 480000

&#x20;    },

&#x20;    networks: {

&#x20;    script\_testnet: {

&#x20;        provider: () => {

&#x20;              // private key for test wallet #1: 0x19E7E376E7C213B7E7e7e46cc70A5dD086DAff2A

&#x20;              var privateKeyTest1 = '1111111111111111111111111111111111111111111111111111111111111111';

&#x20;              // private key for test wallet #2: 0x1563915e194D8CfBA1943570603F7606A3115508&#x20;

&#x20;             var privateKeyTest2 = '2222222222222222222222222222222222222222222222222222222222222222';

return new HDWalletProvider({

&#x20;   privateKeys: \[privateKeyTest1, privateKeyTest2],

&#x20;   providerOrUrl: '<https://testeth-rpc-api.script.tv/rpc>',

&#x20; });

},

&#x20;   network\_id: 742,

&#x20;   gasPrice: 4000000000000,

&#x20;   }

&#x20; }

};

> Run the MetaCoin Unit Test Suite

Recall that on the Script blockchain, SPAY is the gas token, similar to Ether on the Ethereum blockchain. Also, make sure the deployer wallet has a sufficient amount of SPAY on the Script Testnet (e.g. 100 SPAY).

export SEQ=`scriptcli query account --address=0x2E833968E5bB786Ae419c4d13189fB081Cc43bab | grep sequence | grep -o '[[:digit:]]\+'`

scriptcli tx send --chain="scriptnet" --from=0x2E833968E5bB786Ae419c4d13189fB081Cc43bab --to=0x19E7E376E7C213B7E7e7e46cc70A5dD086DAff2A --spay=1000 --password=qwertyuiop --seq=$(($SEQ+1))

> Now we can proceed to deploy the smart contracts testnet:

truffle deploy --network script\_testnet --reset

> Next we can run the unit test cases (sometimes the test could take 2-3 minutes to complete):

truffle test ./test/TestMetaCoin.sol --network script\_testnet

truffle test ./test/metacoin.js --network script\_testnet


# Hardhat

To demonstrate how to develop DApps on Script using the Hardhat suite (<https://hardhat.org/hardhat-runner/docs/getting-started#overview>). This guide will walk you through the steps to deploy and test on Script using Hardhat and ethers.js (<https://docs.ethers.org/v6/>).

> Setup the Hardhat project

> Fund the test accounts with some SPAY

Execute the two commands below to fun the test accounts with some SPAY:

export SEQ=`scriptcli query account --address=0x2E833968E5bB786Ae419c4d13189fB081Cc43bab | grep sequence | grep -o '[[:digit:]]\+'`

scriptcli tx send --chain="scriptnet" --from=0x2E833968E5bB786Ae419c4d13189fB081Cc43bab --to=0x19E7E376E7C213B7E7e7e46cc70A5dD086DAff2A --spay=1000 --password=qwertyuiop --seq=$(($SEQ+1))

scriptcli tx send --chain="scriptnet" --from=0x2E833968E5bB786Ae419c4d13189fB081Cc43bab --to=0x1563915e194D8CfBA1943570603F7606A3115508 --spay=1000 --password=qwertyuiop --seq=$(($SEQ+2))

> Deploy the contract to the script testnet

First, edit the hardhat.config.js file, replace "11...1" with the actual private key of the deployer wallet (should delete the key after use, do NOT commit the private key to GitHub):

...&#x20;

script\_testnet: {&#x20;

url: `https://testeth-rpc-api.script.tv/rpc`,&#x20;

accounts: \["1111111111111111111111111111111111111111111111111111111111111111"],&#x20;

chainId: 742,&#x20;

gasPrice: 4000000000000 }, ...

Next, go to the repository's root folder and run this to deploy your contract:

npx hardhat run scripts/deploy.js --network script\_testnet

> Special Notes on Testing with the Ethers.js+Waffle framework

**Note 1**: Currently the RPC Adaptor does NOT support non-standard methods such as evm\_snapshot, evm\_revert, and evm\_mine. Thus, test cases using Fixtures (e.g. waffle.loadFixture()) are expected to fail when running against the Script blockchain.

**Note 2:** Currently the RPC Adaptor returns a generic "evm: execution reverted" messages in most case when the Script EVM execution fails. Some test cases may check the EVM errors with code like this:

await expect(this.bar.leave("200")).to.be.revertedWith("ERC20: burn amount exceeds balance")

To make these test pass, for now we need to replace the expected error message with "evm: execution reverted" as shown below:

await expect(this.bar.leave("200")).to.be.revertedWith("evm: execution reverted")




---

[Next Page](/llms-full.txt/1)

