Skip to main content

On-chain vs Off-chain

Users can create on-chain & off-chain attestations. As for on-chain attestation, they are stored directly on the BNB chain and can be accessed to by anyone. Once user create an on-chain attestation, he/she relinquishes the ownership of the attestation. While off-chain attestations often are stored by user themselves or in Greenfield. User has the ownership of the attestations in Greenfield and manage the permissions.

On- chain vs Off-chain attestations vs Off-chain attestations in Greenfield

FeatureOn-chain AttestationsOff-chain Attestations in GreenfieldOff-chain Attestations
VisibilityPublicFull access controlMore control over data visibility
OwnershipNo ownershipUser holds ownershipNo ownership
InteroperabilityAccess by contracts directlyRequires additional steps for smart contractsRequires additional steps for smart contracts
Storage LocationDirectly on the blockchainStored in GreenfieldAnywhere.
PrivacyNeed additional methods to ensure privacy.Ensured by GreenfieldDepend on users
CostGas feeStorage fee & Gas feeFree
ImmutabilityImmutableCannot be modified by can be deletedCannot be modified by can be deleted
VerificationVerify on chain directlyAdditional steps base on the method defined in schemaAdditional steps base on the method defined in schema
TimestampsDepend on the blockchainDepend on GreenfieldDepend on the attestors
SecurityDepend on blockchain consensusDepend on cryptography algorithmDepend on cryptography algorithm

Making the Right Choice: On-chain vs. Off-chain vs. Off-chain in Greenfield

  • Privacy: If you’re handling the data that you want to control who can see when and what, off-chain could be a better choose. Moreover, if the data is extremely sensitive, you’d better no store it directly into Greenfield. Because the SP (storage provider) in Greenfield can get your data. Moreover, with techniques like zero knowledge proof or full homomorphic encryption you can also ensure privacy of off-chain data.
  • Smart Contract Interaction: If your project requires smart contracts to frequently access or verify attestation data, on-chain is your best bet. It ensures that the data is always available on the BNB/OpBNB blockchain for smart contracts to interact with. But this does not mean contracts can not access to off-chain attestations. Just there are need some additional steps.
  • Ownership & Access Control: If you want to get the ownership of data and get full access control on them, you could store data in Greenfield. There are ownership and various access control in Greenfield. Moreover, you also can mirror the permission to BNB chain or control the data in greenfield through smart contract on BNB chain.
  • Capitalizing Data: If you want to capitalize you data, you’d better choose off-chain attestation in Greenfield. As Greenfield can mirror the objects (attestations) to BNB chain, manager them through contract. Users can issue mirror of attestations on BNB chain as assets that can be traded on chain.

Store Attestations into Greenfield

User can store attestations directly in Greenfield, but to be indexed by BAS and show brief information of attestations in BASCAN, users should store their attestations with format {$schema_uid}.{$attestation_uid} in the bucket called 'bas'.