Wallet

На отдельные sats можно наносить надписи с произвольным содержанием, создавая цифровые артефакты, основанные на Биткоинах, которые можно хранить в биткоин-кошельке и передавать с помощью биткоин-транзакций. Надписи столь же долговечны, неизменяемы, безопасны и децентрализованы, как и сам Биткоин.

Для работы с надписями требуется Bitcoin full node, позволяющий видеть текущее состояние блокчейна Bitcoin, и кошелек, способный создавать надписи и осуществлять sat контроль при построении транзакций для отправки надписей на другой кошелек.

Bitcoin Core предоставляет как Bitcoin full node, так и кошелек. Однако кошелек Bitcoin Core не может создавать надписи и не осуществляет sat контроль.

Для этого требуется ord, ordinal utility. ord не реализует собственный кошелек, поэтому подкоманды ord wallet взаимодействуют с кошельками Bitcoin Core.

В этом руководстве рассматриваются:

  1. Установка Bitcoin Core
  2. Синхронизация блокчейна Bitcoin
  3. Создание кошелька Bitcoin Core
  4. Использование ord wallet receive для получения sats
  5. Создание надписей с помощью ord wallet inscribe
  6. Отправка надписей с помощью ord wallet send
  7. Получение надписей с помощью ord wallet receive
  8. Batch inscribing with ord wallet inscribe --batch

Получение помощи

Если вы застряли, попробуйте обратиться за помощью к Ordinals Discord Server, или проверить GitHub на наличие проблем и для обсуждений.

Установка Bitcoin Core

Установка Bitcoin Core доступна на сайте bitcoincore.org на странице загрузки.

Making inscriptions requires Bitcoin Core 28 or newer.

This guide does not cover installing Bitcoin Core in detail. Once Bitcoin Core is installed, you should be able to run bitcoind -version successfully from the command line. Do NOT use bitcoin-qt.

Настройка Bitcoin Core

ord requires Bitcoin Core's transaction index and rest interface.

Чтобы настроить Bitcoin Core node на ведение индекса транзакций, добавьте следующее в bitcoin.conf:

txindex=1

Или запустите bitcoind с помощью -txindex:

bitcoind -txindex

Details on creating or modifying your bitcoin.conf file can be found here.

Синхронизация блокчейна Bitcoin

Чтобы синхронизировать сеть, выполните команду:

bitcoind -txindex

...и оставьте его запущенным до получения getblockcount:

bitcoin-cli getblockcount

совпадает с количеством блоков в обозревателе блоков, например в mempool.space block explorer. ord взаимодействует с bitcoind, поэтому вы должны оставитьbitcoind включенным в фоновом режиме, пока используете ord.

The blockchain takes about 600GB of disk space. If you have an external drive you want to store blocks on, use the configuration option blocksdir=<external_drive_path>. This is much simpler than using the datadir option because the cookie file will still be in the default location for bitcoin-cli and ord to find.

Устранение проблем

Make sure you can access bitcoind with bitcoin-cli -getinfo and that it is fully synced.

If bitcoin-cli -getinfo returns Could not connect to the server, bitcoind is not running.

Make sure rpcuser, rpcpassword, or rpcauth are NOT set in your bitcoin.conf file. ord requires using cookie authentication. Make sure there is a file .cookie in your bitcoin data directory.

If bitcoin-cli -getinfo returns Could not locate RPC credentials, then you must specify the cookie file location. If you are using a custom data directory (specifying the datadir option), then you must specify the cookie location like bitcoin-cli -rpccookiefile=<your_bitcoin_datadir>/.cookie -getinfo. When running ord you must specify the cookie file location with --cookie-file=<your_bitcoin_datadir>/.cookie.

Make sure you do NOT have disablewallet=1 in your bitcoin.conf file. If bitcoin-cli listwallets returns Method not found then the wallet is disabled and you won't be able to use ord.

Make sure txindex=1 is set. Run bitcoin-cli getindexinfo and it should return something like

