ARC-0080: Explicitly Reject Program Address as Record Owner #56
randomsleep
started this conversation in
ARCs
Replies: 2 comments
-
privacy core value of aleo |
Beta Was this translation helpful? Give feedback.
0 replies
-
I think this is either adding identifier in Address type or using different prefix for program address |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
arc: 0080
title: Explicitly Reject Program Address as Record Owner
authors: randomsleep
discussion: #56
topic: Application
status: Draft
created: 2023-12-29
Abstract
The current Aleo system permits the assignment of a
Record
to any address, including program addresses. However, programs cannot spend aRecord
. Consequently, anyRecord
assigned to a program becomes irretrievable, leading to unintended asset loss in Aleo, which can include credits, tokens, NFTs, and more. With the introduction of arc-0030, which enables Aleo users to transfer assets to a program, the frequency of such incidents is likely to increase.This proposal seeks to explicitly prohibit the creation of a
Record
with a program as the owner, significantly reducing the potential for asset loss.Specification
The proposed solution involves modifying the
Record
creation process to reject any attempt to assign aRecord
to a program address. This can be achieved by adding a validation step in theRecord
creation process to check the type of the address. If the address belongs to a program, the process should throw an error and abort theRecord
creation.For example, if a user tries to create a
Record
with a program address likealeo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqquzlzl
, the system should return an error message like "Invalid owner address: A program cannot own a Record."Test Cases
The following test cases should be considered:
Record
with a program address - This should fail with an appropriate error message.Record
with a non-program address - This should succeed.Record
to a program address - This should fail with an appropriate error message.Considering the following program.
Run
mint_public
should succeed.Run
mint_public_then_transfer
should succeed.Run
mint_private
must fail.Run
mint_private_then_transfer
must fail.Dependencies
This proposal directly affects the Aleo and snarkVM repositories as they contain the logic for
Record
creation and validation.Backwards Compatibility
This proposal does not introduce any backwards incompatibility as it adds a new validation step in the
Record
creation process.Security & Compliance
This proposal enhances the security of the Aleo platform by preventing unintended asset loss. It does not introduce any new regulatory concerns.
Beta Was this translation helpful? Give feedback.
All reactions