This topic popped up recently when the team of https://ammer.cards started working on the integration of æternity into their hardware wallet which we just recently showcased at the Token Summit in Liechtenstein where æternity was Platinum Sponsor.
Currently, due to the lack of native support for secp256k1 for accounts & signature verification, the integration MUST be handled using the Generalized Account feature of æternity. This in general works very good and this is definitely a good showcase to highlight this protocol feature. However, this scenario isn’t really convenient right now.
- Ammer Card needs to obtain the secp256k1 public key from the card (hardware wallet)
- Ammer Card will convert a regular, plain-old account into a Generalized Account which means a contract is being attached to account which now handles the authorize logic for this account
- this is handled via the
GaAttachTxtype where also the secp256k1 public key needs to be provided because the contract needs to be able to verify valid signatures based on this curve
- the contract uses the Crypto namespace provided in the standard library of Sophia to verify a valid transaction
- this is handled via the
- Ammer Card will then for each new transaction
- create a
SpendTxbased on the input provided in the app with nonce=0 (required for
- compute the tx-hash for the prepared
SpendTxin a specific way which is required for the inner tx used in a
- call a specific entrypoint of the contract behind the GA to obtain the actual hash which is quite hard to do without going that route
- pass the hash to be signed to the hardware wallet
- receive the signed hash from the hardware wallet
- encode the calldata for the
authorizeentrypoint (authData) which needs to be provided in the
- create the actual
GaMetaTxproviding the required details (GA address, authData, spendTx)
- broadcast the
GaMetaTxto the network
- create a
A complete example how this process looks like using the Java SDK can be observed here:
- the Java SDK (which is used by the Ammer Card team) currently does still rely on a http compiler to compile contracts and to encode/decode calldata
If you follow the steps and the example highlighted above there is a lot of overhead required to achieve a quite simple goal. The team of Ammer Card anyway integrated this into their application and thus we can now happily use a cool hardware wallet to send and receive Æ as well as other cryptos.
However, supporting secp256k1 natively would have made it much easier for the Ammer Card team to integrate æternity into their system.
Personally I think there is one issue in this specific case when you made a backup of the private key of the wallet and you lose the card. You would definitely want to recover your account and get somehow access to it, right? Following things need to be considered:
- the address of the GA cannot easily be recovered just by knowing the private key (because it’s based on secp256k1)
- the address of the GA must be known or fetched in some way from the Ammer Card app on your smartphone
OR the Ammer Card support team can provide you the correct address
OR you can remember/lookup the GA address based on some activity you know that the account perfomed (e.g. a claim of a specific name)
OR you try to obtain that information via an indexer like e.g. the ae_mdw where you could try to find the information about the secp256k1 public key through looking into the params provided in a
Personally I don’t really have a strong opinion on that one. I know and see that this procedure is quite an overhead. I am actually very interested in the opinion of the core developers about this. I remember discussing it shortly with @dimitar.chain before the Æternity Universe Two conference
I think we have a lot of other important topics on the plate and this would definitely be another and probably also big one.
Independent of that I absolutely LOVE æternity being integrated into Ammer Card and I am happy to support their team in any way
If such integration is a huge pain for potential partners we should seriously discuss that topic.