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

Cannot Associate Token with account using Alias #2657

Closed
bugbytesinc opened this issue Dec 21, 2021 · 4 comments
Closed

Cannot Associate Token with account using Alias #2657

bugbytesinc opened this issue Dec 21, 2021 · 4 comments
Milestone

Comments

@bugbytesinc
Copy link

Description

If trying to use the alias form of an address to invoke a token associate, it fails with invalid account id.

Steps to reproduce

create an account with pay to alias
try to associate the account
association fails with invalid account id.

Additional context

logs from test
create account

12/21/2021 8:00:12 PM  TX BODY  { "transactionID": { "transactionValidStart": { "seconds": "1640116811", "nanos": 966259600 }, "accountID": { "accountNum": "1499" } }, "nodeAccountID": { "accountNum": "3" }, "transactionFee": "6000000000", "transactionValidDuration": { "seconds": "120" }, "memo": "Test Account Instance: Creating Test Account on Network", "cryptoTransfer": { "transfers": { "accountAmounts": [ { "accountID": { "accountNum": "1499" }, "amount": "-119413143" }, { "accountID": { "alias": "EiBwCXsQ0vdO1DVKDEcA+EPVZE5Z44zX3Jx48LR4Mm5nPw==" }, "amount": "119413143" } ] } } }
12/21/2021 8:00:12 PM  └─ SIG → { "sigPair": [ { "ed25519": "5jI9qLyvONbTDZxKsuju/dKCAB61jUIKmB0cUnfS8fVrIbtDWQcRGvDBKhyAgl+rWgkn0ciLuCWXspYxqOPECg==" } ] }
12/21/2021 8:00:12 PM  RX:(00)  { }
12/21/2021 8:00:12 PM  TX     → { "transactionGetReceipt": { "transactionID": { "transactionValidStart": { "seconds": "1640116811", "nanos": 966259600 }, "accountID": { "accountNum": "1499" } } } }
12/21/2021 8:00:12 PM  RX:(00)  { "transactionGetReceipt": { "header": { }, "receipt": { "status": "UNKNOWN" } } }
12/21/2021 8:00:13 PM  RX:(01)  { "transactionGetReceipt": { "header": { }, "receipt": { "status": "UNKNOWN" } } }
12/21/2021 8:00:13 PM  RX:(02)  { "transactionGetReceipt": { "header": { }, "receipt": { "status": "UNKNOWN" } } }
12/21/2021 8:00:13 PM  RX:(03)  { "transactionGetReceipt": { "header": { }, "receipt": { "status": "UNKNOWN" } } }
12/21/2021 8:00:14 PM  RX:(04)  { "transactionGetReceipt": { "header": { }, "receipt": { "status": "UNKNOWN" } } }
12/21/2021 8:00:14 PM  RX:(05)  { "transactionGetReceipt": { "header": { }, "receipt": { "status": "SUCCESS", "exchangeRate": { "currentRate": { "hbarEquiv": 1, "centEquiv": 12, "expirationTime": { "seconds": "4102444800" } }, "nextRate": { "hbarEquiv": 1, "centEquiv": 15, "expirationTime": { "seconds": "4102444800" } } } } } }

associate token

12/21/2021 8:00:18 PM  TX BODY  { "transactionID": { "transactionValidStart": { "seconds": "1640116818", "nanos": 201320000 }, "accountID": { "accountNum": "1499" } }, "nodeAccountID": { "accountNum": "3" }, "transactionFee": "6000000000", "transactionValidDuration": { "seconds": "120" }, "tokenAssociate": { "account": { "alias": "EiBwCXsQ0vdO1DVKDEcA+EPVZE5Z44zX3Jx48LR4Mm5nPw==" }, "tokens": [ { "tokenNum": "9459" } ] } }
12/21/2021 8:00:18 PM  └─ SIG → { "sigPair": [ { "pubKeyPrefix": "Zg==", "ed25519": "PCY5RxdojH5R4r9Q2u4jitD/sWIkFsb3qiqSbFVV9SagS2JMLSfJgf5Vn6akBN0YZdYxw4HKBVrb4u+nbW6pCw==" }, { "pubKeyPrefix": "cA==", "ed25519": "PZld39Dia7UypUOJ7bJ2p9anin1WhpZ8rGmx1qC/wg/4ABxeIY4xyCvg5tgpTvI/uV5bPk0CusJwlDAWCMnpDQ==" } ] }
12/21/2021 8:00:18 PM  RX:(00)  { }
12/21/2021 8:00:18 PM  TX     → { "transactionGetReceipt": { "transactionID": { "transactionValidStart": { "seconds": "1640116818", "nanos": 201320000 }, "accountID": { "accountNum": "1499" } } } }
12/21/2021 8:00:18 PM  RX:(00)  { "transactionGetReceipt": { "header": { }, "receipt": { "status": "UNKNOWN" } } }
12/21/2021 8:00:18 PM  RX:(01)  { "transactionGetReceipt": { "header": { }, "receipt": { "status": "UNKNOWN" } } }
12/21/2021 8:00:18 PM  RX:(02)  { "transactionGetReceipt": { "header": { }, "receipt": { "status": "UNKNOWN" } } }
12/21/2021 8:00:18 PM  RX:(03)  { "transactionGetReceipt": { "header": { }, "receipt": { "status": "UNKNOWN" } } }
12/21/2021 8:00:19 PM  RX:(04)  { "transactionGetReceipt": { "header": { }, "receipt": { "status": "UNKNOWN" } } }
12/21/2021 8:00:19 PM  RX:(05)  { "transactionGetReceipt": { "header": { }, "receipt": { "status": "UNKNOWN" } } }
12/21/2021 8:00:20 PM  RX:(06)  { "transactionGetReceipt": { "header": { }, "receipt": { "status": "INVALID_ACCOUNT_ID", "exchangeRate": { "currentRate": { "hbarEquiv": 1, "centEquiv": 12, "expirationTime": { "seconds": "4102444800" } }, "nextRate": { "hbarEquiv": 1, "centEquiv": 15, "expirationTime": { "seconds": "4102444800" } } } } } }

Hedera network

previewnet

Version

Current PREVIEWNET

Operating system

Windows

@bugbytesinc bugbytesinc added the Bug An error that causes the feature to behave differently than what was expected based on design. label Dec 21, 2021
@SimiHunjan
Copy link
Contributor

hi @bugbytesinc ! Thank you for the issue. In this initial release of the feature, we are only supporting using the alias in crypto transfer transactions, account balance and account infos queries. You will be able to use the alias in all transactions and queries in place of an account ID in a future release.

@bugbytesinc
Copy link
Author

image

@bugbytesinc
Copy link
Author

Since the HAPI was changed at a primitive level, what kind of precautions are you taking to make sure that the potential code branches by not checking the alias may introduce. I am concerned by relying on the old code for "invalid xyz" may introduce code paths that could turn out to be 0 day vulnerabilities. At the very least, each entry point should be checked and a custom "alias not implemented just yet" code be thrown instead.

@SimiHunjan SimiHunjan added enhancement and removed Bug An error that causes the feature to behave differently than what was expected based on design. labels Dec 22, 2021
@SimiHunjan SimiHunjan added this to the Hedera 0.23.0 milestone Jan 13, 2022
@Neeharika-Sompalli
Copy link
Member

Will be resolved by this parent issue for extending alias support for all Transactions and Queries #2691

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

No branches or pull requests

3 participants