From a89f7f8e1c216a8d9e4f6a825a4c6e7193d3d87f Mon Sep 17 00:00:00 2001 From: silverpill Date: Thu, 31 Aug 2023 20:27:45 +0000 Subject: [PATCH 1/8] Monero: Add CAIP-10 spec --- monero/caip10.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 monero/caip10.md diff --git a/monero/caip10.md b/monero/caip10.md new file mode 100644 index 00000000000000..2b5574a0612c7f --- /dev/null +++ b/monero/caip10.md @@ -0,0 +1,70 @@ +--- +namespace-identifier: monero-caip10 +title: Monero - Addresses +author: silverpill (@silverpill) +discussions-to: https://github.com/ChainAgnostic/namespaces/issues/41 +status: Draft +type: Informational +created: 2023-09-01 +requires: ["CAIP-10"] +--- + +# CAIP-10 + +*For context, see the [CAIP-10][] specification.* + +## Rationale + +CAIP-10 defines a way to identify an account in a blockchain. Monero chains use UTXO model and [Monero addresses][] are functionally similar to accounts in other namespaces. + +## Semantics + +Monero has several types of addresses: [standard address](https://monerodocs.org/public-address/standard-address/), [subaddress](https://monerodocs.org/public-address/subaddress/) and [integrated address](https://monerodocs.org/public-address/integrated-address/). Any address contains network and address type identifiers, public spend key, public view key, a checksum, and may contain additional data depending on the address type. [base58-monero][] encoding is used to encode address into a string. + +CAIP-10 "accounts" should not be confused with [Monero accounts][], which are used in Monero wallets for grouping related addresses and transactions. + +## Syntax + +Monero CAIP-10 account ID is a case-sensitive string in the form: + +``` +account_id: chain_id + ":" + address +chain_id: See Monero CAIP-2 +address: [a-zA-Z0-9]{95,106} +``` + +The syntax of `chain_id` is specified in [Monero CAIP-2][]. + +## Test Cases + +This is a list of manually composed examples: + +``` +# Monero mainnet standard address +monero:418015bb9ae982a1975da7d79277c270:4AdUndXHHZ6cfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgYeYTRj5UzqtReoS44qo9mtmXCqY45DJ852K5Jv2684Rge + +# Monero mainnet integrated address +monero:418015bb9ae982a1975da7d79277c270:4LL9oSLmtpccfufTMvppY6JwXNouMBzSkbLYfpAV5Usx3skxNgYeYTRj5UzqtReoS44qo9mtmXCqY45DJ852K5Jv2bYXZKKQePHES9khPK + +# Monero private testnet subaddress +monero:00000000000000000000000000000000:86MD1PNx3vmKUQjLvxNnmUfGQoHXAg8x56Nq97KrziKj5K8ACnpNUYx2KjiNAczP3igo7uUUUoGssDvKuZ7UUEoM1A8cvZs +``` + +## Additional Considerations + +In the future new types of Monero addresses will be introduced. They will likely be longer and may exceed the 128 character limit set in [CAIP-10][] specification. + +## References + +- [CAIP-10][] +- [Monero addresses][] + +[CAIP-10]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md +[Monero addresses]: https://www.getmonero.org/resources/moneropedia/address.html +[Monero accounts]: https://www.getmonero.org/resources/moneropedia/account.html +[base58-monero]: https://monerodocs.org/cryptography/base58/ +[Monero CAIP-2]: https://github.com/ChainAgnostic/namespaces/blob/main/monero/caip2.md + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From e926da15f39d6112ef98d6c8c7d12714e2f5b57a Mon Sep 17 00:00:00 2001 From: Bumblefudge Date: Fri, 1 Sep 2023 17:27:45 +0200 Subject: [PATCH 2/8] editorial --- monero/caip10.md | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/monero/caip10.md b/monero/caip10.md index 2b5574a0612c7f..6234a7325aa753 100644 --- a/monero/caip10.md +++ b/monero/caip10.md @@ -15,13 +15,31 @@ requires: ["CAIP-10"] ## Rationale -CAIP-10 defines a way to identify an account in a blockchain. Monero chains use UTXO model and [Monero addresses][] are functionally similar to accounts in other namespaces. +CAIP-10 defines a common URI scheme for identifying actors in a pseudonymous cryptographic system. +Monero chains use the UTXO accounting model and [Monero addresses][] are functionally similar to accounts in other UTXO-based namespaces, where CAIP-10 identifiers represent **payee identifiers** (of which a given actor has many and can self-generate arbitrarily more) rather than **actor identifiers**. ## Semantics -Monero has several types of addresses: [standard address](https://monerodocs.org/public-address/standard-address/), [subaddress](https://monerodocs.org/public-address/subaddress/) and [integrated address](https://monerodocs.org/public-address/integrated-address/). Any address contains network and address type identifiers, public spend key, public view key, a checksum, and may contain additional data depending on the address type. [base58-monero][] encoding is used to encode address into a string. - -CAIP-10 "accounts" should not be confused with [Monero accounts][], which are used in Monero wallets for grouping related addresses and transactions. +Monero wallets can generate and pay out to several different types of payee addresses: +1. [standard address](https://monerodocs.org/public-address/standard-address/) for fully-public contexts, +1. [subaddress](https://monerodocs.org/public-address/subaddress/) for limiting linkability to a specific interactive context, and +1. [integrated address](https://monerodocs.org/public-address/integrated-address/) which encrypt transaction-specific metadata to a shared secret to enable automation and programmable metadata per context. + +Each of these above addresses contains: +- network identifiers, which map to [CAIP-2][] `chainId`s, +- address type identifiers encoding which of the above it is, +- a public spend key, +- a public view key, +- optionally, additional type-specific data (such as a transaction-bound metadata for an integrated address), and +- a checksum derived from the above. + +Note that the [base58-monero][] encoding is used to encode address into a string. +The alphabet is identical to that used by [base58btc-alphabet][], but padding is used to normalize encoded length to multiples of 11 characters. +Note that decoding base58-monero with a standard base58 library can create breaking inconsistencies between the binary produced and the originally-encoded byte array if such padding was used when encoding. +Decoding the base58 properly and parsing the address type identifier are required for processing the checksum and thus validating the address. + +Monero CAIP-10 URIs should not be referred to as "accounts" to avoid confusion with "[Monero accounts][]", which is a term of art used in Monero wallet user interfaces for grouping related addresses and transactions into logical units. +Referring to Monero CAIP-10 URIs as encoding "addresses" or "payees" avoids this confusion, as well as potential false equivalences with namespaces built around atomic-account transaction models, as there is a one-to-many relation of wallets to addresses assumed in the Monero actor model. ## Syntax @@ -52,18 +70,21 @@ monero:00000000000000000000000000000000:86MD1PNx3vmKUQjLvxNnmUfGQoHXAg8x56Nq97Kr ## Additional Considerations -In the future new types of Monero addresses will be introduced. They will likely be longer and may exceed the 128 character limit set in [CAIP-10][] specification. +In the future, new types of Monero addresses will be introduced. +They will likely be longer and may exceed the 128 character limit set in the [CAIP-10][] specification. ## References -- [CAIP-10][] -- [Monero addresses][] +- [Address documentation][Monero Addresses] from Monero core developer documentation +- [Account documentation][Monero Accounts] from Monero core developer documentation [CAIP-10]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md [Monero addresses]: https://www.getmonero.org/resources/moneropedia/address.html [Monero accounts]: https://www.getmonero.org/resources/moneropedia/account.html [base58-monero]: https://monerodocs.org/cryptography/base58/ [Monero CAIP-2]: https://github.com/ChainAgnostic/namespaces/blob/main/monero/caip2.md +[base58btc]: https://datatracker.ietf.org/doc/html/draft-msporny-base58-02 +[base58btc-alphabet]: https://datatracker.ietf.org/doc/html/draft-msporny-base58-02#section-21 ## Copyright From d313514bf2927df6d707febf390a6f0dab00b2ef Mon Sep 17 00:00:00 2001 From: Bumblefudge Date: Tue, 5 Sep 2023 09:23:28 +0200 Subject: [PATCH 3/8] Revert "editorial" This reverts commit e926da15f39d6112ef98d6c8c7d12714e2f5b57a. --- monero/caip10.md | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/monero/caip10.md b/monero/caip10.md index 6234a7325aa753..2b5574a0612c7f 100644 --- a/monero/caip10.md +++ b/monero/caip10.md @@ -15,31 +15,13 @@ requires: ["CAIP-10"] ## Rationale -CAIP-10 defines a common URI scheme for identifying actors in a pseudonymous cryptographic system. -Monero chains use the UTXO accounting model and [Monero addresses][] are functionally similar to accounts in other UTXO-based namespaces, where CAIP-10 identifiers represent **payee identifiers** (of which a given actor has many and can self-generate arbitrarily more) rather than **actor identifiers**. +CAIP-10 defines a way to identify an account in a blockchain. Monero chains use UTXO model and [Monero addresses][] are functionally similar to accounts in other namespaces. ## Semantics -Monero wallets can generate and pay out to several different types of payee addresses: -1. [standard address](https://monerodocs.org/public-address/standard-address/) for fully-public contexts, -1. [subaddress](https://monerodocs.org/public-address/subaddress/) for limiting linkability to a specific interactive context, and -1. [integrated address](https://monerodocs.org/public-address/integrated-address/) which encrypt transaction-specific metadata to a shared secret to enable automation and programmable metadata per context. - -Each of these above addresses contains: -- network identifiers, which map to [CAIP-2][] `chainId`s, -- address type identifiers encoding which of the above it is, -- a public spend key, -- a public view key, -- optionally, additional type-specific data (such as a transaction-bound metadata for an integrated address), and -- a checksum derived from the above. - -Note that the [base58-monero][] encoding is used to encode address into a string. -The alphabet is identical to that used by [base58btc-alphabet][], but padding is used to normalize encoded length to multiples of 11 characters. -Note that decoding base58-monero with a standard base58 library can create breaking inconsistencies between the binary produced and the originally-encoded byte array if such padding was used when encoding. -Decoding the base58 properly and parsing the address type identifier are required for processing the checksum and thus validating the address. - -Monero CAIP-10 URIs should not be referred to as "accounts" to avoid confusion with "[Monero accounts][]", which is a term of art used in Monero wallet user interfaces for grouping related addresses and transactions into logical units. -Referring to Monero CAIP-10 URIs as encoding "addresses" or "payees" avoids this confusion, as well as potential false equivalences with namespaces built around atomic-account transaction models, as there is a one-to-many relation of wallets to addresses assumed in the Monero actor model. +Monero has several types of addresses: [standard address](https://monerodocs.org/public-address/standard-address/), [subaddress](https://monerodocs.org/public-address/subaddress/) and [integrated address](https://monerodocs.org/public-address/integrated-address/). Any address contains network and address type identifiers, public spend key, public view key, a checksum, and may contain additional data depending on the address type. [base58-monero][] encoding is used to encode address into a string. + +CAIP-10 "accounts" should not be confused with [Monero accounts][], which are used in Monero wallets for grouping related addresses and transactions. ## Syntax @@ -70,21 +52,18 @@ monero:00000000000000000000000000000000:86MD1PNx3vmKUQjLvxNnmUfGQoHXAg8x56Nq97Kr ## Additional Considerations -In the future, new types of Monero addresses will be introduced. -They will likely be longer and may exceed the 128 character limit set in the [CAIP-10][] specification. +In the future new types of Monero addresses will be introduced. They will likely be longer and may exceed the 128 character limit set in [CAIP-10][] specification. ## References -- [Address documentation][Monero Addresses] from Monero core developer documentation -- [Account documentation][Monero Accounts] from Monero core developer documentation +- [CAIP-10][] +- [Monero addresses][] [CAIP-10]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md [Monero addresses]: https://www.getmonero.org/resources/moneropedia/address.html [Monero accounts]: https://www.getmonero.org/resources/moneropedia/account.html [base58-monero]: https://monerodocs.org/cryptography/base58/ [Monero CAIP-2]: https://github.com/ChainAgnostic/namespaces/blob/main/monero/caip2.md -[base58btc]: https://datatracker.ietf.org/doc/html/draft-msporny-base58-02 -[base58btc-alphabet]: https://datatracker.ietf.org/doc/html/draft-msporny-base58-02#section-21 ## Copyright From 8dab8101b8a7bbaad2a45cf23ce4e350fb7e21a9 Mon Sep 17 00:00:00 2001 From: Bumblefudge Date: Tue, 5 Sep 2023 09:48:56 +0200 Subject: [PATCH 4/8] editorial --- monero/caip10.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/monero/caip10.md b/monero/caip10.md index 2b5574a0612c7f..ee1b07fda63b2b 100644 --- a/monero/caip10.md +++ b/monero/caip10.md @@ -15,11 +15,14 @@ requires: ["CAIP-10"] ## Rationale -CAIP-10 defines a way to identify an account in a blockchain. Monero chains use UTXO model and [Monero addresses][] are functionally similar to accounts in other namespaces. +CAIP-10 defines a pattern for identifying an account in a blockchain. +Monero chains use UTXO model and [Monero addresses][] are functionally similar to accounts in other namespaces. ## Semantics -Monero has several types of addresses: [standard address](https://monerodocs.org/public-address/standard-address/), [subaddress](https://monerodocs.org/public-address/subaddress/) and [integrated address](https://monerodocs.org/public-address/integrated-address/). Any address contains network and address type identifiers, public spend key, public view key, a checksum, and may contain additional data depending on the address type. [base58-monero][] encoding is used to encode address into a string. +Monero has several types of addresses: [standard address](https://monerodocs.org/public-address/standard-address/), [subaddress](https://monerodocs.org/public-address/subaddress/) and [integrated address](https://monerodocs.org/public-address/integrated-address/). +Any address contains network and address type identifiers, public spend key, public view key, a checksum, and may contain additional data depending on the address type. +[Base58-monero][base58-monero] encoding is used to encode the address into a string. CAIP-10 "accounts" should not be confused with [Monero accounts][], which are used in Monero wallets for grouping related addresses and transactions. @@ -29,7 +32,7 @@ Monero CAIP-10 account ID is a case-sensitive string in the form: ``` account_id: chain_id + ":" + address -chain_id: See Monero CAIP-2 +chain_id: See Monero CAIP-2 profile address: [a-zA-Z0-9]{95,106} ``` @@ -52,18 +55,21 @@ monero:00000000000000000000000000000000:86MD1PNx3vmKUQjLvxNnmUfGQoHXAg8x56Nq97Kr ## Additional Considerations -In the future new types of Monero addresses will be introduced. They will likely be longer and may exceed the 128 character limit set in [CAIP-10][] specification. +In the future new types of Monero addresses will be introduced. +They will likely be longer and may exceed the 128 character limit set in [CAIP-10][] specification. ## References -- [CAIP-10][] -- [Monero addresses][] +- [Address documentation][Monero Addresses] from Monero core developer documentation +- [Account documentation][Monero Accounts] from Monero core developer documentation [CAIP-10]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md [Monero addresses]: https://www.getmonero.org/resources/moneropedia/address.html [Monero accounts]: https://www.getmonero.org/resources/moneropedia/account.html [base58-monero]: https://monerodocs.org/cryptography/base58/ [Monero CAIP-2]: https://github.com/ChainAgnostic/namespaces/blob/main/monero/caip2.md +[base58btc]: https://datatracker.ietf.org/doc/html/draft-msporny-base58-02 +[base58btc-alphabet]: https://datatracker.ietf.org/doc/html/draft-msporny-base58-02#section-21 ## Copyright From 0285e473c2a4f2c5275e82326fd0e7f2724392ba Mon Sep 17 00:00:00 2001 From: silverpill <87225021+silverpill@users.noreply.github.com> Date: Tue, 5 Sep 2023 10:38:01 +0000 Subject: [PATCH 5/8] Update monero/caip10.md Co-authored-by: Bumblefudge --- monero/caip10.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monero/caip10.md b/monero/caip10.md index ee1b07fda63b2b..43131c84e01828 100644 --- a/monero/caip10.md +++ b/monero/caip10.md @@ -12,7 +12,7 @@ requires: ["CAIP-10"] # CAIP-10 *For context, see the [CAIP-10][] specification.* - +CAIP-10 defines an pattern for identifying addresses in a cryptographic system as heirarchical URIs. ## Rationale CAIP-10 defines a pattern for identifying an account in a blockchain. From f4b0d92a4365e7ea1e397dd271c4bd5e62d06b8f Mon Sep 17 00:00:00 2001 From: silverpill <87225021+silverpill@users.noreply.github.com> Date: Tue, 5 Sep 2023 11:42:58 +0000 Subject: [PATCH 6/8] Base58-monero Co-authored-by: Bumblefudge --- monero/caip10.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monero/caip10.md b/monero/caip10.md index 43131c84e01828..739412665493d3 100644 --- a/monero/caip10.md +++ b/monero/caip10.md @@ -22,7 +22,7 @@ Monero chains use UTXO model and [Monero addresses][] are functionally similar t Monero has several types of addresses: [standard address](https://monerodocs.org/public-address/standard-address/), [subaddress](https://monerodocs.org/public-address/subaddress/) and [integrated address](https://monerodocs.org/public-address/integrated-address/). Any address contains network and address type identifiers, public spend key, public view key, a checksum, and may contain additional data depending on the address type. -[Base58-monero][base58-monero] encoding is used to encode the address into a string. +Note that the [Base58-monero][base58-monero] encoding algorithm is used to encode the address from a byte array into a string; it uses the same alphabet as [base58btc][] but should not be decoded using [base58btc][] libraries due to the additional padding step to normalize string length. CAIP-10 "accounts" should not be confused with [Monero accounts][], which are used in Monero wallets for grouping related addresses and transactions. From 3952a37d84a2f253950aebabefc527be698b6cd9 Mon Sep 17 00:00:00 2001 From: silverpill Date: Tue, 5 Sep 2023 11:45:29 +0000 Subject: [PATCH 7/8] Change references --- monero/caip10.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monero/caip10.md b/monero/caip10.md index 739412665493d3..f8111fcf84a7a7 100644 --- a/monero/caip10.md +++ b/monero/caip10.md @@ -60,8 +60,8 @@ They will likely be longer and may exceed the 128 character limit set in [CAIP-1 ## References -- [Address documentation][Monero Addresses] from Monero core developer documentation -- [Account documentation][Monero Accounts] from Monero core developer documentation +- [Address documentation][Monero Addresses] from Monero documentation +- [Account documentation][Monero Accounts] from Monero documentation [CAIP-10]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md [Monero addresses]: https://www.getmonero.org/resources/moneropedia/address.html From 0d05654e18f79ca79ac2157d2b013c068039ce0d Mon Sep 17 00:00:00 2001 From: silverpill Date: Wed, 27 Sep 2023 11:11:28 +0000 Subject: [PATCH 8/8] Revert "Update monero/caip10.md" This reverts commit 0285e473c2a4f2c5275e82326fd0e7f2724392ba. --- monero/caip10.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monero/caip10.md b/monero/caip10.md index f8111fcf84a7a7..486fa3e8911493 100644 --- a/monero/caip10.md +++ b/monero/caip10.md @@ -12,7 +12,7 @@ requires: ["CAIP-10"] # CAIP-10 *For context, see the [CAIP-10][] specification.* -CAIP-10 defines an pattern for identifying addresses in a cryptographic system as heirarchical URIs. + ## Rationale CAIP-10 defines a pattern for identifying an account in a blockchain.