Skip to main content

Types.PublicKey

o1js / Modules / Types / PublicKey

Class: PublicKey

Types.PublicKey

A public key, which is also an address on the Mina network. You can derive a PublicKey directly from a PrivateKey.

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new PublicKey(...props)

Parameters

NameType
...propsany[]

Inherited from

CircuitValue.constructor

Defined in

lib/circuit_value.ts:78

Properties

isOdd

isOdd: Bool

Defined in

lib/signature.ts:119


x

x: Field

Defined in

lib/signature.ts:118

Methods

assertEquals

assertEquals(x): void

Parameters

NameType
xPublicKey

Returns

void

Inherited from

CircuitValue.assertEquals

Defined in

lib/circuit_value.ts:166


equals

equals(x): Bool

Parameters

NameType
xPublicKey

Returns

Bool

Inherited from

CircuitValue.equals

Defined in

lib/circuit_value.ts:162


isConstant

isConstant(): boolean

Returns

boolean

Inherited from

CircuitValue.isConstant

Defined in

lib/circuit_value.ts:170


isEmpty

isEmpty(): Bool

Checks if a PublicKey is empty.

Returns

Bool

a Bool

Defined in

lib/signature.ts:176


toBase58

toBase58(): string

Encodes a PublicKey in base58 format.

Returns

string

a base58 encoded PublicKey

Defined in

lib/signature.ts:194


toConstant

toConstant(): PublicKey

Returns

PublicKey

Inherited from

CircuitValue.toConstant

Defined in

lib/circuit_value.ts:158


toFields

toFields(): Field[]

Returns

Field[]

Inherited from

CircuitValue.toFields

Defined in

lib/circuit_value.ts:150


toGroup

toGroup(): Group

Returns the Group representation of this PublicKey.

Returns

Group

A Group

Defined in

lib/signature.ts:125


toJSON

toJSON(): any

Returns

any

Inherited from

CircuitValue.toJSON

Defined in

lib/circuit_value.ts:154


check

Static check\<T>(this, v): void

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
vInstanceType\<T>

Returns

void

Inherited from

CircuitValue.check

Defined in

lib/circuit_value.ts:199


empty

Static empty\<T>(): InstanceType\<T>

Creates an empty PublicKey.

Type parameters

NameType
Textends AnyConstructor

Returns

InstanceType\<T>

an empty PublicKey

Overrides

CircuitValue.empty

Defined in

lib/signature.ts:168


from

Static from(g): PublicKey

Creates a PublicKey from a JSON structure element.

Parameters

NameType
gObject
g.isOddBool
g.xField

Returns

PublicKey

a PublicKey.

Defined in

lib/signature.ts:160


fromBase58

Static fromBase58(publicKeyBase58): PublicKey

Decodes a base58 encoded PublicKey into a PublicKey.

Parameters

NameType
publicKeyBase58string

Returns

PublicKey

a PublicKey

Defined in

lib/signature.ts:185


fromFields

Static fromFields\<T>(this, xs): InstanceType\<T>

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
xsField[]

Returns

InstanceType\<T>

Inherited from

CircuitValue.fromFields

Defined in

lib/circuit_value.ts:174


fromGroup

Static fromGroup(«destructured»): PublicKey

Creates a PublicKey from a Group element.

Parameters

NameType
«destructured»Group

Returns

PublicKey

a PublicKey.

Defined in

lib/signature.ts:143


fromJSON

Static fromJSON\<T>(this, publicKey): InstanceType\<T>

Deserializes a JSON string into a PublicKey.

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
publicKeystring

Returns

InstanceType\<T>

a JSON string

Overrides

CircuitValue.fromJSON

Defined in

lib/signature.ts:222


fromObject

Static fromObject\<T>(this, value): InstanceType\<T>

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
valueNonMethods\<InstanceType\<T>>

Returns

InstanceType\<T>

Inherited from

CircuitValue.fromObject

Defined in

lib/circuit_value.ts:95


fromPrivateKey

Static fromPrivateKey(«destructured»): PublicKey

Derives a PublicKey from a PrivateKey.

Parameters

NameType
«destructured»PrivateKey

Returns

PublicKey

a PublicKey.

Defined in

lib/signature.ts:152


sizeInFields

Static sizeInFields(): number

Returns

number

Inherited from

CircuitValue.sizeInFields

Defined in

lib/circuit_value.ts:102


toAuxiliary

Static toAuxiliary(): []

Returns

[]

Inherited from

CircuitValue.toAuxiliary

Defined in

lib/circuit_value.ts:124


toBase58

Static toBase58(«destructured»): string

Static method to encode a PublicKey into base58 format.

Parameters

NameType
«destructured»PublicKey

Returns

string

a base58 encoded PublicKey

Defined in

lib/signature.ts:202


toConstant

Static toConstant\<T>(this, t): InstanceType\<T>

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
tInstanceType\<T>

Returns

InstanceType\<T>

Inherited from

CircuitValue.toConstant

Defined in

lib/circuit_value.ts:213


toFields

Static toFields\<T>(this, v): Field[]

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
vInstanceType\<T>

Returns

Field[]

Inherited from

CircuitValue.toFields

Defined in

lib/circuit_value.ts:107


toInput

Static toInput\<T>(this, v): HashInput

Type parameters

NameType
Textends AnyConstructor

Parameters

NameType
thisT
vInstanceType\<T>

Returns

HashInput

Inherited from

CircuitValue.toInput

Defined in

lib/circuit_value.ts:128


toJSON

Static toJSON(publicKey): string

Serializes a PublicKey into its JSON representation.

Parameters

NameType
publicKeyPublicKey

Returns

string

a JSON string

Overrides

CircuitValue.toJSON

Defined in

lib/signature.ts:214