Skip to content
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

Add support for AIP-80 parsing and formatting #107

Merged
merged 2 commits into from
Nov 22, 2024
Merged

Conversation

GhostWalker562
Copy link
Contributor

Description

Added support for AIP-80 compliant parsing and formatting.

Main Changes

  • Added two utilities, crypto.ParsePrivateKey and crypto.FormatPrivateKey. ParsePrivateKey is responsible for converting hex input (bytes, hexstring, aip80 compliant string) to bytes. FormatPrivateKey is responsible for taking bytes or hexstring it to an aip80 compliant string.
  • Used the new utilities when deriving a private key for Ed25519 and Secp256k1

Test Plan

  • ed25519_test.go
  • secp256k1_test.go

Related Links

https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-80.md

@GhostWalker562 GhostWalker562 self-assigned this Nov 20, 2024
crypto/secp256k1.go Outdated Show resolved Hide resolved
crypto/secp256k1.go Outdated Show resolved Hide resolved
crypto/secp256k1.go Show resolved Hide resolved
crypto/secp256k1.go Outdated Show resolved Hide resolved
crypto/privateKey.go Outdated Show resolved Hide resolved
crypto/ed25519.go Outdated Show resolved Hide resolved
crypto/privateKey.go Show resolved Hide resolved
crypto/privateKey.go Outdated Show resolved Hide resolved
crypto/privateKey.go Outdated Show resolved Hide resolved
crypto/privateKey.go Outdated Show resolved Hide resolved
Make ToAIP80 return error, fix bytes parsing
@GhostWalker562 GhostWalker562 merged commit 5606ce9 into main Nov 22, 2024
1 check passed
@GhostWalker562 GhostWalker562 deleted the add-aip80 branch November 22, 2024 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants