Skip to content

fix: address/hash160 round-trip for w_get_addr_from_pubkey_hash (#1)#2

Open
xre217 wants to merge 1 commit into
dogeorg:mainfrom
xre217:fix/pubkey-hash-roundtrip
Open

fix: address/hash160 round-trip for w_get_addr_from_pubkey_hash (#1)#2
xre217 wants to merge 1 commit into
dogeorg:mainfrom
xre217:fix/pubkey-hash-roundtrip

Conversation

@xre217

@xre217 xre217 commented Jul 11, 2026

Copy link
Copy Markdown

Area

python-libdogecoin (Dogecoin Python bindings) — not GigaWallet, not X.

Problem (#1)

addr -> w_dogecoin_address_to_pubkey_hash -> w_get_addr_from_pubkey_hash
returned the wrong address because:

  • first function returns bare hash160 (40 hex)
  • C getAddrFromPubkeyHash expects scriptPubKey (50 hex 76a914…88ac)

Fix

w_get_addr_from_pubkey_hash normalizes 40-char hash160 to scriptPubKey form.
Still accepts full scriptPubKey. Docs + regression test updated.

DOGE

Tips/contract in Dogecoin: DTRJECKXfxgnSzGbt7TYRikLPDocqvdmo5 · trefongwork@gmail.com

…georg#1)

w_dogecoin_address_to_pubkey_hash returns bare hash160 while
getAddrFromPubkeyHash expects a P2PKH scriptPubKey. Accept both in
w_get_addr_from_pubkey_hash by wrapping 40-char hash160 as 76a914…88ac.

Docs clarify the two formats. Adds regression test for the natural
addr -> hash160 -> addr path.
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

Successfully merging this pull request may close these issues.

1 participant