Closed 1xstj closed 9 months ago
I'm not entirely sure the spec above has been updated or reflects a route that feels confident in its approach. Would welcome collaborating here @1xstj if you're stuck or updating this task as needed.
There are a few basic signing rules we need to build to make operating a private bridge as seamless as it was before.
In our private bridge we had 2 types of proposals
These two signing rules were used in a single application. We should ensure that we can make this possible using a smart contract and the permitted_caller
structure.
The permitted_caller
is an EVM smart contract address. We leverage a precompile to submit a job (as above) from different functions on our permitted_caller
contract.
contract PermittedCallerContract is GenericVotingContract {
address[] public voters;
uint256 public threshold;
public function submitGovernanceProposal(bytes32 phase1JobId, bytes jobDetails) {
// Validate the governance proposal
require(jobPrecompile.hasProposalBeenExecuted(phase1JobId, jobDetails);
// Execute it
jobPrecompile.submit(phase1JobId, jobDetails);
}
public function submitAnchorUpdateProposal(bytes32 phase1JobId, bytes jobDetails) {
// Validate the job/details are AUP
require(validateJob(phase1JobId, jobDetails), "Invalid job details");
// Check that we have received enough votes for the anchor update proposal.
// This custom logic must be implemented by this contract, i.e. voting, tallying, storage.
require(votesForProposal(keccak256(phase1jobId, jobDetails)) >= threshold, "Not enough votes");
jobPrecompile.submit(phase1JobId, jobDetails);
}
}
Description:
We want to allow users to submit signing rules with job submissions, these signing rules should dictate who/what proposals can be signed by an already existing DKG/zkSaas phase one result.
Tasks
Possible solutions and challenges:
The submitted contract can be an extension of
Challenge: This requires communication from substrate_pallet -> evm, not sure if a feasible solution exists for this yet.
caller
address to the job, thecaller
address is a evm smart contractThe jobs pallet can then add a
precompile
that allows submitting jobs to the pallet via evm contracts. The precompile will then allow only the known caller address to submit jobsExample :
Challenges : This is easier to implement than the first approach but can become too confusing for the average user, also charging the user/contract for jobs can be complicated