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:79

Properties

isOdd

isOdd: Bool

Defined in

lib/signature.ts:135


x

x: Field

Defined in

lib/signature.ts:134

Methods

assertEquals

assertEquals(x): void

Parameters

NameType
xPublicKey

Returns

void

Inherited from

CircuitValue.assertEquals

Defined in

lib/circuit-value.ts:167


equals

equals(x): Bool

Parameters

NameType
xPublicKey

Returns

Bool

Inherited from

CircuitValue.equals

Defined in

lib/circuit-value.ts:163


isConstant

isConstant(): boolean

Returns

boolean

Inherited from

CircuitValue.isConstant

Defined in

lib/circuit-value.ts:171


isEmpty

isEmpty(): Bool

Checks if a PublicKey is empty.

Returns

Bool

a Bool

Defined in

lib/signature.ts:192


toBase58

toBase58(): string

Encodes a PublicKey in base58 format.

Returns

string

a base58 encoded PublicKey

Defined in

lib/signature.ts:210


toConstant

toConstant(): PublicKey

Returns

PublicKey

Inherited from

CircuitValue.toConstant

Defined in

lib/circuit-value.ts:159


toFields

toFields(): Field[]

Returns

Field[]

Inherited from

CircuitValue.toFields

Defined in

lib/circuit-value.ts:151


toGroup

toGroup(): Group

Returns the Group representation of this PublicKey.

Returns

Group

A Group

Defined in

lib/signature.ts:141


toJSON

toJSON(): any

Returns

any

Inherited from

CircuitValue.toJSON

Defined in

lib/circuit-value.ts:155


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:200


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:184


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:176


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:201


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:175


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:159


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:238


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:96


fromPrivateKey

Static fromPrivateKey(«destructured»): PublicKey

Derives a PublicKey from a PrivateKey.

Parameters

NameType
«destructured»PrivateKey

Returns

PublicKey

a PublicKey.

Defined in

lib/signature.ts:168


sizeInFields

Static sizeInFields(): number

Returns

number

Inherited from

CircuitValue.sizeInFields

Defined in

lib/circuit-value.ts:103


toAuxiliary

Static toAuxiliary(): []

Returns

[]

Inherited from

CircuitValue.toAuxiliary

Defined in

lib/circuit-value.ts:125


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:218


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:214


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:108


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:129


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:230