# How to convert a Node Address (rn...) into a Validator Address (rv...)

**URL:** <https://radixtalk.com/t/how-to-convert-a-node-address-rn-into-a-validator-address-rv/62>\
**Category:** Developers\
**Tags:** howto, python, replit\
**Created:** [25 December 2021 14:02 UTC](https://radixtalk.com/t/how-to-convert-a-node-address-rn-into-a-validator-address-rv/62 "2021-12-25T14:02:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stuart](https://radixtalk.com/letter_avatar_proxy/v4/letter/s/cab0a1/32.png) [@Stuart](https://radixtalk.com/u/Stuart)\
**Post date:** [25 December 2021 14:02 UTC](https://radixtalk.com/t/how-to-convert-a-node-address-rn-into-a-validator-address-rv/62/1 "2021-12-25T14:02:56Z")

</div>

Both the node address and the validator address are Bech32 encodings of the same compressed public key with different human-readable parts (hrp).

```python
import bech32

node_address = "rn1q22ts4wderfhzham0vnzs93g68d5hal3g8yyvv06re8sn88er9ud7us2dgj"
print("Node Address:", node_address)

# Extract Node HRP (rn) and Public Key
_hrp, public_key5 = bech32.bech32_decode(node_address)

# Re-encode Public Key with Validator HRP (rv)
validator_address = bech32.bech32_encode("rv", public_key5)
print("Validator Adddress:", validator_address)

# Returns:
# Node Address: rn1q22ts4wderfhzham0vnzs93g68d5hal3g8yyvv06re8sn88er9ud7us2dgj
# Validator Adddress: rv1q22ts4wderfhzham0vnzs93g68d5hal3g8yyvv06re8sn88er9ud7yrqayv

```

## Run this code on Replit:

https://replit.com/@radixtalk/Radix-Node-to-Radix-Validator?embed=true
