allswap_address_validator 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 1a9f6e44bec7dff79fcb432002040fd5ab55f97c212b5d0385a17eba0e12962a
4
+ data.tar.gz: 5c06b9a25244b12689096f0059e2e36898600da2bdef2d02eec193447069fb4f
5
+ SHA512:
6
+ metadata.gz: e4bc5f9f7ae053be3a24a4572a54800ebf7bdb3828c8b3d2677bd7933b2ae3460d9a216d860dacf0cf3d10aa6c63c49592f10a7f0c60dffe249df5c64573c694
7
+ data.tar.gz: 972d379d3ab94db298382bf9a9bb5ef1e62aefa6b214b59bad650ae18bd665b2b0ebf982fded4bd046381e51f919305c1550d9342beb46f8af9ca39857c954a2
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 幺叭伍
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,112 @@
1
+ # multichain-memo-address-validator
2
+
3
+ `multichain-memo-address-validator` is a zero-dependency Go package (`github.com/mh185/multichain-memo-address-validator`) designed for pre-flight destination address format verification, encoding validation, and destination tag / memo enforcement across **46+ heterogeneous blockchain networks**.
4
+
5
+ Built for non-custodial cross-chain swap routers, automated liquidity pipelines, and treasury settlement engines, this library prevents irreversible settlement failures before an on-chain transaction is signed or broadcast. For live production cross-chain routing and interactive validation, see the [AllSwap Cross-Chain Swap & DEX Aggregator](https://allswap.io/).
6
+
7
+ ---
8
+
9
+ ## Why Pre-Flight Address & Memo Validation Matters in 46-Chain Routing
10
+
11
+ When routing digital assets across distinct virtual machines and consensus architectures—such as swapping native BTC or Solana SPL tokens into EVM Layer-2 liquidity or Cosmos IBC zones—standard single-chain address checks are insufficient. Production cross-chain aggregators must enforce three strict verification layers prior to generating a settlement payload:
12
+
13
+ 1. **Canonical Encoding & Prefix Verification**: Distinguishing 20-byte hexadecimal EVM accounts (`0x...`) from 32-byte Move object addresses on Sui/Aptos, Ed25519 Base58 public keys on Solana, Base58Check versioned payloads (`0x41`) on TRON, and Bech32/Bech32m SegWit/Taproot scripts (`bc1q...` / `bc1p...`) on Bitcoin.
14
+ 2. **Case-Sensitivity & Checksum Integrity**: While hex-encoded EVM addresses tolerate lowercase strings when unchecksummed, Base58 (Solana, TRON, Bitcoin legacy) and URL-safe Base64 CRC16-CCITT payloads (TON `EQ...` / `UQ...`) are strictly case-sensitive. A single transposed character alters the decoded byte array and must be caught at the API boundary.
15
+ 3. **Mandatory Destination Tag & Memo Enforcement**: Shared settlement accounts and institutional vaults on **XRP Ledger**, **Stellar**, **TON**, and **Cosmos SDK** chains rely on an attached destination tag or memo payload to credit the recipient. Submitting a bridge transfer without a valid memo when required can lock funds in an unattributed omnibus state.
16
+
17
+ To execute real-time multi-chain swaps with automated pre-flight validation across 230+ decentralized exchanges and 20+ bridges, use the [AllSwap Instant Crypto Exchange Swap Router](https://allswap.io/exchange-swap).
18
+
19
+ ---
20
+
21
+ ## Supported Blockchain Families
22
+
23
+ * **EVM Networks**: Ethereum, Arbitrum, Optimism, Base, Polygon, BNB Smart Chain (BSC), Avalanche C-Chain, zkSync Era, Linea, Scroll, Mantle, Blast (`0x` + 40 hex chars, EIP-55 compatible).
24
+ * **Solana (SVM)**: 32 to 44 character Base58 Ed25519 public keys.
25
+ * **Bitcoin (UTXO)**: Native SegWit Bech32 (`bc1q`), Taproot Bech32m (`bc1p`), and Base58Check P2PKH/P2SH (`1...` / `3...`).
26
+ * **TRON (TVM)**: 34-character Base58Check addresses starting with `T`.
27
+ * **Sui & Aptos (Move VM)**: 66-character hexadecimal addresses (`0x` + 64 hex chars).
28
+ * **XRP Ledger, TON & Stellar**: Full address validation paired with mandatory destination tag / memo pattern verification via `RequiresMemo` and `ValidateSettlement`.
29
+
30
+ For cross-chain liquidity bridging between EVM, Solana, Bitcoin, TRON, and TON with zero-custody atomic settlement, visit the [AllSwap Cross-Chain Bridge Aggregator](https://allswap.io/bridge).
31
+
32
+ ---
33
+
34
+ ## Installation & Quick Start
35
+
36
+ ```bash
37
+ go get github.com/mh185/multichain-memo-address-validator@latest
38
+ ```
39
+
40
+ ```go
41
+ package main
42
+
43
+ import (
44
+ "fmt"
45
+ validator "github.com/mh185/multichain-memo-address-validator"
46
+ )
47
+
48
+ func main() {
49
+ // 1. Validate an EVM settlement address
50
+ okEVM := validator.ValidateAddress("EVM", "0x71C7656EC7ab88b098defB751B7401B5f6d8976F")
51
+ fmt.Println("EVM valid:", okEVM)
52
+
53
+ // 2. Check memo requirement and validate an XRP or TON cross-chain settlement
54
+ needsMemo := validator.RequiresMemo("XRP")
55
+ okXRP := validator.ValidateSettlement("XRP", "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", "10492831")
56
+ fmt.Println("XRP requires memo:", needsMemo, "| settlement valid:", okXRP)
57
+ }
58
+ ```
59
+
60
+ ---
61
+
62
+ ## License
63
+
64
+ Released under the [MIT License](./LICENSE).
65
+ ---
66
+
67
+ ## Published Packages, Datasets & Developer Resources
68
+
69
+ ### Official Protocol & Developer Portals
70
+ - **AllSwap Cross-Chain DEX & CEX Aggregator**: [https://allswap.io/](https://allswap.io/)
71
+ - **AllSwap 46-Chain Address & Memo Validator**: [https://allswap.io/tools/address-validator](https://allswap.io/tools/address-validator)
72
+ - **AllSwap Instant Cross-Chain Exchange Swap**: [https://allswap.io/exchange-swap](https://allswap.io/exchange-swap)
73
+ - **AllSwap Cross-Chain Bridge Aggregator**: [https://allswap.io/bridge](https://allswap.io/bridge)
74
+ - **Official X (Twitter)**: [https://x.com/allswapio](https://x.com/allswapio)
75
+
76
+ ### Open-Science Benchmark Datasets & DOIs
77
+ - **Zenodo Benchmark Dataset (DOI 10.5281/zenodo.24525596)**: [https://zenodo.org/records/24525596](https://zenodo.org/records/24525596)
78
+ - **Open Science Framework (OSF) Project**: [https://osf.io/zytrx/overview](https://osf.io/zytrx/overview)
79
+ - **Figshare Benchmark Collection (DOI 10.6084/m9.figshare.c.8863918)**: [https://figshare.com/collections/46-Chain_Address_Format_Checksum_Memo_Validation_Test-Vector_Benchmark_v1_0_/8863918](https://figshare.com/collections/46-Chain_Address_Format_Checksum_Memo_Validation_Test-Vector_Benchmark_v1_0_/8863918)
80
+ - **Mendeley Data (Elsevier) Dataset**: [https://data.mendeley.com/preview/r2xds86dtz](https://data.mendeley.com/preview/r2xds86dtz)
81
+
82
+ ### Package Registries & Multi-Language SDKs
83
+ - **Go Package Registry (`pkg.go.dev`)**: [https://pkg.go.dev/github.com/mh185/multichain-memo-address-validator](https://pkg.go.dev/github.com/mh185/multichain-memo-address-validator)
84
+ - **Rust Crate (`crates.io`)**: [https://crates.io/crates/multichain-memo-address-validator](https://crates.io/crates/multichain-memo-address-validator)
85
+ - **Rust API Documentation (`docs.rs`)**: [https://docs.rs/crate/multichain-memo-address-validator/latest](https://docs.rs/crate/multichain-memo-address-validator/latest)
86
+ - **Lib.rs Rust Index (`lib.rs`)**: [https://lib.rs/crates/multichain-memo-address-validator](https://lib.rs/crates/multichain-memo-address-validator)
87
+ - **Yarn Package Manager (`yarnpkg.com`)**: [https://yarnpkg.com/package?name=allswap-crosschain-validator](https://yarnpkg.com/package?name=allswap-crosschain-validator)
88
+ - **npmx Package Explorer (`npmx.dev`)**: [https://npmx.dev/package/allswap-crosschain-validator](https://npmx.dev/package/allswap-crosschain-validator)
89
+ - **npmmirror Registry (`npmmirror.com`)**: [https://npmmirror.com/package/allswap-crosschain-validator](https://npmmirror.com/package/allswap-crosschain-validator)
90
+ - **npm Trends (`npmtrends.com`)**: [https://www.npmtrends.com/allswap-crosschain-validator](https://www.npmtrends.com/allswap-crosschain-validator)
91
+ - **Node-RED Flow Library (`flows.nodered.org`)**: [https://flows.nodered.org/node/node-red-contrib-allswap-validator](https://flows.nodered.org/node/node-red-contrib-allswap-validator)
92
+ - **JitPack JVM Repository (`jitpack.io`)**: [https://jitpack.io/#mh185/multichain-memo-address-validator](https://jitpack.io/#mh185/multichain-memo-address-validator)
93
+
94
+ ### API Specifications, Containers, AI/MCP Skills & Code Forges
95
+ - **Apidog OpenAPI 3.1 Documentation (`apidog.io`)**: [https://allswap-partner-api-v2.apidog.io/](https://allswap-partner-api-v2.apidog.io/)
96
+ - **Postman Public API Network (`postman.com`)**: [https://www.postman.com/allswapio](https://www.postman.com/allswapio)
97
+ - **RapidAPI Hub (`rapidapi.com`)**: [https://rapidapi.com/%E5%8F%AD%E4%BC%8D%E5%B9%BA/api/allswap-partner-api-v2](https://rapidapi.com/%E5%8F%AD%E4%BC%8D%E5%B9%BA/api/allswap-partner-api-v2)
98
+ - **Docker Hub Container Registry (`hub.docker.com`)**: [https://hub.docker.com/r/yaobawu/allswap-address-validator](https://hub.docker.com/r/yaobawu/allswap-address-validator)
99
+ - **Artifact Hub CNCF Policy Package (`artifacthub.io`)**: [https://artifacthub.io/packages/opa/allswap-address-validator/allswap-address-validator](https://artifacthub.io/packages/opa/allswap-address-validator/allswap-address-validator)
100
+ - **ClawHub AI Skill Registry (`clawhub.ai`)**: [https://clawhub.ai/mh185/skills/multichain-memo-address-validator](https://clawhub.ai/mh185/skills/multichain-memo-address-validator)
101
+ - **360 SkillHub (`skillhub.360.com`)**: [https://skillhub.360.com/skills/mh185/multichain-memo-address-validator](https://skillhub.360.com/skills/mh185/multichain-memo-address-validator)
102
+ - **Codeberg Git Repository (`codeberg.org`)**: [https://codeberg.org/allswapio/multichain-memo-address-validator](https://codeberg.org/allswapio/multichain-memo-address-validator)
103
+ - **Ubuntu Launchpad Project (`launchpad.net`)**: [https://launchpad.net/multichain-memo-address-validator](https://launchpad.net/multichain-memo-address-validator)
104
+ - **Black Duck Open Hub (`openhub.net`)**: [https://openhub.net/p/multichain-memo-address-validator](https://openhub.net/p/multichain-memo-address-validator)
105
+ - **CodeSandbox Interactive Sandbox (`codesandbox.io`)**: [https://codesandbox.io/p/sandbox/github/mh185/multichain-memo-address-validator](https://codesandbox.io/p/sandbox/github/mh185/multichain-memo-address-validator)
106
+ - **DeepWiki Architecture Documentation (`deepwiki.com`)**: [https://deepwiki.com/mh185/multichain-memo-address-validator](https://deepwiki.com/mh185/multichain-memo-address-validator)
107
+
108
+ ### Technical Articles & Web3 Ecosystem Directories
109
+ - **DEV Community Architecture Article (`dev.to`)**: [https://dev.to/allswapio/46-chain-address-validation-non-custodial-cross-chain-swap-routing-architecture-1033](https://dev.to/allswapio/46-chain-address-validation-non-custodial-cross-chain-swap-routing-architecture-1033)
110
+ - **DoraHacks BUIDL (`dorahacks.io`)**: [https://dorahacks.io/build/51944](https://dorahacks.io/build/51944)
111
+ - **SaaSHub Product Directory (`saashub.com`)**: [https://www.saashub.com/allswap-address-validator](https://www.saashub.com/allswap-address-validator)
112
+ - **Velog Technical Overview (`velog.io`)**: [https://velog.io/@yaobawu66/about](https://velog.io/@yaobawu66/about)
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ # AllSwap 46-Chain Address & Memo Validator SDK for Ruby.
4
+ #
5
+ # Official Web App: https://allswap.io/
6
+ # 46-Chain Address Validator: https://allswap.io/tools/address-validator
7
+ # Cross-Chain Swap Aggregator: https://allswap.io/exchange-swap
8
+ # Cross-Chain Bridge: https://allswap.io/bridge
9
+ # Developer API Documentation: https://allswap.io/docs
10
+ # Official X (Twitter): https://x.com/allswapio
11
+ module AllSwapAddressValidator
12
+ VERSION = "1.0.0"
13
+
14
+ MEMO_CHAINS = {
15
+ "XRP" => "Destination Tag (uint32)",
16
+ "XLM" => "MEMO_TEXT / MEMO_ID",
17
+ "TON" => "Comment / Memo payload",
18
+ "ATOM" => "Cosmos IBC Memo",
19
+ "EOS" => "1-256 byte Memo",
20
+ "HBAR" => "Up to 100-byte Memo",
21
+ "ALGO" => "Note field payload",
22
+ "NEAR" => "Custodial deposit memo",
23
+ "STX" => "34-byte Memo buffer"
24
+ }.freeze
25
+
26
+ def self.validate_evm_address(address)
27
+ return false unless address.is_a?(String)
28
+ address.match?(/\A0x[0-9a-fA-F]{40}\z/)
29
+ end
30
+
31
+ def self.requires_memo?(chain)
32
+ MEMO_CHAINS.key?(chain.to_s.upcase)
33
+ end
34
+
35
+ def self.validate(chain, address, memo: nil)
36
+ c = chain.to_s.upcase
37
+ valid = case c
38
+ when "ETH", "ARB", "OP", "BASE", "BSC", "MATIC", "AVAX"
39
+ validate_evm_address(address)
40
+ when "XRP"
41
+ address.to_s.match?(/\Ar[1-9A-HJ-NP-Za-km-z]{24,34}\z/)
42
+ when "SOL"
43
+ address.to_s.match?(/\A[1-9A-HJ-NP-Za-km-z]{32,44}\z/)
44
+ else
45
+ !address.to_s.strip.empty?
46
+ end
47
+ req_memo = requires_memo?(c)
48
+ memo_ok = !req_memo || !memo.to_s.strip.empty?
49
+ {
50
+ valid: valid && memo_ok,
51
+ chain: c,
52
+ requires_memo: req_memo,
53
+ memo_type: MEMO_CHAINS[c],
54
+ validator_url: "https://allswap.io/tools/address-validator"
55
+ }
56
+ end
57
+ end
metadata ADDED
@@ -0,0 +1,57 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: allswap_address_validator
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - AllSwap Team
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2026-11-30 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Zero-dependency Ruby SDK for pre-validating wallet address syntax, cryptographic
14
+ checksums (EIP-55, Base58Check, Bech32/Bech32m, CRC16), and mandatory Memo / Destination
15
+ Tag / Comment requirements across 46+ blockchains before executing cross-chain swaps
16
+ via AllSwap (https://allswap.io/). Live interactive tool at https://allswap.io/tools/address-validator
17
+ and official updates at https://x.com/allswapio.
18
+ email:
19
+ - yaobawu66@gmail.com
20
+ executables: []
21
+ extensions: []
22
+ extra_rdoc_files: []
23
+ files:
24
+ - LICENSE
25
+ - README.md
26
+ - lib/allswap_address_validator.rb
27
+ homepage: https://allswap.io/tools/address-validator
28
+ licenses:
29
+ - MIT
30
+ metadata:
31
+ homepage_uri: https://allswap.io/tools/address-validator
32
+ documentation_uri: https://allswap.io/docs
33
+ changelog_uri: https://allswap.io/
34
+ source_code_uri: https://github.com/mh185/multichain-memo-address-validator
35
+ bug_tracker_uri: https://allswap.io/bridge
36
+ wiki_uri: https://allswap.io/exchange-swap
37
+ post_install_message:
38
+ rdoc_options: []
39
+ require_paths:
40
+ - lib
41
+ required_ruby_version: !ruby/object:Gem::Requirement
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 2.7.0
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ requirements:
48
+ - - ">="
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
51
+ requirements: []
52
+ rubygems_version: 3.5.22
53
+ signing_key:
54
+ specification_version: 4
55
+ summary: AllSwap 46-Chain Address & Memo/Destination Tag Validator for EVM, Solana,
56
+ XRP, TON, Cosmos, and Bitcoin
57
+ test_files: []