-
Notifications
You must be signed in to change notification settings - Fork 1
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
Arc60 Proposal update and Reference implementation #8
base: main
Are you sure you want to change the base?
Conversation
- spellcheck
Signed-off-by: ehanoc <ehanoc@protonmail.com>
Thanks, I like the proposed scope changes, but the In this example, the delegated logic-sig looks like this:
The important bit is the last line that returns one, which means the lsig approves the transaction. The remaining lines are just fillers to bring the lsig to 25 bytes when compiled. The remaining 7 bytes to reach 32 bytes come from the The compiled lsig plus the If an attacker manages to convince a user to sign this 32-byte payload with her address, the attacker can authorize any transaction from the victim's account (as is shown in the attached gist). With the proposed To prevent this, I think we need to check if the EDIT: It's |
… lsig request arc47 Signed-off-by: ehanoc <ehanoc@protonmail.com>
It's added now. |
… time for LSIG_TEMPLATE Signed-off-by: ehanoc <ehanoc@protonmail.com>
Signed-off-by: ehanoc <ehanoc@protonmail.com>
Signed-off-by: ehanoc <ehanoc@protonmail.com>
Signed-off-by: ehanoc <ehanoc@protonmail.com>
export enum ScopeType { | ||
UNKNOWN = -1, | ||
CHALLENGE32 = 0, | ||
MX_RANDOM = 1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale of random bytes now? We have had very long discussions on "random is not good".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MX_RANDOM is for backwards compatibility purposes as there are some private API's out there that use it. The MX prefix makes it safe to sign as i can't be anything else than a arbitrary message. Still open to remove / tweak it though.
We can test the implementation is an adversarial scenario if someone finds one.
|
||
toSign = decodedData | ||
break; | ||
case ScopeType.LSIG_TEMPLATE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The LSIG_TEMPLATE
thing is strange/no-user-friendly. IMO, we either allow the signing of LSIGS (users are responsible for passing the correct data with a schema) or remove this scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disagree on this. If we use templates and integrity checks for known templates; this API becomes safe as no unknown LSIGS can be signed. Just allowing LSIGS will open a can of worms and nightmare for apps / wallets to offer safe.
I see very little to no risk in doing so by using templates
Signed-off-by: ehanoc <ehanoc@protonmail.com>
Signed-off-by: ehanoc <ehanoc@protonmail.com>
ARC60 Proposal Change + Reference Implementation
Proposal Changes
ARC60Domain
SCOPE Changes
Auth
=>CHALLENGE32
: Most auth protocols do only require a 256 bit challenge to be signed and with that is good to be specific on the type. Requires no SCHEMA to validate, catering and helping to implement in hardware as well. The app just needs to check 32 byte size, since it cant ever be a valid tx anyway. This scope makes it very obvious and specific.MX_RANDOM
: For backwards compatibility. Some wallets have private APIs that cater to some apps and this is the standard. MX prefix + some random data. Also making easier to implement withou a hard requirement for JSON schema, wallet just needs to validate the MX prefix and make sure its not a transaction.LSIG
=>LSIG_TEMPLATE
: To avoid signing unknown data types and LSIG's, working with templates (ARC47) guarantees this IF we expand the validations to include a HASH OF THE TEMPLATE and description and NOT on the compiled LSIG after the values are set in. If we hash the templates and whitelist them in the implementation of the wallet, we CAN GUARANTEE that we only sign known LSIG's. Including the hash on the wallet implement instead of the actual templated programs, also makes the implementation a lot easier for hardware wallets (if they want to check this themselves) as doing integrity checks against hashes vs the entire LSIG's templates is a lot faster, cheap memory requirements and fast.The LSIG request is of the following format:
ARC47LsigTemplateRequest.LogicSignatureDescription
and whitelist only templates that matches those hashesReference Implementation and Test Suite
Instructions
Requires network as without a standalone compiler we need to reach a node to compile TEAL.
$ cd assets/arc-0060 $ yarn $ yarn test:cov
Output
TODO
arc-0060.md
- Not done. In imcomplete state. Needs to be updated to reflect these, if accepted.