Abstract
Sesscion-Key Aspect allows EoA to extend several sub-keys named Session Key.
Session keys are able to stand in for EoA private key to sign a specific transaction. These keys will automatically expire at the block height, which is set by EoA. They are also limited to sign specific transactions, calling only specific smart contract methods.
Project Intro
- Folder 'aspect' implements the session key Aspect; check inside README.md to learn more.
- Folder 'js_client' implements the session key Aspect javascript client; check inside README.md to learn more.
Overview
1. EoA binding session key to Aspect
Additional info:
-
Specific contractis a contract address. For example, if it’s a DEX contract address, it means that the session key is only limited to calling an Artex contract. -
Specific methodsis a list of method signature ofSpecific contract. For example, if it’s[0x0000CAFE, 0xCAFE0000,], it means that the session key is only limited to this two method.
2. Use session key to sign transaction
Additional info :
-
The
fromis still the address of EoA. -
The signature
v,r,sis generated by private key of sKey.
3. Artela verify the transaction
Additional info
- The transaction may be signed by the EoA privaten point needs to be verified by the EoA public key again if the Aspect returns key, so the joi false.
4. Call contract
Additional info
-
Smart contract doesn’t know which keys sign the tx.
-
When the smart contract accesses
msg.sender, the value isfromin the transaction.
Implements
Session-key Aspect project contains two components.
- Client,
sessioin-key-aspect.js, a client for the dApp front end to use session key. - Aspect, wasm bytecode deployed on Artela
- Explorer, extend Artela explorer to show Aspect info
Client Details
sessioin-key-aspect.js is the client of Session-key Aspect.
It contains 3 key modules:
- session-key store
- signer
- aspect-client
session-key store offers:
-
generate key pair in the front end
-
manage key pair in the browser cache
( including store, load, clear, etc.)
signer offers:
-
high-level API for dApp to use the session key
-
load session key from
What’s the difference between AA
It works like AA (abstract account). For example, we can design a kind of AA that can be signed by a main private key and some session keys.
But it will be more flexible than AA.
-
EoA can not extend to AA.
If you want to use session-key enable AA, you have to transfer your assets from your EoA to a new AA. This user experience might be terrible in some situations.
By Session-Key Aspect, an EoA can send a transaction to bind it with Session-Key Aspect, and then the EoA will upgrade to a kind of AA that supports the session key. It needn’t transfer its assets.
-
Users only need to manage one key.
If you use AA, you might manage several AA wallets with different function. By using Aspect to extend EoA, you just use one wallet with several extension functions.




