D://

Bitcoin dynamic content protocol

Benefit

A D:// transaction refers to another transaction/file and thus forms a layer which state can be overwritten. This way, referencing content via D:// links (instead of b:// or c://) has the advantage of keeping the URL while the content can change.

Example B:// (can not be changed once set):
<img src="B://<TxID>"

Example D:// (content can be changed, because the state can be updated):
<img src="D://<OwnerBitcoinAddress>/<key>"

Overwrite D:// State

New transactions with the same key from a sender overwrite the previous state. The Planaria API always outputs only the most current state. The owner/key combination prevents an unauthorised person from changing the state.

Protocol

The sender of the transaction will always be an "owner" of the state = first input address will be able to change the state again.

D:// transactions comes in 2 variants.

External reference

A D:// transaction with external reference is formatted like:

OP_RETURN
  19iG3WTYSsbyos3uJ733yK4zEioi1FesNU
  [key]
  [value]
  [type]
  [sequence]

Example:

OP_RETURN
  19iG3WTYSsbyos3uJ733yK4zEioi1FesNU
  "zebra.jpeg"
  0f9e7b6542eba739bd407323f58d75327dd1d68a53d2a535337a4dcf0ddb0edc
  tx
  1

Internal reference

A D:// transaction with internal reference is piped directly on to a B:// formatted structure (with mandatory fields for encoding and filename). type must always be b and value field will always be ignored.

OP_RETURN
  19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAut
  [DATA]
  [MEDIA TYPE]
  [ENCODING] or NULL
  [FILENAME] or NULL
  |
  19iG3WTYSsbyos3uJ733yK4zEioi1FesNU
  [key]
  NULL
  b
  [sequence]

Explicit owner

Both transactions with internal and external references can add an explicit owner by piping the AIP protocol that signs all previous fields (API_ALL).

Example A:

OP_RETURN
  19iG3WTYSsbyos3uJ733yK4zEioi1FesNU
  [key]
  [value]
  [type]
  [sequence]
  |
  15PciHG22SNLQJXMoSUaWVi7WSqc7hCfva
  [Signing Algorithm]
  [Signing Address]
  [Signature]

Example B:

OP_RETURN
  19HxigV4QyBv3tHpQVcUEQyq1pzZVdoAut
  [DATA]
  [MEDIA TYPE]
  [ENCODING] or NULL
  [FILENAME] or NULL
  |
  19iG3WTYSsbyos3uJ733yK4zEioi1FesNU
  [key]
  NULL
  b
  [sequence]
  |
  15PciHG22SNLQJXMoSUaWVi7WSqc7hCfva
  [Signing Algorithm]
  [Signing Address]
  [Signature]

If a transaction includes a valid AIP signature and the signature involves all previous fields (AIP_ALL) both the sender and AIP signing address will create an updated state for key. Effectively this means that you will be able to access the content with both D://<tx sender address>/<key> and D://<AIP signing address>/<key>.

Delete

A key is "removed" by updating the key with a type value set to NULL (0x00). The state of the planaria will provide the string deleted as "type" when a key is removed.

Example:

OP_RETURN
  19iG3WTYSsbyos3uJ733yK4zEioi1FesNU
  [key]
  NULL
  NULL
  1

Example Tx

This is an example Website with D:// link in it: https://bico.media/0363e9addc3f5de6587b250a07c4bab00f58f54cf780aa5f0f4655a8d3e4cfa5

The image is mapped like

<img src="D://19iG3WTYSsbyos3uJ733yK4zEioi1FesNU/der_wolf_und_die_sieben_geislein.jpeg">` 
  ==> C://c808b8aa7bf72a0732d1a366d530b6ad3cdea1f25cbe075ca075dc1f55006e5e 
    ==> B://efb301edd3a8b2270aea61cdc46bd923130a8c05245f763ff3c3c8fea1f0fc27

State machine D:// tx: https://whatsonchain.com/tx/329eacb2d1ab8770ac01d2daa13a852d72282379ea26caca1729817315fb12b0

State machine Query: https://d.onchain.ch/query/1G3BpTyEK6xF4LaQTHqdFBBaVxYHZzts4M/ewogICJ2IjogMywKICAicSI6IHsKICAgICJmaW5kIjogewogICAgICAic2VuZGVyIjoiMTlpRzNXVFlTc2J5b3MzdUo3MzN5SzR6RWlvaTFGZXNOVSIsCiAgICAgICJhbGlhcyI6ImRlcl93b2xmX3VuZF9kaWVfc2llYmVuX2dlaXNsZWluLmpwZWciCiAgICB9LAogICAgImxpbWl0IjogMTAwCiAgfSwKICAiciI6IHsKICAgICJmIjogIlsuW10gfCB7IHRyYW5zYWN0aW9uOiAudHhpZCwgYmxvY2s6IC5ibGsuaSwgc2VuZGVyOiAuc2VuZGVyICwgYWxpYXM6IC5hbGlhcywgcG9pbnRlcjogLnBvaW50ZXIsY250OiAuY250LCB0eXBlOiAudHlwZSAsIHNlcTogLnNlcSAsIFwiVVJJIG92ZXIgaHR0cHNcIjogKGlmIC50eXBlID09IFwiY1wiIHRoZW4gXCJodHRwczovL2RhdGEuYml0ZGIubmV0d29yay8xS3VVcjJwU0pEYW85N1hNOEpzcTh6d0xTNlcxV3RGZkxnL2MvXFwoLnBvaW50ZXIpXCIgZWxzZSBcImh0dHBzOi8vYi5iaXRkYi5uZXR3b3JrI1xcKC5wb2ludGVyKVwiIGVuZCl9XSIKICB9Cn0=

Referencing

A D:// transaction is referenced by D://<OwnerBitcoinAddress>/<key> or bit://19iG3WTYSsbyos3uJ733yK4zEioi1FesNU/<OwnerBitcoinAddress>/<key>

Links

Future ideas


D:// was born as a brainchild of SH and @rangelWulff