From 953f46420b2d527701478d443e0a319f649bd6e8 Mon Sep 17 00:00:00 2001 From: MG Date: Wed, 11 Sep 2024 17:51:05 +0300 Subject: [PATCH 1/9] Add ARC-004 support to ARC-0026 ARC4 ABI Calls are a necessary building block for decentralized SOA interoperability. The support is included in this commit. --- ARCs/arc-0026.md | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/ARCs/arc-0026.md b/ARCs/arc-0026.md index 1b0cf0604..8fc68a74c 100644 --- a/ARCs/arc-0026.md +++ b/ARCs/arc-0026.md @@ -27,13 +27,19 @@ Elements of the query component may contain characters outside the valid range. algorandurn = "algorand://" algorandaddress [ "?" algorandparams ] algorandaddress = *base32 algorandparams = algorandparam [ "&" algorandparams ] -algorandparam = [ amountparam / labelparam / noteparam / assetparam / otherparam ] +algorandparam = [ amountparam / labelparam / noteparam / assetparam / appparam / methodparam / argparam/ assetarrayparam / accountarrayparam / apparrayparam / otherparam ] amountparam = "amount=" *digit labelparam = "label=" *qchar assetparam = "asset=" *digit +appparam = "app=" *digit noteparam = (xnote | note) xnote = "xnote=" *qchar -note = "note=" *qchar +note = "note=" *qchar +methodparam = "method=" *qchar +argparam = "arg=" (*qchar | *digit) +accountarrayparam = "account=" *qchar +assetarrayparam = "asset=" *digit +apparrayparam = "app=" *digit otherparam = qchar *qchar [ "=" *qchar ] ``` @@ -41,6 +47,10 @@ Here, "qchar" corresponds to valid characters of an RFC 3986 URI query component The scheme component ("algorand:") is case-insensitive, and implementations must accept any combination of uppercase and lowercase letters. The rest of the URI is case-sensitive, including the query parameter keys. +Note 1: the first `app=` in the presence of the method interprets as the destination app Id and the next ones in sequence would be considered app array members. + +Note 2: the `asset=` in the presence of the method interprets as an asset array member. + !!! Caveat When it comes to generation of an address' QR, many exchanges and wallets encodes the address w/o the scheme component (“algorand:”). This is not a URI so it is OK. @@ -56,7 +66,15 @@ The scheme component ("algorand:") is case-insensitive, and implementations must - amount: microAlgos or smallest unit of asset -- asset: The asset id this request refers to (if Algos, simply omit this parameter) +- asset: The asset id this request refers to (if Algos, simply omit this parameter). When the method is available, the asset is an Asset Array member for the ABI call. + +- method: The full ABI method to call. E.g. claim(uint64,uint64)byte[] + +- arg: The argument to be added to ABI call arguments array. + +- app: The app id this request refers to. When method is available, first app is the destination app for ABI call and from second index app is an App Array member for ABI call. + +- account: The account address to add to accounts array after sender. Only when method is available. - (others): optional, for future extensions @@ -99,12 +117,20 @@ Request 150 units of Asset ID 45 from an address algorand://TMTAD6N22HCS2LKH7677L2KFLT3PAQWY6M4JFQFXQS32ECBFC23F57RYX4?amount=150&asset=45 ``` +call claim(uint64,uint64)byte[] method on contract 11111111 + +``` +algorand://TMTAD6N22HCS2LKH7677L2KFLT3PAQWY6M4JFQFXQS32ECBFC23F57RYX4?app=11111111&method=claim(uint64,uint64)byte[]&arg=20000&arg=474567&asset=45 +``` + ## Rationale +The addition of ARC4 support to ARC26 is a mandatory step for effective interactivity of Algorand operations with users and increases interoperability amongst users as well + ## Security Considerations None. ## Copyright -Copyright and related rights waived via CCO. \ No newline at end of file +Copyright and related rights waived via CCO. From 6747ac5b5873a750ab8d3a2384cff93c46b51707 Mon Sep 17 00:00:00 2001 From: MG Date: Wed, 11 Sep 2024 18:09:15 +0300 Subject: [PATCH 2/9] Added Box Refference Added Box Refference --- ARCs/arc-0026.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ARCs/arc-0026.md b/ARCs/arc-0026.md index 8fc68a74c..e364df879 100644 --- a/ARCs/arc-0026.md +++ b/ARCs/arc-0026.md @@ -27,7 +27,7 @@ Elements of the query component may contain characters outside the valid range. algorandurn = "algorand://" algorandaddress [ "?" algorandparams ] algorandaddress = *base32 algorandparams = algorandparam [ "&" algorandparams ] -algorandparam = [ amountparam / labelparam / noteparam / assetparam / appparam / methodparam / argparam/ assetarrayparam / accountarrayparam / apparrayparam / otherparam ] +algorandparam = [ amountparam / labelparam / noteparam / assetparam / appparam / methodparam / argparam/ boxparam / assetarrayparam / accountarrayparam / apparrayparam / otherparam ] amountparam = "amount=" *digit labelparam = "label=" *qchar assetparam = "asset=" *digit @@ -36,6 +36,7 @@ noteparam = (xnote | note) xnote = "xnote=" *qchar note = "note=" *qchar methodparam = "method=" *qchar +boxparam = "box=" *qchar argparam = "arg=" (*qchar | *digit) accountarrayparam = "account=" *qchar assetarrayparam = "asset=" *digit @@ -72,6 +73,8 @@ Note 2: the `asset=` in the presence of the method interprets as an asset array - arg: The argument to be added to ABI call arguments array. +- box: The box name refference. + - app: The app id this request refers to. When method is available, first app is the destination app for ABI call and from second index app is an App Array member for ABI call. - account: The account address to add to accounts array after sender. Only when method is available. From d63410a9a21a5ebdccecc6f9d4c6c576bcefa8ac Mon Sep 17 00:00:00 2001 From: MG Date: Wed, 11 Sep 2024 19:03:34 +0300 Subject: [PATCH 3/9] Update ARCs/arc-0026.md Co-authored-by: Cosimo Bassi <65770425+cusma@users.noreply.github.com> --- ARCs/arc-0026.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ARCs/arc-0026.md b/ARCs/arc-0026.md index e364df879..d1831595a 100644 --- a/ARCs/arc-0026.md +++ b/ARCs/arc-0026.md @@ -120,7 +120,7 @@ Request 150 units of Asset ID 45 from an address algorand://TMTAD6N22HCS2LKH7677L2KFLT3PAQWY6M4JFQFXQS32ECBFC23F57RYX4?amount=150&asset=45 ``` -call claim(uint64,uint64)byte[] method on contract 11111111 +Call claim(uint64,uint64)byte[] method on contract 11111111 from an address ``` algorand://TMTAD6N22HCS2LKH7677L2KFLT3PAQWY6M4JFQFXQS32ECBFC23F57RYX4?app=11111111&method=claim(uint64,uint64)byte[]&arg=20000&arg=474567&asset=45 From f194abdca466ddbb2b0e953098c24c4ae282d1fe Mon Sep 17 00:00:00 2001 From: MG Date: Wed, 11 Sep 2024 19:03:43 +0300 Subject: [PATCH 4/9] Update ARCs/arc-0026.md Co-authored-by: Cosimo Bassi <65770425+cusma@users.noreply.github.com> --- ARCs/arc-0026.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ARCs/arc-0026.md b/ARCs/arc-0026.md index d1831595a..ef26958d9 100644 --- a/ARCs/arc-0026.md +++ b/ARCs/arc-0026.md @@ -27,7 +27,7 @@ Elements of the query component may contain characters outside the valid range. algorandurn = "algorand://" algorandaddress [ "?" algorandparams ] algorandaddress = *base32 algorandparams = algorandparam [ "&" algorandparams ] -algorandparam = [ amountparam / labelparam / noteparam / assetparam / appparam / methodparam / argparam/ boxparam / assetarrayparam / accountarrayparam / apparrayparam / otherparam ] +algorandparam = [ amountparam / labelparam / noteparam / assetparam / appparam / methodparam / argparam / boxparam / assetarrayparam / accountarrayparam / apparrayparam / otherparam ] amountparam = "amount=" *digit labelparam = "label=" *qchar assetparam = "asset=" *digit From 2b803cedf7602ebad0774702b66635c1ebd3fb35 Mon Sep 17 00:00:00 2001 From: MG Date: Wed, 11 Sep 2024 19:04:31 +0300 Subject: [PATCH 5/9] Update arc-0026.md --- ARCs/arc-0026.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ARCs/arc-0026.md b/ARCs/arc-0026.md index ef26958d9..e61730d27 100644 --- a/ARCs/arc-0026.md +++ b/ARCs/arc-0026.md @@ -128,7 +128,7 @@ algorand://TMTAD6N22HCS2LKH7677L2KFLT3PAQWY6M4JFQFXQS32ECBFC23F57RYX4?app=111111 ## Rationale -The addition of ARC4 support to ARC26 is a mandatory step for effective interactivity of Algorand operations with users and increases interoperability amongst users as well + ## Security Considerations From 7dc613dd6072763fdd45c0eb5e3b339fa5aa50a1 Mon Sep 17 00:00:00 2001 From: MG Date: Wed, 11 Sep 2024 19:06:05 +0300 Subject: [PATCH 6/9] Update arc-0026.md --- ARCs/arc-0026.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ARCs/arc-0026.md b/ARCs/arc-0026.md index e61730d27..95a8162b4 100644 --- a/ARCs/arc-0026.md +++ b/ARCs/arc-0026.md @@ -38,6 +38,7 @@ note = "note=" *qchar methodparam = "method=" *qchar boxparam = "box=" *qchar argparam = "arg=" (*qchar | *digit) +feeparam = "fee=" *digit accountarrayparam = "account=" *qchar assetarrayparam = "asset=" *digit apparrayparam = "app=" *digit @@ -73,7 +74,9 @@ Note 2: the `asset=` in the presence of the method interprets as an asset array - arg: The argument to be added to ABI call arguments array. -- box: The box name refference. +- box: The box name reference. + +- fee: Optional static transaction fee. - app: The app id this request refers to. When method is available, first app is the destination app for ABI call and from second index app is an App Array member for ABI call. @@ -123,7 +126,7 @@ algorand://TMTAD6N22HCS2LKH7677L2KFLT3PAQWY6M4JFQFXQS32ECBFC23F57RYX4?amount=150 Call claim(uint64,uint64)byte[] method on contract 11111111 from an address ``` -algorand://TMTAD6N22HCS2LKH7677L2KFLT3PAQWY6M4JFQFXQS32ECBFC23F57RYX4?app=11111111&method=claim(uint64,uint64)byte[]&arg=20000&arg=474567&asset=45 +algorand://TMTAD6N22HCS2LKH7677L2KFLT3PAQWY6M4JFQFXQS32ECBFC23F57RYX4?app=11111111&method=claim(uint64,uint64)byte[]&arg=20000&arg=474567&asset=45&fee=10000 ``` ## Rationale From 1917fbc5c4048188caf5faa11e46fa7a2eb6da34 Mon Sep 17 00:00:00 2001 From: MG Date: Wed, 11 Sep 2024 20:31:58 +0300 Subject: [PATCH 7/9] Update arc-0026.md --- ARCs/arc-0026.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ARCs/arc-0026.md b/ARCs/arc-0026.md index 95a8162b4..62713ac09 100644 --- a/ARCs/arc-0026.md +++ b/ARCs/arc-0026.md @@ -49,10 +49,12 @@ Here, "qchar" corresponds to valid characters of an RFC 3986 URI query component The scheme component ("algorand:") is case-insensitive, and implementations must accept any combination of uppercase and lowercase letters. The rest of the URI is case-sensitive, including the query parameter keys. -Note 1: the first `app=` in the presence of the method interprets as the destination app Id and the next ones in sequence would be considered app array members. +Note 1: the first `app=` in the presence of the method interprets as the destination app ID and the next ones in sequence would be considered app array members. Note 2: the `asset=` in the presence of the method interprets as an asset array member. +Note 3: The account address in case of method presence is the Sender account not the destination recipient as it is the case with all Algorand URIs without method. + !!! Caveat When it comes to generation of an address' QR, many exchanges and wallets encodes the address w/o the scheme component (“algorand:”). This is not a URI so it is OK. @@ -84,6 +86,9 @@ Note 2: the `asset=` in the presence of the method interprets as an asset array - (others): optional, for future extensions +### Template URI vs actionable URI +If the URI is constructed for templating only so that other dApps, wallets or protocols could user it for any user then the account address in URI must be ZeroAddress ("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ"). Since ZeroAddress cannot initiate any action this assumption is considered non-vulnerable and secure. + ### Transfer amount/size !!! Note From 239d63970a14399d38594903a3248daff9ee3b93 Mon Sep 17 00:00:00 2001 From: MG Date: Wed, 11 Sep 2024 20:50:50 +0300 Subject: [PATCH 8/9] Update ARCs/arc-0026.md Co-authored-by: Cosimo Bassi <65770425+cusma@users.noreply.github.com> --- ARCs/arc-0026.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ARCs/arc-0026.md b/ARCs/arc-0026.md index 62713ac09..3cf0304b5 100644 --- a/ARCs/arc-0026.md +++ b/ARCs/arc-0026.md @@ -128,7 +128,7 @@ Request 150 units of Asset ID 45 from an address algorand://TMTAD6N22HCS2LKH7677L2KFLT3PAQWY6M4JFQFXQS32ECBFC23F57RYX4?amount=150&asset=45 ``` -Call claim(uint64,uint64)byte[] method on contract 11111111 from an address +Call claim(uint64,uint64)byte[] method on contract 11111111 paying a fee of 10000 micro ALGO from an address ``` algorand://TMTAD6N22HCS2LKH7677L2KFLT3PAQWY6M4JFQFXQS32ECBFC23F57RYX4?app=11111111&method=claim(uint64,uint64)byte[]&arg=20000&arg=474567&asset=45&fee=10000 From 41be91090365fb22ba6a6e685206ca08e40f96e1 Mon Sep 17 00:00:00 2001 From: MG Date: Wed, 11 Sep 2024 20:52:05 +0300 Subject: [PATCH 9/9] Update arc-0026.md --- ARCs/arc-0026.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ARCs/arc-0026.md b/ARCs/arc-0026.md index 3cf0304b5..f5c3ef672 100644 --- a/ARCs/arc-0026.md +++ b/ARCs/arc-0026.md @@ -78,7 +78,7 @@ Note 3: The account address in case of method presence is the Sender account not - box: The box name reference. -- fee: Optional static transaction fee. +- fee: Optional static transaction fee (in MicroAlgos) - app: The app id this request refers to. When method is available, first app is the destination app for ABI call and from second index app is an App Array member for ABI call.