{
  "txindex": {
    "synced": true,
    "best_block_height": 776546
  }
}

If it only returns {}, txindex is not set. If it returns "synced": false, bitcoind is still creating the txindex. Wait until "synced": true before using ord.

If you have maxuploadtarget set it can interfere with fetching blocks for ord index. Either remove it or set whitebind=127.0.0.1:8333.

Установка ord

ord написана на языке Rust и может быть собрана из исходного кода. Предварительно собранные бинарные файлы доступны на странице релизов.

Вы можете установить последний предварительно собранный двоичный файл из командной строки с помощью команды:

curl --proto '=https' --tlsv1.2 -fsLS https://ordinals.com/install.sh | bash -s

После установки ord вы сможете выполнить команду:

ord --version

В результате которой будет выведен номер версии ord.

Creating a Wallet

ord uses bitcoind to manage private keys, sign transactions, and broadcast transactions to the Bitcoin network. Additionally the ord wallet requires ord server running in the background. Make sure these programs are running:

bitcoind -txindex
ord server

To create a wallet named ord, the default, for use with ord wallet, run:

ord wallet create

This will print out your seed phrase mnemonic, store it somewhere safe.

{
  "mnemonic": "dignity buddy actor toast talk crisp city annual tourist orient similar federal",
  "passphrase": ""
}

If you want to specify a different name or use an ord server running on a non-default URL you can set these options:

ord wallet --name foo --server-url http://127.0.0.1:8080 create

To see all available wallet options you can run:

ord wallet help

Restoring and Dumping Wallet

The ord wallet uses descriptors, so you can export the output descriptors and import them into another descriptor-based wallet. To export the wallet descriptors, which include your private keys:

$ ord wallet dump
==========================================
= THIS STRING CONTAINS YOUR PRIVATE KEYS =
=        DO NOT SHARE WITH ANYONE        =
==========================================
{
  "wallet_name": "ord",
  "descriptors": [
    {
      "desc": "tr([551ac972/86'/1'/0']tprv8h4xBhrfZwX9o1XtUMmz92yNiGRYjF9B1vkvQ858aN1UQcACZNqN9nFzj3vrYPa4jdPMfw4ooMuNBfR4gcYm7LmhKZNTaF4etbN29Tj7UcH/0/*)#uxn94yt5",
      "timestamp": 1296688602,
      "active": true,
      "internal": false,
      "range": [
        0,
        999
      ],
      "next": 0
    },
    {
      "desc": "tr([551ac972/86'/1'/0']tprv8h4xBhrfZwX9o1XtUMmz92yNiGRYjF9B1vkvQ858aN1UQcACZNqN9nFzj3vrYPa4jdPMfw4ooMuNBfR4gcYm7LmhKZNTaF4etbN29Tj7UcH/1/*)#djkyg3mv",
      "timestamp": 1296688602,
      "active": true,
      "internal": true,
      "range": [
        0,
        999
      ],
      "next": 0
    }
  ]
}

An ord wallet can be restored from a mnemonic:

ord wallet restore --from mnemonic

Type your mnemonic and press return.

To restore from a descriptor in descriptor.json:

cat descriptor.json | ord wallet restore --from descriptor

To restore from a descriptor in the clipboard:

ord wallet restore --from descriptor

Paste the descriptor into the terminal and press CTRL-D on unix and CTRL-Z on Windows.

Получение sats

Надписи делаются на отдельных sats с использованием обычных Биткоин-транзакций, комиссии которых оплачиваются в sats, поэтому вашему кошельку потребуется некоторое количество sats.

Получите новый адрес из кошелька ord, выполнив команду:

ord wallet receive

И отправьте на него немного средств.

Вы можете посмотреть ожидающие транзакции, выполнив команду:

ord wallet transactions

Как только транзакция подтвердится, вы сможете увидеть выходные данные транзакций с помощью команды ord wallet outputs.

Создание контента для надписи

