Creator payouts implementation in Joystream.js package#3182
Creator payouts implementation in Joystream.js package#3182zeeshanakram3 wants to merge 35 commits intoJoystream:carthagefrom
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/joystream/pioneer-testnet/3ofQGYHKEnJuyVwVymVxfa1qTW46 [Deployment for 7aea9f8 canceled] |
|
For 2 & 3, please read the detailed answer: If the payout vector is Now suppose we need to prove the membership of payout record for channel id pub fn claim_channel_reward(
...
proof: Vec<ProofElement<T>>, // [`proof_3`, `proof_01`, `proof_4567`] (shown blue in the diagram)
item: PullPayment<T>, // { c_2, p_2, m_2 }
) -> DispatchResult {ProblemThe payload body does not have all the Merkle branches required to construct the membership proof. For this specific example, SolutionInclude the remaining Merkle branches in the payload body Why need
|
Update
As you said in the discussion, another way to solve the problem is (and I assume this is what you actually meant): to change the structure of payout record, considering the above example, the payout record for channel id
Schema ChangesThe payout record for single channel would be: message CreatorPayout {
required uint32 channel_id = 1; // c_i
required float cumulative_payout_owed = 2; // p_i
enum Side {
Left = 0;
Right = 1;
}
message MerkleBranch {
required bytes merkle_branch = 1;
required Side side = 2;
}
repeated MerkleBranch merkle_branches = 3;
required string payout_rationale = 4; // d_i
}It will be the responsibility of someone who actually uploads the raw payload to provide the correct sequence of hashes that make up the membership proof. And, not the responsibility of client software to calculate the Merkle path and then fetch relevant branches/hashes/nodes that make up the required proof |
| offset?: number | ||
| ): Promise<CreatorPayoutPayload.Header | CreatorPayoutPayload.Body.CreatorPayout> { | ||
| // HTTP Url of remote host where payload is stored | ||
| let url = process.env.CREATOR_PAYOUT_DATA_URL as string |
There was a problem hiding this comment.
In the browser env, we won't be able to define this at build time since this URL can be dynamic. So it need to provided via some config/parameter instead
There was a problem hiding this comment.
Sure. In fact, that was discussed earlier too, I had planned to change that, Now I will prioritize it.
There was a problem hiding this comment.
Just making a note, not a priority at all from my perspective, realistically, the earliest time for using this in atlas is like 2 months
…-integration Project token->Content pallet integration
…rs-member-id Creator token transfers: Validate dst member_id
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
a361f88 to
ecf9349
Compare
|
superseded by #4334 |

The code for this implementation exists in the
joystreamjspackage at the root level of monorepo.The implementation assumption is that the payout payload would be fetched from some remote over HTTP
The following CLI commands have been implemented for creator payout management
content:updateCreatorPayoutCommitmentUpdate creator payout payload commitment hash in the runtime storage.content:creatorPayoutRecordShow payout information for creator given a channel id.content:claimCreatorPayoutRewardClaim creator payout reward for a given channel id.content:creatorPayoutPayloadHeaderGet header from serialized payload file.content:creatorPayoutRecordAtByteOffsetGet creator payout record from serialized payload file at given byte.content:generateCreatorPayoutPayloadCreate serialized creator payout payload from JSON input.content:generateCreatorPayoutMerkleRootGenerate merkle root for creator payout payload passed as JSON input.┆Issue is synchronized with this Asana task by Unito