Skip to content

Commit 66d9f23

Browse files
committed
Address review
1 parent bfd3b86 commit 66d9f23

File tree

1 file changed

+33
-26
lines changed

1 file changed

+33
-26
lines changed

FIPS/fip-draft_authenticate_method.md renamed to FIPS/fip-0044.md

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
---
2-
fip: <to be assigned>
2+
fip: "0044"
33
title: Standard Authentication Method for Actors
4-
author: Alex North (@anorth), Aayush Rajasekaran (@arajasek)
4+
author: Aayush Rajasekaran (@arajasek), Alex North (@anorth)
55
discussions-to: https://github.com/filecoin-project/FIPs/discussions/413
66
status: Draft
77
type: Technical (Interface)
8-
created: 2022-09-02
8+
created: 2022-08-02
99
replaces: [FIP-0035](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0035.md)
1010
---
1111

@@ -14,25 +14,30 @@ replaces: [FIP-0035](https://github.com/filecoin-project/FIPs/blob/master/FIPS/f
1414
The Filecoin protocol has entities called "actors" that can be involved in computation on the Filecoin blockchain.
1515
There are various different kinds of actors; among the most common are accounts and multisigs.
1616
With [the planned introduction of the Filecoin Virtual Machine](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0030.md), there will be many new kinds of user-defined actors.
17-
Unfortunately, today, the only kind of actors that can be asked to verify whether they have authorized a piece of data are account actors -- they do so through a signature validation.
18-
This FIP is the starting point to evolve a convention by which any actor can verify such authorization. It simply proposes adding a special "authorize" message that actors can choose to implement.
19-
If they do so, it can be used by other actors to validate their authorization of data.
17+
Unfortunately, today, the only kind of actors that can "authenticate" a piece of data are account actors -- they do so through a signature validation.
18+
This FIP is the starting point to evolve a convention by which any actor can verify such authenticity. It simply proposes adding a special "authenticate" message that actors can choose to implement.
19+
If they do implement such a method, it can be used by other actors to authenticate pieces of data.
2020

2121
## Abstract
2222

23-
There is a need for arbitrary actors to be able to authorize (to other actors) that they have approved of a piece of data. This need will become more pressing with the Filecoin Virtual Machine.
24-
This FIP proposes adding an `Authorize` message that any actor can choose to implement. This message can be called by any other actor to verify whether the "authorizer"
25-
approves of a piece of data. This is a small change to the existing actors, and allows for user-defined actors to flexibly implement this method according to their needs.
23+
There is a need for arbitrary actors to be able to verify (to other actors) that they have approved of a piece of data. This need will become more pressing with the Filecoin Virtual Machine.
24+
This FIP proposes adding an `Authenticate` method that any actor can choose to implement.
25+
This method can be called by any other actor to verify the authenticity of a piece of data. This is a small change to the existing actors, and allows for user-defined actors to flexibly implement this method according to their needs.
26+
Concretely, we add this method to the built-in `Account` actor, and have the `Storage Market` actor invoke this method,
27+
in lieu of validating signatures directly.
2628

2729
## Change Motivation
2830

29-
We want any actors, including user-defined actors, to be able to confirm that they have authorized some data.
30-
If we don't have this ability, we will need to engineer around it in painful ways. The proposed [FIP-0035](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0035.md)
31-
is a concrete example; it proposes adding several new methods and data types in order to enable
32-
user-defined actors to serve as clients for storage deals.
31+
We want any actors, including user-defined actors, to be able to authenticate arbitrary data.
32+
If we don't have this ability, we will need to engineer around it in painful ways.
3333

34-
It will be infeasible to modify the builtin-actors themselves every time we want to be able to authorize some new kind of information, and doing so will require more total messages
35-
to be landing on the Filecoin blockchain. Instead, a flexible, universal approach for actors to authorize data would be preferred.
34+
The proposed [FIP-0035](https://github.com/filecoin-project/FIPs/blob/master/FIPS/fip-0035.md)
35+
is a concrete example. It seeks to allow user-defined actors to serve as storage clients in the built-in `Storage Market` actor.
36+
In order to enable this, it proposes adding several new methods and data types in order to work around the
37+
inability of user-defined actors to authenticate data.
38+
39+
It will be infeasible to modify the builtin-actors themselves every time we want to be able to authenticate some new kind of information, and doing so will require more total messages
40+
to be landing on the Filecoin blockchain. Instead, a flexible, universal approach for actors to authenicate data would be preferred.
3641

3742
## Specification
3843

@@ -41,15 +46,15 @@ This method can then be the blueprint for other builtin actors (eg. the multisig
4146
as well as a template for user-defined actors.
4247

4348
```
44-
/// Authenticates whether the provided authorization is valid for the provided message.
45-
/// Errors if the authentication is invalid.
46-
pub fn verify_authorization(params: VerifyAuthorizationParams) -> Result<(), ActorError>
49+
/// Authenticates whether the provided input is valid for the provided message.
50+
/// Errors with USR_ILLEGAL_ARGUMENT if the authentication is invalid.
51+
pub fn authenticate_message(params: AuthenticateMessageParams) -> Result<(), ActorError>
4752
```
4853

4954
The params to this method is a wrapper over the message and signature to validate:
5055

5156
```
52-
pub struct VerifyAuthorizationParams {
57+
pub struct AuthenticateMessageParams {
5358
pub authorization: Vec<u8>,
5459
pub message: Vec<u8>,
5560
}
@@ -66,6 +71,9 @@ Other actors might opt for creative implementations of such authorization based
6671
others can choose not to support this endpoint at all -- the Filecoin protocol's singleton builtin-actors
6772
such as the Storage Power Actor, the System Actor, the Cron Actor, etc. will likely choose to omit this method.
6873

74+
In order for this method to function as a standard for future actors, it needs a standardized invocation pattern.
75+
In the current dispatch model based on method numbers, that would be a standardized method number for `authenticate_message` methods. This FIP does not propose adopting a standard method number, preferring to rely on a new standardized calling convention, such as [FRC-0042](https://github.com/filecoin-project/FIPs/blob/master/FRCs/frc-0042.md) instead.
76+
6977
## Backwards Compatibility
7078

7179
Introducing new methods to the builtin-actors needs a network upgrade, but otherwise breaks no backwards compatibility.
@@ -74,29 +82,28 @@ Introducing new methods to the builtin-actors needs a network upgrade, but other
7482

7583
Proposed test cases include:
7684

77-
- that the `verify_authorization` method on account actors can be called and succeeds with valid input
78-
- that the `verify_authorization` method on account actors can be called, but fails with invalid input
85+
- that the `authenticate_message` method on account actors can be called and succeeds with valid input
86+
- that the `authenticate_message` method on account actors can be called, but fails with invalid input
7987
- that storage deals can be made with the changes to the `StorageMarketActor`
8088

8189
## Security Considerations
8290

83-
We need to be careful with the security of the `verify_authorization` implementations of the
91+
We need to be careful with the security of the `authenticate_message` implementations of the
8492
builtin-actors. User-defined contracts are free to implement these methods as they see fit.
8593

86-
This FIP only proposes adding the `verify_authorization` method to the account actor, which
94+
This FIP only proposes adding the `authenticate_message` method to the account actor, which
8795
simply invokes the signature validation syscall.
8896

8997
## Incentive Considerations
9098

9199
This proposal is generally well-aligned with the incentives of the network. It can be considered
92-
as a simpler replacement for FIP-0035, with the only drawback being that this proposal as currently written does not allow for multisigs to be storage clients. It would be trivial
93-
to add a similar `verify_authorization` method to the multisig actor, though.
100+
as a simpler replacement for FIP-0035, with the only drawback being that this proposal as currently written does not allow for the existing built-in multisig actor to be a storage client.
94101

95102
## Product Considerations
96103

97104
This proposal is the first step towards enabling non-account actors to function as clients for
98105
storage deals, which is a major product improvement. Furthermore, it enables future innovation
99-
that relies on the ability of non-account actors to authorize data as approved.
106+
that relies on the ability of non-account actors to authenticate data as approved.
100107

101108
## Implementation
102109

0 commit comments

Comments
 (0)