Tephra SDK
  • Overview
  • Getting Started
    • Asset Creation
    • Grants & Transfers
    • Validation
    • Ejecting
  • Preservation
  • FAQs
Powered by GitBook
On this page
  • Registering an Address
  • Storing Contents
  • Allowed Fields

Was this helpful?

  1. Getting Started

Asset Creation

An asset is a representation of whatever is being preserved. Each asset can be owned by just one individual at a time.

PreviousGetting StartedNextGrants & Transfers

Last updated 3 years ago

Was this helpful?

Registering an Address

Creating an asset is as simple as calling create. This command registers a new universally unique address in Tephra. The address will be timestamped and stored in the Tephra changeset. All changes are preserved in chunks on / .

const address = await tephra.create()

console.log(`Now there's an asset at "${address}"`)
// e.g., Now there's an asset at "3a134374-b266-411f-882b-022422d05989"

Addresses can be used to retrieve information about an asset like its contents (see below), owner, date of creation, chain of custody, etc. These details are public and can be viewed by anyone using Tephra Validate.

Storing Contents

Assets can also contain details that are preserved as part of the changeset. Media should be uploaded to and provided as an address so that values are is immutable.

// Create an asset
const assetAddress = await tephra.create({
  name: 'My First Asset',
  description: 'This asset will exist forever.',
  image: {
    type: 'ipfs',
    address: someIpfsAddress,
  },
  // Attributes can be used to store any structured
  // information about the asset.
  attributes: [
    {
      label: 'Created By',
      value: 'Me.',
    },
  ],
})

Allowed Fields

All of these fields are optional.

Field

Type

name

string

description

string

image

{ type: 'ipfs', address: string }

attributes

{ label: string, value: string }[]

IPFS
Ethereum
IPFS