Maximize Your Steemit Earnings: Re-Delegation for Increased Profits, Stronger Witnesses, and Enhanced Steem Power

I hope all developers are doing well, and I am specifically writing this post for developers and Witnesses of Steemit. I would like to offer a suggestion and discuss a potential change in the blockchain that could greatly benefit Steemit, its witnesses, and Steem users.
In fact, we can see that the platform we originally created with Hive has far surpassed us. Looking at the current situation, Hive is much more advanced than Steemit. Yes, I understand that Steemit has slightly better security than Hive, but in many other aspects, Hive has taken the lead. We need to take a positive step forward to address this.
I believe that decentralized applications (DApps) on Steemit are not receiving enough funding. Currently, investing in Steemit does not bring significant returns, which is why we must implement some changes to bring Steemit back to its former position. If we look back at Steemit's past, we can clearly see how high its value once was.
As a suggestion based on my knowledge, I propose a feature called team re-delegation. Steemit re-delegation means that if I receive a delegation from someone—let's say someone delegates 10 Steem to me—I should be able to further delegate that same amount of Steem. This would greatly benefit active witnesses and servers, particularly the ones that are working properly, and will allow many users to receive rewards.
This feature could also help generate new tokens. One of the primary benefits of Steemit not generating new tokens is that the price of Steem will maintain its support level and not drop significantly. This would foster Steemit's growth in the long run. If we can delegate the received delegation further, many users who want to create wealth will be encouraged to invest in Steemit.
I will make additional changes in future posts and provide some code examples. These examples will help illustrate how re-delegation works. Below, I will give a concept of re-delegation, which I believe will be very beneficial for Steemit. Implementing this change at this time is crucial.
In any case, I am not asking for my post to be upvoted or for any kind of endorsement. My question to you is that if this proposal is implemented, witnesses will play a significant role in approving it. I suggest that the best witness who can make this change should take the lead, and the other witnesses should vote in favor of it. This will significantly improve Steemit.
https://github.com/steemit/steem/edit/main/libraries/chain/steem_evaluator.cpp
void delegate_vesting_shares_evaluator::do_apply( const delegate_vesting_shares_operation& op )
{
const auto& delegator = _db.get_account(op.delegator);
const auto& delegatee = _db.get_account(op.delegatee);
asset available_vesting = delegator.vesting_shares - delegator.delegated_vesting_shares;
asset received_vesting = delegatee.received_vesting_shares;
asset total_available = available_vesting + received_vesting;
FC_ASSERT( total_available >= op.vesting_shares, "Not enough vesting shares to delegate." );
_db.modify(delegator, [&](account_object& a) {
a.delegated_vesting_shares += op.vesting_shares;
});
_db.modify(delegatee, [&](account_object& a) {
a.received_vesting_shares += op.vesting_shares;
});
process_redelegation(op.delegator, op.delegatee, op.vesting_shares);
}
void delegate_vesting_shares_evaluator::process_redelegation( const account_name_type& delegator, const account_name_type& delegatee, const asset& vesting_shares )
{
const auto& delegation_idx = _db.get_index<vesting_delegation_index>().indices().get<by_delegator_delegatee>();
auto itr = delegation_idx.find(std::make_tuple(delegator, delegatee));
if (itr == delegation_idx.end()) {
_db.create<vesting_delegation_object>([&](vesting_delegation_object& obj) {
obj.delegator = delegator;
obj.delegatee = delegatee;
obj.vesting_shares = vesting_shares;
obj.min_delegation_time = _db.head_block_time() + STEEM_DELEGATION_TIME;
obj.redelegation_allowed = true;
});
} else {
_db.modify(*itr, [&](vesting_delegation_object& obj) {
obj.vesting_shares = vesting_shares;
});
}
}
bool delegate_vesting_shares_evaluator::can_redelegate( const account_name_type& delegatee )
{
const auto& account = _db.get_account(delegatee);
return account.received_vesting_shares.amount > 0;
}
void delegate_vesting_shares_evaluator::validate_redelegation(const account_name_type& delegator, const account_name_type& delegatee)
{
const auto& delegation_idx = _db.get_index<vesting_delegation_index>().indices().get<by_delegator_delegatee>();
auto itr = delegation_idx.find(std::make_tuple(delegator, delegatee));
FC_ASSERT(itr != delegation_idx.end(), "Delegation does not exist for redelegation.");
FC_ASSERT(itr->vesting_shares.amount > 0, "No vesting shares available for redelegation.");
}
void delegate_vesting_shares_evaluator::track_redelegation_history( const account_name_type& delegator, const account_name_type& delegatee, const asset& vesting_shares )
{
_db.create<vesting_redelegation_history_object>([&](vesting_redelegation_history_object& obj) {
obj.delegator = delegator;
obj.delegatee = delegatee;
obj.vesting_shares = vesting_shares;
obj.timestamp = _db.head_block_time();
});
}
void delegate_vesting_shares_evaluator::limit_redelegation_depth( const account_name_type& delegator, const account_name_type& delegatee )
{
const auto& delegation_idx = _db.get_index<vesting_delegation_index>().indices().get<by_delegatee>();
auto itr = delegation_idx.find(delegatee);
FC_ASSERT(std::distance(delegation_idx.begin(), itr) < MAX_REDELEGATION_DEPTH, "Exceeded maximum re-delegation depth.");
}
void delegate_vesting_shares_evaluator::handle_expired_redelegations()
{
const auto& delegation_idx = _db.get_index<vesting_delegation_index>().indices().get<by_expiration>();
auto itr = delegation_idx.begin();
while (itr != delegation_idx.end() && itr->min_delegation_time < _db.head_block_time()) {
_db.modify(*itr, [&](vesting_delegation_object& obj) {
obj.vesting_shares = asset(0, VESTS_SYMBOL);
});
itr++;
}
}
void delegate_vesting_shares_evaluator::update_redelegation_status(const account_name_type& delegator, const account_name_type& delegatee)
{
const auto& delegation_idx = _db.get_index<vesting_delegation_index>().indices().get<by_delegator_delegatee>();
auto itr = delegation_idx.find(std::make_tuple(delegator, delegatee));
if (itr != delegation_idx.end()) {
_db.modify(*itr, [&](vesting_delegation_object& obj) {
obj.redelegation_allowed = false;
});
}
}
void delegate_vesting_shares_evaluator::log_redelegation_event( const account_name_type& delegator, const account_name_type& delegatee, const asset& vesting_shares )
{
ilog("Redelegation Event: ${d} -> ${r} : ${v}", ("d", delegator)("r", delegatee)("v", vesting_shares));
}
void delegate_vesting_shares_evaluator::reverse_redelegation(const account_name_type& delegator, const account_name_type& delegatee)
{
const auto& delegation_idx = _db.get_index<vesting_delegation_index>().indices().get<by_delegator_delegatee>();
auto itr = delegation_idx.find(std::make_tuple(delegator, delegatee));
if (itr != delegation_idx.end()) {
_db.modify(*itr, [&](vesting_delegation_object& obj) {
obj.vesting_shares = asset(0, VESTS_SYMBOL);
});
}
}
void delegate_vesting_shares_evaluator::notify_redelegation_change(const account_name_type& delegator, const account_name_type& delegatee)
{
ilog("Notification: Redelegation updated from ${d} to ${r}", ("d", delegator)("r", delegatee));
}
void delegate_vesting_shares_evaluator::finalize_redelegation(const account_name_type& delegator, const account_name_type& delegatee)
{
ilog("Finalizing redelegation from ${d} to ${r}", ("d", delegator)("r", delegatee));
update_redelegation_status(delegator, delegatee);
track_redelegation_history(delegator, delegatee, asset(0, VESTS_SYMBOL));
}
Here is a breakdown of what the code is doing in a more concise manner:
Delegation of Vesting Shares:
- The code starts by retrieving the delegator and delegatee accounts from the database.
- It checks if the delegator has enough vesting shares available to delegate to the delegatee.
- If the delegator has enough vesting shares, the code updates both the delegator's and delegatee's accounts by adding the delegated and received vesting shares, respectively.
Delegation Tracking:
- The
process_redelegation()
function is called to manage and track the delegation. - The function checks if a delegation already exists between the delegator and delegatee. If it exists, it updates the existing delegation; otherwise, it creates a new delegation record.
- This process involves setting the minimum delegation time and allowing redelegation.
- The
Vesting Shares Validation:
- The
validate_redelegation()
function checks if the redelegation is valid. If there's no existing delegation or no vesting shares available, it throws an error.
- The
Tracking Redelegation History:
- When a redelegation occurs, the
track_redelegation_history()
function is invoked to log the event into a separate history table.
- When a redelegation occurs, the
Limiting Redelegation Depth:
- The
limit_redelegation_depth()
function ensures that the delegation chain does not exceed a maximum depth, preventing an infinite loop of redelegations.
- The
Handling Expired Delegations:
- The
handle_expired_redelegations()
function checks if any delegation has expired based on themin_delegation_time
and, if expired, sets the vesting shares of the delegation to zero.
- The
Updating Delegation Status:
- The
update_redelegation_status()
function updates the status of a delegation (e.g., disabling redelegation) once it has been finalized.
- The
Logging and Notifications:
- The code logs various events for monitoring purposes (such as redelegation events) and sends notifications when redelegation happens or changes occur.
Reversing Redelegation:
- The
reverse_redelegation()
function can reverse a previous redelegation by setting the vesting shares back to zero.
- The
In Summary:
The code manages and tracks the delegation of vesting shares between accounts in a blockchain system, ensuring rules such as minimum delegation times, maximum delegation depths, and handling expired delegations. It also logs the redelegation events and sends notifications as needed.
I have written this code as a basic structure. I understand it's not the complete code, but I believe the core functionality is clear. The witnesses and developers are the ones who can make changes and add necessary implementations where required. The code is designed to allow them to build on it.
I'll also provide a link to the full file so they can make the necessary adjustments and improvements.
Please feel free to implement the changes required.
https://github.com/steemit/steem/blob/main/libraries/chain/include/steem/chain/evaluator.hpp
#pragma once
#include "steem/chain/evaluator.hpp"
#include "steem/chain/objects.hpp"
namespace steem { namespace chain {
class delegate_vesting_shares_evaluator : public evaluator<delegate_vesting_shares_evaluator>
{
public:
typedef delegate_vesting_shares_operation operation_type;
void do_apply(const delegate_vesting_shares_operation& op);
private:
void process_redelegation(const account_name_type& delegator, const account_name_type& delegatee, const asset& vesting_shares);
bool can_redelegate(const account_name_type& delegatee);
void validate_redelegation(const account_name_type& delegator, const account_name_type& delegatee);
void track_redelegation_history(const account_name_type& delegator, const account_name_type& delegatee, const asset& vesting_shares);
void limit_redelegation_depth(const account_name_type& delegator, const account_name_type& delegatee);
void handle_expired_redelegations();
void update_redelegation_status(const account_name_type& delegator, const account_name_type& delegatee);
void log_redelegation_event(const account_name_type& delegator, const account_name_type& delegatee, const asset& vesting_shares);
void reverse_redelegation(const account_name_type& delegator, const account_name_type& delegatee);
void notify_redelegation_change(const account_name_type& delegator, const account_name_type& delegatee);
void finalize_redelegation(const account_name_type& delegator, const account_name_type& delegatee);
void check_redelegation_constraints(const account_name_type& delegator, const account_name_type& delegatee);
void audit_redelegation_history(const account_name_type& account);
void enforce_redelegation_limits(const account_name_type& delegator, const account_name_type& delegatee);
void reset_redelegation_flags(const account_name_type& delegator, const account_name_type& delegatee);
void monitor_active_redelegations(const account_name_type& delegator);
void optimize_redelegation_logic(const account_name_type& delegator, const account_name_type& delegatee);
void validate_redelegation_timeframe(const account_name_type& delegator, const account_name_type& delegatee);
void apply_redelegation_penalties(const account_name_type& delegator);
};
} } // namespace steem::chain
Here’s a concise explanation of the file content written in a way that will help others understand its purpose and what it does:
Explanation of delegate_vesting_shares_evaluator.hpp
:
This header file defines a class called delegate_vesting_shares_evaluator
, which is part of the Steem blockchain's evaluation logic for the delegate_vesting_shares
operation. The class contains methods responsible for processing and managing the delegation of vesting shares between accounts. This operation is used to delegate a certain amount of a user's vesting shares to another user, allowing them to participate in governance and voting.
The methods in the class cover various aspects of delegating, managing, and tracking redelegations. Here's a breakdown of its functions:
do_apply: This is the main method for applying the delegation of vesting shares. It handles the logic for delegating shares from one account to another.
process_redelegation: Handles the logic for redelegating shares between accounts.
can_redelegate: Checks whether a user is eligible to redelegate their received vesting shares.
validate_redelegation: Validates whether a redelegation operation can be carried out by checking if the delegation exists and if there are sufficient shares for redelegation.
track_redelegation_history: Records the history of the redelegation for future reference.
limit_redelegation_depth: Ensures that the number of redelegations does not exceed the allowed maximum depth, preventing excessive chains of redelegation.
handle_expired_redelegations: Manages expired delegations and updates their statuses accordingly.
update_redelegation_status: Updates the status of a redelegation after certain conditions are met.
log_redelegation_event: Logs events related to redelegation for auditing and tracking purposes.
reverse_redelegation: Reverts a redelegation action if required.
notify_redelegation_change: Sends notifications to inform others when a redelegation has been updated.
finalize_redelegation: Finalizes the redelegation process, updating all relevant records and statuses.
check_redelegation_constraints: Checks if all constraints related to redelegation are satisfied.
audit_redelegation_history: Audits the history of redelegations for an account to ensure compliance with policies.
enforce_redelegation_limits: Enforces rules that limit how many redelegations can occur from one account to another.
reset_redelegation_flags: Resets any flags related to redelegation to ensure the system functions correctly.
monitor_active_redelegations: Monitors ongoing redelegations to ensure they are functioning as expected.
optimize_redelegation_logic: Optimizes the logic behind redelegations for better efficiency.
validate_redelegation_timeframe: Validates the timeframe for a redelegation operation to ensure it falls within allowable periods.
apply_redelegation_penalties: Applies penalties for violations related to redelegation operations.
Purpose:
The file defines a class that plays a critical role in managing and ensuring the proper functionality of vesting share delegations, particularly focusing on how redelegations (reassignments of delegated shares) are handled within the Steem blockchain. The methods address multiple scenarios like checking limits, enforcing rules, logging events, and ensuring that all delegations and redelegations adhere to the rules and policies of the system.
Summary:
- Main Role: The class helps manage delegations of vesting shares, including redelegation, validation, tracking, and logging.
- Usage: It’s crucial for maintaining the integrity and correctness of vesting share delegation on the Steem blockchain.
- Flexibility: The class is built with methods to handle various scenarios related to delegations and redelegations, offering flexibility to handle complex rules and constraints.
This is the explanation of the header file. If you are sharing this with witnesses or developers, you can paste this as part of the documentation, so they know the structure and what to expect from the code. They can add functionality or tweak existing logic based on this understanding.
https://github.com/steemit/steem/blob/main/libraries/chain/database.cpp
Apart from that, this file needs to be changed. Now I think the witnesses understand what to do.
delegate_vesting_shares_operation.hpp
delegate_vesting_shares_operation.cpp
database.hpp
database.cpp
account_object.hpp
account_object.cpp
steem_operations.hpp
steem_operations.cpp
transaction_evaluator.hpp
transaction_evaluator.cpp
history.hpp
history.cpp
plugin/steem_operations_plugin.hpp
plugin/steem_operations_plugin.cpp
rpc_api.hpp
rpc_api.cpp
wallet.hpp
wallet.cpp
gui/frontend (if applicable)
unit_tests/
Here’s a concise way you can write the last paragraph for your post, referring to the files mentioned:
Note: The changes described above primarily involve modifying the core files related to the delegation and redelegation logic in the Steem blockchain system. Additional adjustments to related components such as the transaction evaluators, account objects, and RPC interfaces may be required for full functionality. Developers and witnesses can make further refinements and apply these updates as needed to ensure smooth integration.
Here’s the explanation for the redelegation feature and its benefits in the desired format:
To make this change happen, we need collective effort and unity. This change can only be achieved if we all come together with the same vision. By supporting this initiative, we can work toward a stronger Steem ecosystem. Let’s be united, and together, we will make this change a reality.
Benefits of Adding the Redelegation Feature in Steem
The implementation of the redelegation feature will provide several key benefits:
Increased User Engagement: Users who delegate their Steem will have the option to redelegate it, increasing their ongoing engagement with the platform. This feature will encourage users to reallocate their resources, thus keeping them more involved in the system.
More Flexible Investment Strategies: With the ability to redelegate, users can move their Steem to different accounts or projects based on performance, incentivizing better decision-making and strategic planning within the ecosystem.
Boost in Delegation and Network Growth: By enabling redelegation, users are more likely to delegate their Steem in the first place, as they know they can move their shares later if needed. This increased delegation will drive more liquidity and growth within the Steem network.
Enhanced Reward System: Redelegation allows for better rewards allocation as users can choose to redirect their Steem to more promising or profitable delegates, thus potentially receiving greater returns on their investments.
Strengthening the Steem Ecosystem: As more Steem is delegated and redelegated, the overall value of Steem will rise. The flexibility of redelegation makes Steem a more attractive platform for both investors and developers, contributing to the overall growth and stability of Steem.
Increased Steem’s Value: With more delegates being involved in redelegation and a stronger reward system, the overall supply-demand mechanics will favor the increase of Steem's value, leading to more users adopting and investing in Steem.
Steem’s Position Beyond Hive: Redelegation increases the circulation and utility of Steem tokens, contributing to its competitive edge in the blockchain space, especially as it gains a unique and attractive feature that Hive does not yet offer.
This feature will not only make Steem more dynamic but also encourage greater user participation, fostering a more robust and flexible ecosystem.
Menstion Witnesses / Valueable Users
@steemchiller
@justyy
@symbionts
@bountyking05
@rme