Sats могут содержать любые надписи, но кошелек ord поддерживает только те типы надписей, которые могут быть отображены в проводнике блоков ord.

Кроме того, надписи включаются в транзакции, поэтому чем больше содержимое, тем выше комиссия за транзакцию с надписью.

Содержание надписи входит в состав свидетелей транзакций, которые получают льготу свидетеля. Чтобы рассчитать приблизительную комиссию, которую заплатит транзакция inscribe, разделите размер надписи на четыре и умножьте на размер комиссии.

Транзакции с надписями должны быть менее 400 000 весовых единиц, иначе они не будут переданы Bitcoin Core. Один байт содержимого надписи стоит одну весовую единицу. Поскольку транзакция с надписью включает в себя не только содержимое надписи, ограничьте размер транзакции с надписью до менее чем 400 000 весовых единиц. 390 000 весовых единиц должно быть безопасно.

Создание надписей

Чтобы создать надпись с контентом FILE, выполните команду:

ord wallet inscribe --fee-rate FEE_RATE --file FILE

Ord выдаст два ID транзакций, один для транзакции commit, другой для транзакции reveal, а также ID надписи. ID надписей имеют вид TXIDiN, где TXID - ID транзакции reveal, а N - индекс надписи в транзакции reveal.

Транзакция commit фиксирует tapscript, содержащий содержимое надписи, а транзакция reveal использует этот tapscript, раскрывая содержимое по цепочке и прописывая его на первом sat ввода, содержащем соответствующий tapscript.

Дождитесь, пока транзакция reveal будет добыта. Проверить статус транзакций commit и reveal можно с помощью mempool.space block explorer.

После того как транзакция reveal будет добыта, при запуске должен быть выведен ID надписи:

ord wallet inscriptions

Parent-Child Inscriptions

Parent-child inscriptions enable what is colloquially known as collections, see provenance for more information.

To make an inscription a child of another, the parent inscription has to be inscribed and present in the wallet. To choose a parent run ord wallet inscriptions and copy the inscription id (<PARENT_INSCRIPTION_ID>).

Now inscribe the child inscription and specify the parent like so:

ord wallet inscribe --fee-rate FEE_RATE --parent <PARENT_INSCRIPTION_ID> --file CHILD_FILE

This relationship cannot be added retroactively, the parent has to be present at inception of the child.

Отправка надписей

Попросите получателя сгенерировать новый адрес, выполнив команду:

ord wallet receive

Отправьте надпись запуском команды:

ord wallet send --fee-rate <FEE_RATE> <ADDRESS> <INSCRIPTION_ID>

Посмотреть транзакцию, находящуюся в ожидании, можно с помощью команды:

ord wallet transactions

Как только транзакция отправки подтвердится, получатель может подтвердить получение, выполнив команду:

ord wallet inscriptions

Sending Runes

Попросите получателя сгенерировать новый адрес, выполнив команду:

ord wallet receive

Send the runes by running:

ord wallet send --fee-rate <FEE_RATE> <ADDRESS> <RUNES_AMOUNT>

Where RUNES_AMOUNT is the number of runes to send, a : character, and the name of the rune. For example if you want to send 1000 of the EXAMPLE rune, you would use 1000:EXAMPLE.

ord wallet send --fee-rate 1 SOME_ADDRESS 1000:EXAMPLE

Посмотреть транзакцию, находящуюся в ожидании, можно с помощью команды:

ord wallet transactions

Once the send transaction confirms, the recipient can confirm receipt with:

ord wallet balance

Получение надписей

Сгенерируйте новый адрес получения с помощью команды:

ord wallet receive

Отправитель может передать надпись на ваш адрес с помощью:

ord wallet send --fee-rate <FEE_RATE> ADDRESS INSCRIPTION_ID

Посмотреть транзакцию, находящуюся в ожидании, можно с помощью команды:

ord wallet transactions

Once the send transaction confirms, you can confirm receipt by running:

ord wallet inscriptions