npm i @synonymdev/selfie-records

Spec

Expanding DNS-based data verification
beyond Bitcoin payment.

Selfie Records is an extension to the Bitcoin Improvement Proposal (BIP) 353, expanding the concept of DNS-based resolution of payment instructions to a broader application of identity and data verification through DNS TXT records.

🌐 Overview

Selfie Records utilizes DNS TXT records for storing and retrieving arbitrary data in a manner that is both human-readable and verifiable. This protocol extends the original concept of BIP 353 to encompass a wider range of data types beyond Bitcoin payment instructions. With Selfie Records, users can manage and resolve identities, configurations, and other data types using standard DNS infrastructure, securely and privately.

Why expand BIP353 to support more than just Bitcoin payments?

Initially, BIP353 focused solely on payments through DNS TXT records. However, the infrastructure of DNS is versatile and secure, especially when combined with DNSSEC. This project, Selfie Records, aims to expand the utility of BIP353 to support a variety of use cases through TXT records, including:

  • Identities: Verifying and associating public keys (e.g., Nostr, Bitcoin) with email addresses or domain names.
  • Payments: Continuing to support Bitcoin payments using DNS-based resolutions.
  • Other data types: DNS TXT records can store anything from authentication keys to metadata, making it a flexible and decentralized alternative to more traditional data storage methods.

By leveraging the existing DNS infrastructure, we offer a decentralized, secure, and simple solution for handling multiple types of data.

DNS use cases

✨ Features

  • Extendable Data Types: Beyond Bitcoin payment instructions, support various data types through TXT records.
  • SDK Support: Includes a robust SDK for easy integration and interaction with DNS TXT records.
  • Privacy and Security: Leverages DNSSEC to provide cryptographic assurances for the data retrieved.
  • Human-readable Resolution: Provides a user-friendly method to access and verify data directly from DNS.
  • Supports address, domains and subdomains formats: Provides a way to store and retrieve data for both address, domains and subdomains formats.

πŸš€ Motivation

While BIP 353 successfully mapped human-readable names to Bitcoin payment instructions, there was a clear demand for extending this approach to other types of data. Selfie Records answers this call by offering a standardized way to store and retrieve not just payment instructions but any data, using the globally recognized and decentralized DNS system. This approach maintains user privacy, as DNS queries do not directly expose the requester’s IP address and DNS queries can be proxied for additional anonymity.

πŸ“ Specification

Record Format

Selfie Records are TXT records that follow a specific format for storing data. The format is as follows:

# identity.user._key.domain.com # hello@miguelmedeiros.dev hello.user._bitcoin-payment.miguelmedeiros.dev # _key.domain.com # miguelmedeiros.dev _bitcoin-payment.miguelmedeiros.dev # _key.sub.domain.com # pay.miguelmedeiros.dev _bitcoin-payment.pay.miguelmedeiros.dev

Security

All TXT records must be signed with DNSSEC, ensuring their authenticity and integrity from the DNS root down to the specific record.

Resolution

Clients must verify DNSSEC signatures fully, and any record not signed with an appropriate level of security (e.g., SHA-256 or better) is considered invalid.

βš™οΈ Using dig

Use the dig command to query a TXT record from a specific DNS server. The following example retrieves the TXT record for the domain hello.user._nostr.miguelmedeiros.dev from the Cloudflare DNS server.

dig @1.1.1.1 txt hello.user._nostr.miguelmedeiros.dev
; <<>> DiG 9.18.24-0ubuntu0.22.04.1-Ubuntu <<>> @1.1.1.1 txt hello.user._nostr.miguelmedeiros.dev ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 25983 ;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 1232 ;; QUESTION SECTION: ;hello.user._nostr.miguelmedeiros.dev. IN TXT ;; ANSWER SECTION: hello.user._nostr.miguelmedeiros.dev. 60 IN TXT "npub1j35k2lyes6x45sj2nyvsmefye6k4esurwp6wn3u3mtpt6ys5u8yqzjxygp" ;; Query time: 210 msec ;; SERVER: 1.1.1.1#53(1.1.1.1) (UDP) ;; WHEN: Tue Sep 10 18:13:45 -03 2024 ;; MSG SIZE rcvd: 141

πŸ“˜ SDK Documentation

The Selfie Records SDK provides a comprehensive guide to integrating and using the protocol in your applications. See the SDK documentation for detailed examples and API descriptions.

🀝 Contributing

We welcome contributions from the community. Make an issue or submit a pull request to help improve Selfie Records. GitHub Repo.

πŸ™ Acknowledgements

Thanks to the developers and contributors of BIP 353 for laying the groundwork for DNS-based data resolution.

πŸ“„ License

All Selfie Records repositories are released under MIT License.