Documentation
¶
Overview ¶
Package soc provides the single-owner chunk implementation and validator.
Index ¶
- Constants
- func CreateAddress(id ID, owner []byte) (swarm.Address, error)
- func UnwrapCAC(sch swarm.Chunk) (swarm.Chunk, error)
- func Valid(ch swarm.Chunk) bool
- type ID
- type SOC
- func (s *SOC) Address() (swarm.Address, error)
- func (s *SOC) Chunk() (swarm.Chunk, error)
- func (s *SOC) ID() []byte
- func (s *SOC) OwnerAddress() []byte
- func (s *SOC) OwnerPubKey() []byte
- func (s *SOC) Sign(signer crypto.Signer) (swarm.Chunk, error)
- func (s *SOC) Signature() []byte
- func (s *SOC) WrappedChunk() swarm.Chunk
Constants ¶
const OwnerPubKeySize = 33
OwnerPubKeySize is the byte length of a compressed secp256k1 public key, as returned by crypto.EncodeSecp256k1PublicKey.
Variables ¶
This section is empty.
Functions ¶
func CreateAddress ¶
CreateAddress creates a new SOC address from the id and the ethereum address of the owner.
Types ¶
type SOC ¶
type SOC struct {
// contains filtered or unexported fields
}
SOC wraps a content-addressed chunk.
func FromChunkValidate ¶
FromChunkValidate parses the chunk as a single-owner chunk and verifies that the chunk address is the address of the parsed SOC. Unlike FromChunk, it rejects a correctly signed SOC delivered under any other address.
func (*SOC) OwnerAddress ¶
OwnerAddress returns the ethereum address of the SOC owner.
func (*SOC) OwnerPubKey ¶ added in v2.8.1
OwnerPubKey returns the public key of the SOC owner.
func (*SOC) Sign ¶
Sign signs a SOC using the given signer. It returns a signed SOC chunk ready for submission to the network.
func (*SOC) WrappedChunk ¶
WrappedChunk returns the chunk wrapped by the SOC.