Skip to main content

Purse: Personalize your Wallet

Project description

Overview

Purse: Personalize your Wallet

Design

Purse is a (very) simple smart wallet for EOAs, using EIP-7702 for core functionality. Purse only works for EOAs since it uses the SetCode transactions on supported neworks to install and uninstall it.

Out of the box, Purse has no features other than controlling a set of "accessories" that it can install (and uninstall) at will. Through the accessories, Purse can expand it's capabilities, such as adding multicall support and enabling automation through 3rd party delegation services. The only invariant in Purse is that only the EOA can add or remove accessories by directly calling these methods to itself, which means it only works in a EIP-7702 context via EOA delegatecall.

Purse calls its accessories through the fallback method (__default__ method in Vyper), where the method ID of the calldata is used to load the target address. It will then forward the entire calldata to that previously-approved target as it gets called via DELEGATECALL. How the accessory chooses to handle the calldata is up to them, the rest of the calldata is simply passed through to it. Also note that beyond restrictions of how accessories can be added or removed, there are no invariants maintained through 3rd party accessories unless they implement those measures themsleves.

If any accessory call has a failure, Purse's call handling will raise it and not continue processing the transaction. This presents a nicer interface when debugging call failures without dealing with nonce management features. Therefore, if you need replay protection, your accessory should implement it for itself.

Additionally, since all accessory calls are executed using DELEGATECALL, technically all accessories use the shared storage space: your EOA account. It is highly recommended not to use stateful accessories without further security analysis of their interactions with other accessories, but stateful accessories are possible. If designing a stateful accessory, it is highly recommended to manage the entire storage lifecycle, as well to make use of storage namespacing to ensure that no conflicts will exist between accessories (unless desired). Purse makes no guarantees about storage namespacing, and it is potentially highly dangerous and could lead to total account compromise if implemented poorly, since this also potentially allows eliding Purse's own security invariants for accessory management.

Technically, Purse can probably work with Threshold Signature or MPC technology, but it is not advised at this time without a security review. In fact, using Purse at all is probably not advised as it is an un-audited experiment based on a half-baked idea I had from seeing 7702 in the wild.


Purse is inspired by The Diamond Standard and ds-proxy.

Contributing

This project is written in Vyper.

This project uses ape to compile, test and script it. See Installation Guide for help installing it.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

purse_py-0.0.1a0.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

purse_py-0.0.1a0-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file purse_py-0.0.1a0.tar.gz.

File metadata

  • Download URL: purse_py-0.0.1a0.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for purse_py-0.0.1a0.tar.gz
Algorithm Hash digest
SHA256 8dadb387635aaade21637db6059a872aa0f9e0a0fc89b99ac0b6de89f82bbaf8
MD5 2e26d16809bea0ccfe60706041fcb1ad
BLAKE2b-256 98a22d985461b0cc21ca15607ebc8b85fd9627c24137e3a8f725580c4c2a311a

See more details on using hashes here.

File details

Details for the file purse_py-0.0.1a0-py3-none-any.whl.

File metadata

  • Download URL: purse_py-0.0.1a0-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for purse_py-0.0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 484436e186853a853d91cc0fa00f058d45c7cb0ed48f429363cbf15970d5b6e0
MD5 c844ac858806dee6390e4d22c54934a0
BLAKE2b-256 832858d35829916b956307b155d82609dd38005d88234c9ae379414ec32c6494

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page