The Logic ID is unique identifier for a Logic in the MOI Protocol. It is typically represented as a hexadecimal string and encodes within itself key properties of the Logic along with the address on which it is deployed. It is important to note that the address of the Logic is not the same as the Logic ID but it can be retrieved from it.

The Logic ID Standard allows for internal versioning and any Logic ID decoder must decode the encoded logic properties depending on the schema defined for that version. The first four bits of the Logic ID are reserved to encode this version and hence the Logic ID standard as a whole supports extensibility upto 16 versions.

<aside> ⚠️ NOTE: This page only details the structure of parameter encoding for Logic ID versions. For information about the parameters and what they represent, refer to Logics

</aside>

Logic ID V0

The V0 Schema for the Logic ID is the current actively generated version (Babylon TestNet). It encodes parameters like edition of a logic along with flags for indicating if it contains persistent and ephemeral storage and whether it supports interactive calls and is associated with an asset. The total length of V0 Logic ID is 35 bytes [280 bits]

The following image illustrates the internal structure of a V0 Logic ID

version (2) (1).png

Example Logic ID v0

<aside> <img src="/icons/code_gray.svg" alt="/icons/code_gray.svg" width="40px" /> 0x080000e4b2b8269bf157148184424ab2b95aa83a0d790de8d24e4ff6810216e2702e58

</aside>

In the above Logic ID, the first 6 hex characters represent the first 3 bytes containing the version, flags and edition of the Asset. The last 32 bytes represents the address of the account on which the Asset is registered [e4b...e58].

The first 3 bytes [0x080000] indicate that this Logic is represented by v0 Logic ID. It has a persisent state but no ephemeral state, does not support interactive calls and is not associated with an asset. It has an edition of 0, meaning it is the first version of the Logic on that address

FAQs

Can the same Logic have multiple Logic IDs?

Yes, it is technically possible for the same Logic to have multiple Logic IDs. However all of these Logic IDs would share the same address and would be of different Logic ID versions. This may occur when an Logic ID is upgraded to a new representation.

Can the Logic at the same address have multiple Logic IDs?

Yes, the same Logic at the given address can have multiple Logic IDs, however each Logic ID points to a specific version or edition of that Logic.

Can I associate my Logic ID with a human-readable identifier?

The ability to alias a Logic ID with human readable identifier is planned native capability of the MOI protocol, but it is not currently supported for the Babylon Testnet. It can however be implemented at the application level with a DNS Logics similar to ENS (Ethereum Namespace Service)