Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sessions): permission co-signer API #244

Open
wants to merge 3 commits into
base: feat/bcapi_permissions
Choose a base branch
from

Conversation

geekbrother
Copy link
Contributor

This PR adds session permission co-signer API.

The corresponding Notion document.

@geekbrother geekbrother self-assigned this Jul 9, 2024
Copy link

vercel bot commented Jul 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
walletconnect-specs ⬜️ Ignored (Inspect) Visit Preview Jul 26, 2024 2:31pm

@geekbrother geekbrother changed the base branch from main to feat/bcapi_permissions July 9, 2024 10:58
@geekbrother geekbrother marked this pull request as ready for review July 9, 2024 11:00
Comment on lines 194 to 207
userOp: // ERC-4337 pseudo transaction object:
{
sender: string, // The address of the smart contract account.
nonce: number, // Anti-replay protection; also used as the salt for first-time account creation.
initCode: string, // Code used to deploy the account if not yet on-chain.
callData: string, // Data that's passed to the sender for execution.
callGasLimit: number, // Gas limit for execution phase.
verificationGasLimit: number, // Gas limit for verification phase.
preVerificationGas: number, // Gas to compensate the bundler.
maxFeePerGas: number, // Maximum fee per gas (similar to EIP-1559(opens in a new tab) max_fee_per_gas).
maxPriorityFeePerGas: number, // Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas).
paymasterAndData: string, // Paymaster Contract address and any extra data required for verification and execution (empty for self-sponsored transaction).
signature: string // Signature of all `userOp` fields hashed by keccak256 and signed by the key provided during the permission creation.
}
Copy link

@KannuSingh KannuSingh Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukaisailovic Is it expected for the dapp to build the userOp and then call this API to validate permissions before submission by the co-signer? Or will the co-signer build and submit the userOp?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The dapp needs to build userOp and sign it first.

Comment on lines 193 to 206
pci: String, // Permission controller identifier.
userOp: // ERC-4337 pseudo transaction object:
{
sender: string, // The address of the smart contract account.
nonce: number, // Anti-replay protection; also used as the salt for first-time account creation.
initCode: string, // Code used to deploy the account if not yet on-chain.
callData: string, // Data that's passed to the sender for execution.
callGasLimit: number, // Gas limit for execution phase.
verificationGasLimit: number, // Gas limit for verification phase.
preVerificationGas: number, // Gas to compensate the bundler.
maxFeePerGas: number, // Maximum fee per gas (similar to EIP-1559(opens in a new tab) max_fee_per_gas).
maxPriorityFeePerGas: number, // Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas).
paymasterAndData: string, // Paymaster Contract address and any extra data required for verification and execution (empty for self-sponsored transaction).
signature: string // Signature of all `userOp` fields hashed by keccak256 and signed by the key provided during the permission creation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any max-lengths on these fields? E.g. pci maybe max 64 chars or whatever the spec says?

@geekbrother geekbrother force-pushed the feat/bcapi_permissions branch 3 times, most recently from 892e380 to e471921 Compare October 8, 2024 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants