create account

A second layer network - SMTs and more by mahdiyari

View this thread on: hive.blogpeakd.comecency.com
· @mahdiyari ·
$154.94
A second layer network - SMTs and more
<center>![software-developer-pixabay.jpg](https://images.hive.blog/DQmSUoy2e7mXt6VurZUXEB9Z4t6NtncTXRkQxZt2P7gpxWX/software-developer-6521720_1280.jpg)
</center>

I have been thinking and working on this for a while. I want to share it with you and get some feedback.
All the things I talk about here are not definite. They can change based on the feedback.
### Second-layer or side chain
A side chain has its own rules and block production like the base blockchain. The owners or maintainers of the side chain have the power to stop you from accessing the network.

A second layer network on the other hand only relies on the main chain. Its rules are the rules of the main blockchain. Just like the hivemind. You can run your own hivemind and have access to its data.

This is my understanding of how both work. Some people or some apps use these two terms in place of each other. But I don't agree with that because there are huge differences between the two.
***
### Which one to choose
The easier option is probably the second-layer network. It can be as decentralized as the main blockchain. And doesn't require the complexity of having another chain.

You don't need to connect to the other nodes of this network to sync or update your data. You just rely on the main blockchain.

But there are limitations here. You can't manipulate it like a side chain so easily. I think this is a fair price to pay.

So I decided to make it a second-layer network.
***

### How it works
We have the main token for our second layer network. We call this TOKEN for now.

- TOKEN is used for paying the fee of the transactions on the second layer.
- TOKEN can be staked to generate more TOKEN.
- TOKEN is being generated by staking HIVE i.e. powering up (not so sure about this one).
- TOKEN makes it possible to have an internal exchange for the possible SMTs.

These are some ideas that I could think of. There are some things that need addressing in regards to these ideas. Like where the fees should go? We can burn the fees or send them to a DAO for future developments. But burning seems a better idea considering the constant printing of the TOKEN by holding HP.

The purpose of the fee is to stop bad actors. We have RC on the main blockchain but that wouldn't help in the second layer network because the main chain has no idea about the second layer usage.

The generation of TOKEN is also something important to discuss. We know there are some big stakeholders on HIVE. I'm not sure how we can make it a more fair distribution along with making use of the HIVE coin. Maybe we can print it only to the TOKEN holders and skip the HP holders. This is not decided yet.

### Governance
I want to make this network like the hivemind. So there is no need for block producers or anything like that. However, there might be a need for a set of witnesses to decide the fate of the network. I'm still not sure about this idea.

***
### Smart contracts or SMTs
My first idea was to run an ETH VM in the second layer to have support for smart contracts. But I think that makes it too complicated and opens up room for more bugs.

But, we can make SMTs in this layer. Tokens with as much customization as possible. Making it possible to create complex social media tokens or just simple ERC20 tokens.

I know having a working network with support for smart contracts is necessary for having more apps. So maybe we can work on that later.
***
### Development plan
My personal idea is to work in this order:
1. Make the main token and its necessary functions
2. Prepare the necessary interfaces to interact with the network like a web wallet and a block explorer
3. Make a browser extension wallet in the quality of MetaMask
4. Make the token creation system for simple tokens
5. Implement more complex social media tokens in a way to at least be capable of handling the main social aspects of the HIVE token
6. Explore the possible idea of smart contracts
***
### Development language
I like to make it possible with the help of TypeScript. It's JavaScript with types. An easier language to work with but also powerful enough.
This makes it possible for a wider range of developers within the Hive community to make contributions.
TypeScript along with MySQL or maybe PostgreSQL for the backend storage. I have experience working with MySQL and it's fast enough but I'm not sure about its powers in handling a much larger amount of data. That's why I'm open to the idea of PostgreSQL just like the hivemind.
***
### Why
This is not by any means a full explanation of a complex network. This is just me throwing around my ideas to get feedback from you.
I'm not sure if there are already some networks like this in the work or if anyone has anything planned to make. That is why I'm sharing this right now.

I have done some developments and the main token seems to be working. But I'm not so sure about continuing my work. Is there really a need for this? How can we make it better? Or just give this up and work on something else?

We might be late in this area but I'm sure everything is possible.

My idea was to make it as decentralized as possible and have a fair launch. I don't want to create another steemit inc. that can take over this second layer network. There are some concerns about this too. Like how to make it sustainable and beneficial to the main blockchain at the same time?

I'm not going to make it more complicated than this for now. We can discuss more things if we ever decided to go forward.

Please share your ideas in the comments.
Thanks for your time.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 390 others
👎  
properties (23)
authormahdiyari
permlinka-second-layer-network-smts-and-more
categoryhive-139531
json_metadata{"tags":["hive-139531","hive","smt","dev","second-layer"],"image":["https://images.hive.blog/DQmSUoy2e7mXt6VurZUXEB9Z4t6NtncTXRkQxZt2P7gpxWX/software-developer-6521720_1280.jpg"],"app":"hiveblog/0.1","format":"markdown"}
created2021-12-31 12:28:51
last_update2021-12-31 12:28:51
depth0
children7
last_payout2022-01-07 12:28:51
cashout_time1969-12-31 23:59:59
total_payout_value77.644 HBD
curator_payout_value77.291 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,568
author_reputation168,453,265,420,231
root_title"A second layer network - SMTs and more"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id109,022,484
net_rshares73,999,235,967,705
author_curate_reward""
vote details (455)
@disregardfiat ·
$0.27
This sounds like the first thoughts into the (dlux_open_token)[https://github.com/dluxio/dlux_open_token] architecture. If you want to help us generalize the token architecture further as we turn it into "honeycomb" we'd welcome your support.

There are several things you're likely to run into with your current roadmap. One is the databases you mention don't have transnational handlers so you'll likely need to make some custom handlers to ensure order. You might find a p2p layer is overly complicated and unnecessary unless you want to allow transactions that aren't signed/ordered on hive. You'll need to build an exchange because there is no substitute 0x or swap protocols on Hive.

As far as the why and how will this benefit Hive: Having smart contracts in Hive/HBD denominations is a major boon to our ecosystem. With our decentralized wallet those things are possible, and well as a DEX. 
👍  
properties (23)
authordisregardfiat
permlinkre-mahdiyari-r51zc4
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2021.09.1"}
created2022-01-01 22:48:06
last_update2022-01-01 22:48:06
depth1
children0
last_payout2022-01-08 22:48:06
cashout_time1969-12-31 23:59:59
total_payout_value0.134 HBD
curator_payout_value0.135 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length900
author_reputation316,321,895,198,604
root_title"A second layer network - SMTs and more"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id109,062,781
net_rshares142,446,943,913
author_curate_reward""
vote details (1)
@guiltyparties ·
I have to think about this to really answer with the depth of feedback that this idea requires, but for now as its 1am on New Years: I agree that a layer vs side chain is the way to go. A side chain is more centralized and requires more oversight efforts in order to ensure its quality (of its infrastructure) is up to acceptable standards. It requires a lot of coordination if attempts to decentralize are made. A layer is by default expected to take on the quality of the core protocol, meaning its infrastructure is expected to be of due quality and no extra running around is needed. I don't know about Typescript. That wouldn't have been my choice. I also don't agree in regards to the priority of work. I would have had all the backend work, testing and functionality completed first and then have worried about interacting through frontend tools. 

I think this is a good thing to sketch out on Visio. Just thinking, I'm wondering if HIVE stakeholders will have any incentive to also hold large sums of the token if said token will be generated by their HIVE. Meaning, they'd hold it through generating it but not through investment in it directly (they're already invested in HIVE). It would kind of play out like the account credits where they become stacked and used as needed but not optimally distributed to maximum utility. I have to think about this some more in order to do this idea justice.
👍  
👎  , , , , , , , ,
properties (23)
authorguiltyparties
permlinkr50p6p
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-01-01 06:11:15
last_update2022-01-01 06:11:15
depth1
children0
last_payout2022-01-08 06:11:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,407
author_reputation249,608,556,879,395
root_title"A second layer network - SMTs and more"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id109,042,155
net_rshares-230,619,316,274
author_curate_reward""
vote details (10)
@howzat · (edited)
.
properties (22)
authorhowzat
permlinkre-mahdiyari-2022529t161722690z
categoryhive-139531
json_metadata{"app":"hiveblog/0.1","format":"markdown+html"}
created2022-05-29 11:17:24
last_update2023-02-07 06:08:21
depth1
children0
last_payout2022-06-05 11:17:24
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1
author_reputation45,591,344,077,992
root_title"A second layer network - SMTs and more"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id113,608,408
net_rshares0
@jordand89 ·
This is a little beyond my understanding, but sounds interesting. Would this be similar to hive-engine?
properties (22)
authorjordand89
permlinkre-mahdiyari-20211231t134122550z
categoryhive-139531
json_metadata{"tags":["hive-139531","hive","smt","dev","second-layer"],"app":"ecency/3.0.20-vision","format":"markdown+html"}
created2021-12-31 19:41:21
last_update2021-12-31 19:41:21
depth1
children0
last_payout2022-01-07 19:41:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length103
author_reputation541,780,110,410
root_title"A second layer network - SMTs and more"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id109,032,570
net_rshares0
@menati ·
$0.39
Hi mahdi.im from iran.a photographer and director.nice to meet you.
👍  
properties (23)
authormenati
permlinkre-mahdiyari-2022520t22050210z
categoryhive-139531
json_metadata{"tags":["hive-139531","hive","smt","dev","second-layer"],"app":"ecency/3.0.29-mobile","format":"markdown+html"}
created2022-05-19 21:50:48
last_update2022-05-19 21:50:48
depth1
children1
last_payout2022-05-26 21:50:48
cashout_time1969-12-31 23:59:59
total_payout_value0.196 HBD
curator_payout_value0.196 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length67
author_reputation106,061,268,557,484
root_title"A second layer network - SMTs and more"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id113,350,522
net_rshares622,421,739,358
author_curate_reward""
vote details (1)
@mahdiyari ·
;)
properties (22)
authormahdiyari
permlinkrc5j9s
categoryhive-139531
json_metadata{"app":"hiveblog/0.1"}
created2022-05-19 22:46:51
last_update2022-05-19 22:46:51
depth2
children0
last_payout2022-05-26 22:46:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2
author_reputation168,453,265,420,231
root_title"A second layer network - SMTs and more"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id113,351,612
net_rshares0
@notconvinced ·
My 2cents? Leave eth out of it. Find another option... All erc20 tokens are worthless. 

Witnesses? The representative republic type set-up here is what hinders decentralizing the platform. This is a huge bottleneck and we need to widen it. If the blockchain is perfect for voting, let's use it to do so...
properties (22)
authornotconvinced
permlinkre-mahdiyari-r51cvd
categoryhive-139531
json_metadata{"tags":["hive-139531"],"app":"peakd/2021.09.1"}
created2022-01-01 14:42:51
last_update2022-01-01 14:42:51
depth1
children0
last_payout2022-01-08 14:42:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length306
author_reputation13,945,139,652,889
root_title"A second layer network - SMTs and more"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id109,051,140
net_rshares0