Veive
  • What is VEIVE?
  • Introduction
  • The problem
  • Protocol
    • Features
    • Typical flow
    • Used technologies
    • Identity creation and verification
    • Pre-authorization
  • Use-cases
    • Konio Wallet
  • Framework
    • Difference from ERC-7579 standard
    • Account
    • Module types
      • Validation modules
      • Execution modules
      • Sign modules
      • Hooks modules
    • Core modules
      • Mod validation signature
      • Mod allowance
      • Mod execution any
      • Mod sign WebauthN
      • Mod sign OpenID
      • Mod validation multisign
      • Mod sign Mnemonic
  • Strategies
    • Community involvement
    • Business
    • Protocol Adoption
  • Objectives and success metrics
  • Roadmap
  • Conclusion
Powered by GitBook
On this page
  • Overview
  • Purpose
  1. Framework
  2. Core modules

Mod allowance

PreviousMod validation signatureNextMod execution any

Last updated 3 months ago

Overview

ModAllowance is a comprehensive validation module within the Veive protocol, designed specifically for the Koinos blockchain. This module employs an allowance mechanism to pre-authorize operations, ensuring that only actions explicitly approved by the user are executed. By leveraging this mechanism, ModAllowance provides robust control over transaction execution, preventing unauthorized actions and potential replay attacks. Notably, this module is also applicable for validating internal operations, ensuring that even operations triggered within a contract are authorized.

Purpose

The ModAllowance module serves as a pivotal component in the Veive ecosystem by validating operations against a set of pre-authorized allowances. This functionality is crucial for both external and internal operations, ensuring comprehensive security and control. Key features include:

  • Allowance Mechanism: Users can pre-authorize specific operations using the allow method, which stores details such as the operation's contract ID, entry point, arguments, and transaction ID. This mechanism prevents unauthorized transactions and ensures that each allowance is tied to a specific transaction, preventing reuse. This feature is particularly important for managing internal operations, where contracts may invoke additional operations.

  • Validation Process: During execution, ModAllowance checks if the incoming operation matches any stored allowances. It verifies transaction ID, contract ID, entry point, and arguments. If a match is found, the corresponding allowance is removed, ensuring that it cannot be reused, thus preventing replay attacks. This process includes verifying allowances for operations that may be internally triggered by other contracts, ensuring a comprehensive validation scope.

  • Scope Management: The default scope for ModAllowance is set to "call_contract," meaning it can validate any call operation unless a more specific scope is defined. This flexibility allows for the module's application across a broad range of scenarios, from general validation to specific contract operations.