# Name Routing

## Introduce

BtcName support BTC Taproot addresses(ordinals address, start with bc1p), BTC P2PHK address(start with 1), BTC P2SH address(start with 3), BTC SegWit address(start with bc1q), Lightning Network address，ordinals id(text,image and website), Ethereum address, Polygon address, Solona address.

The Bitcoin Taproot addresses(ordinals address,start with bc1p) will automatically take effect, and you don't need to do anything.Unisat wallet and OrdinalsWallet already support .btc name transfer.

## Set up your .btc names

1. Incribe a routing inscription using a wallet address with the domain name,can not use other wallet addresses.The format is as follows：

```json5
{
    "p":"btcname",
    "op":"routing",
    "name":"xxx.btc",
    "ord_handle":"xxx",
    "ord_index":"xxxi0",
    "btc_p2phk":"1xxx",
    "btc_p2sh":"3xxx",
    "btc_segwit":"bc1qxxx",
    "btc_lightning":"xxx",
    "eth_address":"0xxxx",
    "matic_address":"0xxxx",
    "sol_address":"xxx",
    "avatar":"xxxi0"
}
```

| Key              | Required | Description                                                                                              |
| ---------------- | -------- | -------------------------------------------------------------------------------------------------------- |
| p                | yes      | Protocol: btcname                                                                                        |
| op               | yes      | Operation: routing and reverse,additional operational support may be added in the future                 |
| name             | yes      | your .btc name                                                                                           |
| ord\_handle      | no       | Subdomains，For example www                                                                               |
| ord\_index       | no       | The inscription id pointed to, ending with i0, not the inscription number                                |
| btc\_p2phk       | no       | btc P2PHK address(start with 1)                                                                          |
| btc\_p2sh        | no       | btc P2SH address(start with 3)                                                                           |
| btc\_segwit      | no       | btc SegWit address(start with bc1q)                                                                      |
| btc\_lightning   | no       | btc Lightning Network address                                                                            |
| eth\_address     | no       | eth address                                                                                              |
| matic\_address   | no       | matic address                                                                                            |
| sol\_address     | no       | sol address                                                                                              |
| avatar           | no       | The inscription id pointed to the nft which can be an avatar, ending with i0, not the inscription number |
| reverse\_address | no       | Resolved addressolved address                                                                            |

For exmaple,you just want to parse the ordinals id,you can do this:

```json5
{
    "p":"btcname",
    "op":"routing",
    "name":"xxx.btc",
    "ord_handle":"xxx",
    "ord_index":"xxxi0"
}
```

[**Special reminder, if you want to parse 123.btc, you must be the owner of 123.btc to incribe the routing inscription. If you use a different address, it will not take effect.**](#user-content-fn-1)[^1]



For example, you can set up reverse parsing as follows：

```json
{
    "p":"btcname",
    "op":"reverse",
    "reverse_address":"xxx",
    "name":"xxx.btc"  
}
```

Special reminder, the reverse\_address should be the owner of xxx.btc.

If reverse resolution is set, this address will resolve to the set .btc name.



2.Send the routing inscriptions to 1BitcoinEaterAddressDontSendf59kuE (This is an abandoned Bitcoin address, which can prevent others from tampering with your inscription)

The above functions are waiting for support from Dapp such as Wallet. Follow the last is new rule， if the same domain name has multiple routing inscriptions, only the latest one will be recognized.

## Dapp how to support .btc name

1. Obtain the domain .btc name entered by the user
2. Query the corresponding owner address of this .btc name from the ordinals API,if the user is transferring money to the Taproot address, dapp performs the transfer operation based on the obtained address. If not, proceed to the next step.
3. Go to 1BitcoinEaterAddressDontSendf59kuE(This is an abandoned Bitcoin address for verification) to check the resolution inscription of this .btc name and compare whether this routing inscription is sent from the owner's addres.If correct, obtain the corresponding content of the routing inscription.
4. Transfer or redirect to the corresponding inscription based on the obtained routing inscription content





[^1]: 
